diff --git a/resources/[tools]/brutal_notify/DOCUMENTATION.txt b/resources/[tools]/brutal_notify/DOCUMENTATION.txt new file mode 100644 index 000000000..f61b1839e --- /dev/null +++ b/resources/[tools]/brutal_notify/DOCUMENTATION.txt @@ -0,0 +1 @@ +https://docs.brutalscripts.com/site/scripts/notify/installation-guide \ No newline at end of file diff --git a/resources/[tools]/brutal_notify/client.lua b/resources/[tools]/brutal_notify/client.lua new file mode 100644 index 000000000..b9bc7b918 Binary files /dev/null and b/resources/[tools]/brutal_notify/client.lua differ diff --git a/resources/[tools]/brutal_notify/config.lua b/resources/[tools]/brutal_notify/config.lua new file mode 100644 index 000000000..cfb5b1fe6 --- /dev/null +++ b/resources/[tools]/brutal_notify/config.lua @@ -0,0 +1,16 @@ +---------------------------------------------------------------------------------------------- +--------------------------------------| BRUTAL NOTIFY :) |-------------------------------------- +---------------------------------------------------------------------------------------------- + +--[[ +Hi, thank you for buying our script, We are very grateful! + +For help join our Discord server: https://discord.gg/85u2u5c8q9 +More informations about the script: https://docs.brutalscripts.com +--]] + +Config = { + NotifyEdit = {Command = 'notify', Title = 'MOVE', Text = 'Move where you want'}, -- /notify | Notify position edit + NotifyReset = 'notify_reset', -- /notify_reset | Reset the notify position + ExampleNotifys = true -- true / false +} \ No newline at end of file diff --git a/resources/[tools]/brutal_notify/fxmanifest.lua b/resources/[tools]/brutal_notify/fxmanifest.lua new file mode 100644 index 000000000..2130cf36e --- /dev/null +++ b/resources/[tools]/brutal_notify/fxmanifest.lua @@ -0,0 +1,40 @@ +fx_version 'cerulean' +games {'gta5'} +lua54 'yes' + +author 'Keres & Dév' +description 'Brutal Notify - store.brutalscripts.com' +version '1.2.1' + +client_scripts { + 'config.lua', + 'client.lua', + 'examples/client-examples.lua' +} + +server_scripts { + 'config.lua', + 'examples/server-examples.lua' +} + +ui_page 'html/ui.html' +files {'html/*.*'} + +export 'SendAlert' +export 'Esc' + +dependencies { + '/server:5181', -- ⚠️PLEASE READ⚠️; Requires at least SERVER build 5181 + '/gameBuild:2189', -- ⚠️PLEASE READ⚠️; Requires at least GAME build 2189. +} + +escrow_ignore {'config.lua', 'examples/client-examples.lua', 'examples/server-examples.lua'} + +--[[ +-- locked +escrow_ignore {'config.lua', 'examples/client-examples.lua', 'examples/server-examples.lua'} + +-- open +escrow_ignore {'config.lua', 'client.lua', 'examples/client-examples.lua', 'examples/server-examples.lua'} +--]] +dependency '/assetpacks' \ No newline at end of file diff --git a/resources/[tools]/brutal_notify/html/scripts.js b/resources/[tools]/brutal_notify/html/scripts.js new file mode 100644 index 000000000..734d17e59 --- /dev/null +++ b/resources/[tools]/brutal_notify/html/scripts.js @@ -0,0 +1,325 @@ +$(function () { + var sound = new Audio('sound.mp3'); + sound.volume = 0.8; + window.addEventListener('message', function (event) { + if (event.data.action == 'open') { + + TranslateX = localStorage.getItem("MenuPositionX") + TranslateY = localStorage.getItem("MenuPositionY") + if (TranslateX > -((screen.width-300)/2)){ + TranslateX = +TranslateX + +50 + } + else{ + TranslateX = +TranslateX - +50 + } + Translate = 'translate(' + TranslateX + 'px , ' + TranslateY + 'px)' + + var number = Math.floor((Math.random() * 1000) + 1); + + $('.toast').append(` +
+
+
+
+ ${event.data.message} +
+
+
+
`) + + $(`.wrapper-${number}`).css({ + "margin-bottom": "10px", + "width": "275px", + "margin": "0px 0 0 -180px", + "border-radius": "10px", + "transform": Translate, + "opacity": "0", + }) + $('.notification_main-'+number).addClass('main') + $('.text-'+number).css({ + "font-size": "14px" + }) + $(`.progress-${number}`).css({ + "position": "absolute", + "bottom":"6px", + "left": "6px", + "height": "6px", + "width": "95%", + "border-radius": "3px", + "transition": "0.2s", + }) + + var width = 95; + var id = setInterval(frame, event.data.time/100); + function frame() { + if (width === 0) { + clearInterval(id); + } + else { + width = width - 1; + $(`.progress-${number}`).css("width" , width + '%'); + } + } + + if (event.data.type == 'success') { + $(`.title-${number}`).html(event.data.title).css({ + "font-size": "16px", + "font-weight": "600", + "color": "#47cf73", + }) + $(`.notification_main-${number}`).addClass('success-icon') + $(`.wrapper-${number}`).addClass('success') + $(`.progress-${number}`).css({ + "background": "#47cf73", + }) + + if (TranslateY > ((screen.height-480)/2)){ + $(`.wrapper-${number}`).css({ + "margin": "0 0"+ -(+((document.getElementById(`wrapper-${number}`).offsetHeight)*2) + +8) +"px -180px", + }) + } + else { + $(`.wrapper-${number}`).css({ + "margin": "0 0 8px -180px", + }) + } + + if (event.data.audio) { + sound.play(); + } + } else if (event.data.type == 'info') { + $(`.title-${number}`).html(event.data.title).css({ + "font-size": "16px", + "font-weight": "600", + "color": "#2f83ff", + }) + $(`.notification_main-${number}`).addClass('info-icon') + $(`.wrapper-${number}`).addClass('info') + $(`.progress-${number}`).css({ + "background": "#2f83ff", + }) + + if (TranslateY > ((screen.height-480)/2)){ + $(`.wrapper-${number}`).css({ + "margin": "0 0"+ -(+((document.getElementById(`wrapper-${number}`).offsetHeight)*2) + +8) +"px -180px", + }) + } + else { + $(`.wrapper-${number}`).css({ + "margin": "0 0 8px -180px", + }) + } + + if (event.data.audio) { + sound.play(); + } + } else if (event.data.type == 'error') { + $(`.title-${number}`).html(event.data.title).css({ + "font-size": "16px", + "font-weight": "600", + "color": "#dc3545", + }) + $(`.notification_main-${number}`).addClass('error-icon') + $(`.wrapper-${number}`).addClass('error') + $(`.progress-${number}`).css({ + "background": "#dc3545", + }) + + if (TranslateY > ((screen.height-480)/2)){ + $(`.wrapper-${number}`).css({ + "margin": "0 0"+ -(+((document.getElementById(`wrapper-${number}`).offsetHeight)*2) + +8) +"px -180px", + }) + } + else { + $(`.wrapper-${number}`).css({ + "margin": "0 0 8px -180px", + }) + } + + if (event.data.audio) { + sound.play(); + } + } else if (event.data.type == 'warning') { + $(`.title-${number}`).html(event.data.title).css({ + "font-size": "16px", + "font-weight": "600", + "color": "#ffc107", + }) + $(`.notification_main-${number}`).addClass('warning-icon') + $(`.wrapper-${number}`).addClass('warning') + $(`.progress-${number}`).css({ + "background": "#ffc107", + }) + + if (TranslateY > ((screen.height-480)/2)){ + $(`.wrapper-${number}`).css({ + "margin": "0 0"+ -(+((document.getElementById(`wrapper-${number}`).offsetHeight)*2) + +8) +"px -180px", + }) + } + else { + $(`.wrapper-${number}`).css({ + "margin": "0 0 8px -180px", + }) + } + + if (event.data.audio) { + sound.play(); + } + } + + if (TranslateX > -((screen.width-300)/2)){ + anime({ + targets: `.wrapper-${number}`, + opacity: 1, + translateX: -50, + duration: 750, + easing: 'spring(1, 80, 10, 0)' + }) + setTimeout(function () { + anime({ + targets: `.wrapper-${number}`, + opacity: 0, + translateX: 50, + duration: 750, + easing: 'spring(1, 80, 10, 0)' + }) + setTimeout(function () { + $(`.wrapper-${number}`).remove() + }, 750) + }, event.data.time) + } + else{ + anime({ + targets: `.wrapper-${number}`, + opacity: 1, + translateX: 50, + duration: 750, + easing: 'spring(1, 80, 10, 0)' + }) + setTimeout(function () { + anime({ + targets: `.wrapper-${number}`, + opacity: 0, + translateX: -50, + duration: 750, + easing: 'spring(1, 80, 10, 0)' + }) + setTimeout(function () { + $(`.wrapper-${number}`).remove() + }, 750) + }, event.data.time) + } + + } + else if (event.data.action == 'open2') { + + TranslateX = localStorage.getItem("MenuPositionX") + TranslateY = localStorage.getItem("MenuPositionY") + Translate = 'translate(' + TranslateX + 'px , ' + TranslateY + 'px)' + + number = 1; + window.number = number + $('.toast').append(` +
+
+
+
+ ${event.data.message} +
+
+
`) + + $(`.wrapper-${number}`).css({ + "margin-bottom": "10px", + "width": "275px", + "margin": "0 0 8px -180px", + "border-radius": "10px", + "transform": Translate, + "opacity": "0", + }) + $('.notification_main-'+number).addClass('main') + $('.text-'+number).css({ + "font-size": "14px" + }) + + $(`.title-${number}`).html(event.data.title).css({ + "font-size": "16px", + "font-weight": "600", + "color": "#47cf73" + }) + $(`.notification_main-${number}`).addClass('success-icon') + $(`.wrapper-${number}`).addClass('success') + + anime({ + targets: `.wrapper-${number}`, + opacity: 1, + duration: 2500, + }) + + panel = document.getElementById(`wrapper-${number}`) + + panel.onmousedown = function(e){ + panel.style.cursor = "move" + panel.style.opacity = "0.6" + panel.style.transition = " 0s" + panel.style.transition = "opacity 0.4s" + + isDown = true; + }; + + document.addEventListener('mouseup', function() { + isDown = false; + + panel.style.transition = "all 0.7s" + panel.style.cursor = "" + panel.style.opacity = "1" + }, true); + + document.addEventListener('mousemove', function(event) { + event.preventDefault(); + if (isDown) { + mousePosition = { + + x : event.clientX, + y : event.clientY + + }; + xCenter = panel.offsetLeft + panel.offsetWidth / 2; + yCenter = panel.offsetTop + panel.offsetHeight / 2; + + TranslateX = mousePosition.x - xCenter + TranslateY = mousePosition.y - yCenter + Translate = 'translate(' + TranslateX + 'px , ' + TranslateY + 'px)' + panel.style.transform = Translate; + + localStorage.setItem("MenuPositionX", TranslateX) + localStorage.setItem("MenuPositionY", TranslateY) + } + }, true); + } + else if (event.data.action == 'reset') { + TranslateX = 0 + TranslateY = 0 + localStorage.setItem("MenuPositionX", TranslateX) + localStorage.setItem("MenuPositionY", TranslateY) + } + }) +}) + +document.onkeyup = function() { + if (event.key == 'Escape') { + $.post('https://'+GetParentResourceName()+'/close'); + anime({ + targets: `.wrapper-${number}`, + opacity: 0, + duration: 750, + }) + setTimeout(function () { + $(`.wrapper-${number}`).remove() + }, 750) + } +}; + +var mousePosition; +var offset = [0,0]; +var isDown = false; \ No newline at end of file diff --git a/resources/[tools]/brutal_notify/html/sound.mp3 b/resources/[tools]/brutal_notify/html/sound.mp3 new file mode 100644 index 000000000..d7b7143e6 Binary files /dev/null and b/resources/[tools]/brutal_notify/html/sound.mp3 differ diff --git a/resources/[tools]/brutal_notify/html/styles.css b/resources/[tools]/brutal_notify/html/styles.css new file mode 100644 index 000000000..b8dea7fe2 --- /dev/null +++ b/resources/[tools]/brutal_notify/html/styles.css @@ -0,0 +1,93 @@ +body { + margin-top: 200px; + margin-right: 50px; + font-family: 'Roboto', sans-serif; + overflow: hidden; +} + +.toast { + width: 100px; + float: right; +} + +.wrapper { + width: 100px; + height: 40px; + background-color: #1e1e1e; + float: right; +} + +.main { + margin: 12px 16px 12px 56px; + position: relative; +} + +.main::before { + font-size: 24px; + top: calc(50% - 12px); + left: -40px; + line-height: 24px; + position: absolute; +} + +/* Success Notification*/ + +.success-icon::before { + font-family: "Font Awesome 5 Free"; + content: "\f00c"; + color: #47cf73; +} + +.success { + background-color: rgba(0, 0, 0, 0.313); + color: #fff; + padding: 5px 5px 5px 5px; +} + + +/* Info Notification*/ + +.info-icon::before { + font-family: "Font Awesome 5 Free"; + content: "\f129"; + color: #2f83ff; + left: -35px; +} + +.info { + background-color: rgba(0, 0, 0, 0.313); + color: #fff; + padding: 5px 5px 5px 5px; +} + +/* Warning Notification */ + +.warning-icon::before { + font-family: "Font Awesome 5 Free"; + content: "\f12a"; + color: #ffc107; + left: -35px; +} + +.warning { + background-color: rgba(0, 0, 0, 0.313); + color: #fff; + padding: 5px 5px 5px 5px; +} + +/* Error Notification */ + + +.error-icon::before { + font-family: "Font Awesome 5 Free"; + content: "\f00d"; + color: #dc3545; + scale: 1.3; + left: -35px; +} + +.error { + background-color: rgba(0, 0, 0, 0.313); + color: #fff; + padding: 5px 5px 5px 5px; +} \ No newline at end of file diff --git a/resources/[tools]/brutal_notify/html/ui.html b/resources/[tools]/brutal_notify/html/ui.html new file mode 100644 index 000000000..803a4734d --- /dev/null +++ b/resources/[tools]/brutal_notify/html/ui.html @@ -0,0 +1,16 @@ + + + + + + + + +
+ + + + + + +