easier file management

This commit is contained in:
GhzGarage
2021-04-08 19:11:32 -05:00
parent a89baa5619
commit 36a139cc09
19 changed files with 0 additions and 0 deletions
+44
View File
@@ -0,0 +1,44 @@
body {
background-color: transparent !important;
}
.template, .notification {
display: none;
}
.notif-container {
width: 20vw;
position: absolute;
top: 4vh;
right: 12vw;
display: flex;
flex-flow: row;
flex-wrap: wrap;
}
.notification {
position: relative;
padding: 1vh;
width: fit-content;
border-radius: .4vh;
margin: 5px;
font: caption;
font-size: 1.2vh;
font-weight: bold;
float: left;
}
.success {
background: #27ae60;
color: #fff;
}
.primary {
background-color: #2980b9;
color: #ffffff;
}
.error {
background: #c0392b;
color: #fff;
}
+24
View File
@@ -0,0 +1,24 @@
window.addEventListener('message', function (event) {
switch(event.data.action) {
case 'show':
ShowNotif(event.data);
break;
default:
ShowNotif(event.data);
break;
}
});
function ShowNotif(data) {
var $notification = $('.notification.template').clone();
$notification.removeClass('template');
$notification.addClass(data.type);
$notification.html(data.text);
$notification.fadeIn();
$('.notif-container').prepend($notification);
setTimeout(function() {
$.when($notification.fadeOut(1500)).done(function() {
$notification.remove()
});
}, data.length != null ? data.length : 2500);
}
+13
View File
@@ -0,0 +1,13 @@
<html>
<head>
<script src="nui://game/ui/jquery.js" type="text/javascript"></script>
<link href="css/main.css" rel="stylesheet" type="text/css"/>
</head>
<body>
<div class="notif-container"></div>
<div class="notification template"></div>
</body>
<script src="js/app.js" type="text/javascript"></script>
</html>
<!-- ! -->