forked from Simnation/Main
Brutal Notify
This commit is contained in:
parent
ae85941177
commit
986f2c1661
8 changed files with 491 additions and 0 deletions
1
resources/[tools]/brutal_notify/DOCUMENTATION.txt
Normal file
1
resources/[tools]/brutal_notify/DOCUMENTATION.txt
Normal file
|
@ -0,0 +1 @@
|
|||
https://docs.brutalscripts.com/site/scripts/notify/installation-guide
|
BIN
resources/[tools]/brutal_notify/client.lua
Normal file
BIN
resources/[tools]/brutal_notify/client.lua
Normal file
Binary file not shown.
16
resources/[tools]/brutal_notify/config.lua
Normal file
16
resources/[tools]/brutal_notify/config.lua
Normal file
|
@ -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
|
||||
}
|
40
resources/[tools]/brutal_notify/fxmanifest.lua
Normal file
40
resources/[tools]/brutal_notify/fxmanifest.lua
Normal file
|
@ -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'
|
325
resources/[tools]/brutal_notify/html/scripts.js
Normal file
325
resources/[tools]/brutal_notify/html/scripts.js
Normal file
|
@ -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(`
|
||||
<div class="wrapper-${number}" id="wrapper-${number}">
|
||||
<div class="notification_main-${number}">
|
||||
<div class="title-${number}"></div>
|
||||
<div class="text-${number}">
|
||||
${event.data.message}
|
||||
</div>
|
||||
</div>
|
||||
<div class="progress-${number}"></div>
|
||||
</div>`)
|
||||
|
||||
$(`.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(`
|
||||
<div class="wrapper-${number}" id="wrapper-${number}">
|
||||
<div class="notification_main-${number}">
|
||||
<div class="title-${number}"></div>
|
||||
<div class="text-${number}">
|
||||
${event.data.message}
|
||||
</div>
|
||||
</div>
|
||||
</div>`)
|
||||
|
||||
$(`.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;
|
BIN
resources/[tools]/brutal_notify/html/sound.mp3
Normal file
BIN
resources/[tools]/brutal_notify/html/sound.mp3
Normal file
Binary file not shown.
93
resources/[tools]/brutal_notify/html/styles.css
Normal file
93
resources/[tools]/brutal_notify/html/styles.css
Normal file
|
@ -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;
|
||||
}
|
16
resources/[tools]/brutal_notify/html/ui.html
Normal file
16
resources/[tools]/brutal_notify/html/ui.html
Normal file
|
@ -0,0 +1,16 @@
|
|||
<!DOCTYPE html>
|
||||
<html>
|
||||
<head>
|
||||
<link href="https://fonts.googleapis.com/css2?family=Roboto&display=swap" rel="stylesheet">
|
||||
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/5.15.3/css/solid.min.css" integrity="sha512-jQqzj2vHVxA/yCojT8pVZjKGOe9UmoYvnOuM/2sQ110vxiajBU+4WkyRs1ODMmd4AfntwUEV4J+VfM6DkfjLRg==" crossorigin="anonymous">
|
||||
<link rel="stylesheet" href="styles.css">
|
||||
</head>
|
||||
<body>
|
||||
<div class="toast"></div>
|
||||
|
||||
<script src="nui://game/ui/jquery.js" type="text/javascript"></script>
|
||||
<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.3.1/jquery.min.js"></script>
|
||||
<script src="https://cdnjs.cloudflare.com/ajax/libs/animejs/3.2.1/anime.min.js"></script>
|
||||
<script src="scripts.js" type="text/javascript"></script>
|
||||
</body>
|
||||
</html>
|
Loading…
Add table
Add a link
Reference in a new issue