mirror of
https://github.com/esx-framework/esx_core.git
synced 2026-09-04 16:23:21 +00:00
Add files
This commit is contained in:
@@ -0,0 +1,20 @@
|
||||
#status_list {
|
||||
position: absolute;
|
||||
left : 23;
|
||||
bottom : 21%;
|
||||
width : 14.5%;
|
||||
opacity: 0.3;
|
||||
}
|
||||
|
||||
.status {
|
||||
padding: 1px;
|
||||
margin: 0.3em;
|
||||
}
|
||||
|
||||
.status_inner {
|
||||
padding: 1px;
|
||||
}
|
||||
|
||||
.status_val {
|
||||
height : 0.5em;
|
||||
}
|
||||
@@ -0,0 +1,57 @@
|
||||
(function(){
|
||||
|
||||
let status = []
|
||||
|
||||
let renderStatus = function(){
|
||||
|
||||
$('#status_list').html('');
|
||||
|
||||
for(let i=0; i<status.length; i++){
|
||||
|
||||
if(!status[i].visible)
|
||||
continue;
|
||||
|
||||
let statusDiv = $(
|
||||
'<div class="status">' +
|
||||
'<div class="status_inner">' +
|
||||
'<div class="status_val"></div>' +
|
||||
'</div>' +
|
||||
'</div>');
|
||||
|
||||
statusDiv.find('.status_inner')
|
||||
.css({'border' : '1px solid ' + status[i].color})
|
||||
;
|
||||
|
||||
statusDiv.find('.status_val')
|
||||
.css({
|
||||
'background-color' : status[i].color,
|
||||
'width' : (status[i].val / 10000) + '%'
|
||||
})
|
||||
;
|
||||
|
||||
$('#status_list').append(statusDiv)
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
window.onData = function(data){
|
||||
|
||||
if(data.update){
|
||||
|
||||
status.length = 0;
|
||||
|
||||
for(let i=0; i<data.status.length; i++)
|
||||
status.push(data.status[i])
|
||||
|
||||
renderStatus();
|
||||
}
|
||||
|
||||
if(data.setDisplay){
|
||||
$('#status_list').css({'opacity' : data.display})
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
window.onload = function(e){ window.addEventListener('message', function(event){ onData(event.data) }); }
|
||||
|
||||
})()
|
||||
@@ -0,0 +1,14 @@
|
||||
<html>
|
||||
<head>
|
||||
<meta charset="utf-8"/>
|
||||
<link rel="stylesheet" href="css/app.css" type="text/css" />
|
||||
</head>
|
||||
<body>
|
||||
|
||||
<div id="status_list"></div>
|
||||
|
||||
<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.2.1/jquery.min.js"></script>
|
||||
<script src="nui://game/ui/jquery.js" type="text/javascript"></script>
|
||||
<script src="scripts/app.js"></script>
|
||||
</body>
|
||||
</html>
|
||||
Reference in New Issue
Block a user