Skip to content

Commit

Permalink
refactor: formatting(all): Format with prettier and lua formatter
Browse files Browse the repository at this point in the history
  • Loading branch information
bitpredator committed Jan 24, 2024
1 parent dd5e0e2 commit 403c040
Show file tree
Hide file tree
Showing 8 changed files with 47 additions and 51 deletions.
3 changes: 2 additions & 1 deletion .github/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -99,4 +99,5 @@ fix lint error: unused argument last; accessing undefined variable Invoke; unuse
73. [esx_context]: chore: esx_context update to version 1.0.0 @bitpredator
74. [esx_menu_default]: chore: esx_menu_default update to version 1.0.0 @bitpredator
75. [esx_multicharacter]: refactor: esx_multicharacter @bitpredator
76. [esx_multicharacter]: fix: fixed problem which prevented the menu from opening @bitpredator
76. [esx_multicharacter]: fix: fixed problem which prevented the menu from opening @bitpredator
77. [esx_notify]: refactor: formatting(all): Format with prettier and lua formatter @bitpredator
4 changes: 2 additions & 2 deletions server-data/resources/[esx]/esx_notify/LICENSE
Original file line number Diff line number Diff line change
Expand Up @@ -632,7 +632,7 @@ state the exclusion of warranty; and each file should have at least
the "copyright" line and a pointer to where the full notice is found.

esx_menu_default
Copyright (C) 2015-2023
Copyright (C) 2015-2024

This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
Expand All @@ -652,7 +652,7 @@ Also add information on how to contact you by electronic and paper mail.
If the program does terminal interaction, make it output a short
notice like this when it starts in an interactive mode:

esx_menu_default Copyright (C) 2015-2023
esx_menu_default Copyright (C) 2015-2024
This program comes with ABSOLUTELY NO WARRANTY; for details type `show w'.
This is free software, and you are welcome to redistribute it
under certain conditions; type `show c' for details.
Expand Down
13 changes: 6 additions & 7 deletions server-data/resources/[esx]/esx_notify/Notify.lua
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,10 @@ local Debug = ESX.GetConfig().EnableDebug
---@param length number the length of the notification
---@param message any the message :D
local function Notify(notificatonType, length, message)

if Debug then
print("1 ".. tostring(notificatonType))
print("2 "..tostring(length))
print("3 "..message)
print(('1 %s'):format(tostring(notificatonType)))
print(('2 %s'):format(tostring(length)))
print(('3 %s'):format(message))
end

if type(notificatonType) ~= "string" then
Expand All @@ -20,9 +19,9 @@ local function Notify(notificatonType, length, message)
end

if Debug then
print("4 ".. tostring(notificatonType))
print("5 "..tostring(length))
print("6 "..message)
print(('4 %s'):format(tostring(notificatonType)))
print(('5 %s'):format(tostring(length)))
print(('6 %s'):format(message))
end

