From de76329b4d8cc2d166d2e04a5245ee65f40d907f Mon Sep 17 00:00:00 2001 From: Benzo <102178921+Benzo00@users.noreply.github.com> Date: Tue, 26 Apr 2022 17:30:17 +0200 Subject: [PATCH] new ESX Notification --- [esx]/esx_notify/Notify.lua | 11 +++ [esx]/esx_notify/fxmanifest.lua | 23 ++++++ [esx]/esx_notify/nui/css/style.css | 14 ++++ [esx]/esx_notify/nui/index.html | 118 +++++++++++++++++++++++++++++ [esx]/esx_notify/nui/js/script.js | 29 +++++++ 5 files changed, 195 insertions(+) create mode 100644 [esx]/esx_notify/Notify.lua create mode 100644 [esx]/esx_notify/fxmanifest.lua create mode 100644 [esx]/esx_notify/nui/css/style.css create mode 100644 [esx]/esx_notify/nui/index.html create mode 100644 [esx]/esx_notify/nui/js/script.js diff --git a/[esx]/esx_notify/Notify.lua b/[esx]/esx_notify/Notify.lua new file mode 100644 index 00000000..8a54aca6 --- /dev/null +++ b/[esx]/esx_notify/Notify.lua @@ -0,0 +1,11 @@ +local function Notify(type, length, message) + SendNuiMessage(json.encode({ + type = type or "info", + length = length or 3000, + message = message or "ESX-Notify" + })) +end + +exports('Notify', Notify) +RegisterNetEvent("Notify", Notify) + diff --git a/[esx]/esx_notify/fxmanifest.lua b/[esx]/esx_notify/fxmanifest.lua new file mode 100644 index 00000000..16d7c135 --- /dev/null +++ b/[esx]/esx_notify/fxmanifest.lua @@ -0,0 +1,23 @@ +fx_version 'adamant' +game 'gta5' +author 'ESX-Framework' +description 'ESX Notification' + +shared_scripts { + '@es_extended/imports.lua', +} + +client_scripts { 'Notify.lua' } + +ui_page 'nui/index.html' + +files { + 'nui/index.html', + 'nui/js/*.js', + 'nui/css/*.css', + 'nui/img/*.png', +} + +exports { + 'Notify' +} \ No newline at end of file diff --git a/[esx]/esx_notify/nui/css/style.css b/[esx]/esx_notify/nui/css/style.css new file mode 100644 index 00000000..4b24467e --- /dev/null +++ b/[esx]/esx_notify/nui/css/style.css @@ -0,0 +1,14 @@ +:root { + --color: white; + --bgColor: #212121; +} + +* { + padding: 0; + margin: 0; +} + +body { + color: var(--color); + font-family: sans-serif; +} \ No newline at end of file diff --git a/[esx]/esx_notify/nui/index.html b/[esx]/esx_notify/nui/index.html new file mode 100644 index 00000000..e2064fe2 --- /dev/null +++ b/[esx]/esx_notify/nui/index.html @@ -0,0 +1,118 @@ + + +
+ + + + + + +