mirror of
https://github.com/qbcore-fivem/qb-core.git
synced 2026-08-28 17:01:16 +00:00
easier file management
This commit is contained in:
@@ -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;
|
||||
}
|
||||
@@ -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);
|
||||
}
|
||||
@@ -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>
|
||||
|
||||
<!-- ! -->
|
||||
Reference in New Issue
Block a user