SendNuiMessage(json.encode({
Expand Down
2 changes: 1 addition & 1 deletion server-data/resources/[esx]/esx_notify/fxmanifest.lua
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
fx_version 'adamant'
lua54 'yes'
game 'gta5'
version '0.0.4'
version '1.0.0'
author 'ESX-Framework'
description 'Official NUI Notification system for ESX'

Expand Down
28 changes: 12 additions & 16 deletions server-data/resources/[esx]/esx_notify/nui/css/style.css
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
@import url('https://fonts.googleapis.com/css2?family=Montserrat:wght@100&family=Poppins:wght@300;400;500;600;800&display=swap');
@import url("https://fonts.googleapis.com/css2?family=Montserrat:wght@100&family=Poppins:wght@300;400;500;600;800&display=swap");

:root {
--color: #919191;
Expand All @@ -16,7 +16,7 @@ body {
height: 100vh;
color: var(--color);
font-weight: 100;
font-family: 'Poppins', sans-serif;
font-family: "Poppins", sans-serif;
overflow: hidden;
}

Expand All @@ -32,16 +32,16 @@ body {
min-width: 20rem;
width: fit-content;
height: 3.5rem;
background: rgba(5,5, 5, 0.9);
border-radius: .5rem;
margin-top: .5rem;
background: rgba(5, 5, 5, 0.9);
border-radius: 0.5rem;
margin-top: 0.5rem;
animation: anim 300ms ease-in-out;
align-items: center;
}

#root .innerText {
padding-left: .4rem;
padding-right: .4rem;
padding-left: 0.4rem;
padding-right: 0.4rem;
width: 100%;
}

Expand All @@ -52,7 +52,7 @@ body {

#root .text {
display: inline-block;
margin-left: .5rem;
margin-left: 0.5rem;
}

#root .error {
Expand All @@ -68,21 +68,17 @@ body {
}

.material-symbols-outlined {
font-variation-settings:
'FILL' 0,
'wght' 400,
'GRAD' 0,
'opsz' 48
font-variation-settings: "FILL" 0, "wght" 400, "GRAD" 0, "opsz" 48;
}

@keyframes anim {
0% {
transform: scaleY(0);
}
80% {
transform: scaleY(1.1)
transform: scaleY(1.1);
}
100% {
transform: scaleY(1)
transform: scaleY(1);
}
}
}
26 changes: 13 additions & 13 deletions server-data/resources/[esx]/esx_notify/nui/index.html
Original file line number Diff line number Diff line change
@@ -1,15 +1,15 @@
<!DOCTYPE html>
<html lang="en">
<head>
<script src="nui://game/ui/jquery.js" type="text/javascript"></script>
<link rel="stylesheet" href="https://fonts.googleapis.com/css2?family=Material+Symbols+Outlined:opsz,wght,FILL,[email protected],100..700,0..1,-50..200" />
<link rel="stylesheet" href="css/style.css">
<script src="js/script.js"></script>
<title>ESX Notify</title>
</head>
<body>
<div id="root">
<!-- this is just a template! No touchy touchy -->
</div>
</body>
</html>
<head>
<script src="nui://game/ui/jquery.js" type="text/javascript"></script>
<link rel="stylesheet" href="https://fonts.googleapis.com/css2?family=Material+Symbols+Outlined:opsz,wght,FILL,[email protected],100..700,0..1,-50..200" />
<link rel="stylesheet" href="css/style.css" />
<script src="js/script.js"></script>
<title>ESX Notify</title>
</head>
<body>
<div id="root">
<!-- this is just a template! No touchy touchy -->
</div>
</body>
</html>
18 changes: 9 additions & 9 deletions server-data/resources/[esx]/esx_notify/nui/js/script.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
const w = window
const w = window;

// Gets the current icon it needs to use.
const types = {
Expand All @@ -10,8 +10,8 @@ const types = {
},
["info"]: {
["icon"]: "info",
}
}
},
};

// the color codes example `i ~r~love~s~ donuts`
const codes = {
Expand All @@ -23,8 +23,8 @@ const codes = {
"~c~": "grey",
"~m~": "#212121",
"~u~": "black",
"~o~": "orange"
}
"~o~": "orange",
};

w.addEventListener("message", (event) => {
notification({
Expand All @@ -41,8 +41,8 @@ const replaceColors = (str, obj) => {
strToReplace = strToReplace.replace(new RegExp(id, "g"), obj[id]);
}

return strToReplace
}
return strToReplace;
};

notification = (data) => {
for (color in codes) {
Expand All @@ -53,7 +53,7 @@ notification = (data) => {

let newStr = replaceColors(data["message"], objArr);

data["message"] = newStr
data["message"] = newStr;
}
}

Expand All @@ -71,4 +71,4 @@ notification = (data) => {
}, data.length);

return notification;
}
};
4 changes: 2 additions & 2 deletions server-data/resources/[esx]/esx_notify/readme.md
Original file line number Diff line number Diff line change
Expand Up @@ -53,10 +53,10 @@ ESX.ShowNotification("I i ~r~love~s~ donuts", "success", 3000)

esx_notify- Notify!

Copyright (C) 2023
Copyright (C) 2023-2024

This program Is free software: you can redistribute it And/Or modify it under the terms Of the GNU General Public License As published by the Free Software Foundation, either version 3 Of the License, Or (at your option) any later version.

This program Is distributed In the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty Of MERCHANTABILITY Or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License For more details.

You should have received a copy Of the GNU General Public License along with this program. If Not, see <http://www.gnu.org/licenses/>.
You should have received a copy Of the GNU General Public License along with this program. If Not, see <http://www.gnu.org/licenses/>.

0 comments on commit 403c040

Please sign in to comment.