0.0.1
This commit is contained in:
20
resources/[esx_addons]/esx_status/html/css/app.css
Normal file
20
resources/[esx_addons]/esx_status/html/css/app.css
Normal file
@@ -0,0 +1,20 @@
|
||||
#status_list {
|
||||
position: absolute;
|
||||
left: 23;
|
||||
bottom: 21%;
|
||||
width: 14.5%;
|
||||
opacity: 0;
|
||||
}
|
||||
|
||||
.status {
|
||||
padding: 1px;
|
||||
margin: 0.3em;
|
||||
}
|
||||
|
||||
.status_inner {
|
||||
padding: 1px;
|
||||
}
|
||||
|
||||
.status_val {
|
||||
height: 0.5em;
|
||||
}
|
||||
51
resources/[esx_addons]/esx_status/html/scripts/app.js
Normal file
51
resources/[esx_addons]/esx_status/html/scripts/app.js
Normal file
@@ -0,0 +1,51 @@
|
||||
(function () {
|
||||
let status = [];
|
||||
|
||||
let renderStatus = function () {
|
||||
document.getElementById("status_list").innerHTML = "";
|
||||
|
||||
for (let i = 0; i < status.length; i++) {
|
||||
if (!status[i].visible) {
|
||||
continue;
|
||||
}
|
||||
|
||||
const statusVal = document.createElement("div");
|
||||
statusVal.style.width = status[i].percent + "%";
|
||||
statusVal.style.backgroundColor = status[i].color;
|
||||
statusVal.classList.add("status_val");
|
||||
|
||||
const statusInner = document.createElement("div");
|
||||
statusInner.classList.add("status_inner");
|
||||
statusInner.style.border = "1px solid " + status[i].color;
|
||||
statusInner.appendChild(statusVal);
|
||||
|
||||
const statusDiv = document.createElement("div");
|
||||
statusDiv.classList.add("status");
|
||||
statusDiv.appendChild(statusInner);
|
||||
|
||||
document.getElementById("status_list").appendChild(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) {
|
||||
document.getElementById("status_list").style.opacity = data.display;
|
||||
}
|
||||
};
|
||||
|
||||
window.onload = function () {
|
||||
window.addEventListener("message", function (event) {
|
||||
onData(event.data);
|
||||
});
|
||||
};
|
||||
})();
|
||||
12
resources/[esx_addons]/esx_status/html/ui.html
Normal file
12
resources/[esx_addons]/esx_status/html/ui.html
Normal file
@@ -0,0 +1,12 @@
|
||||
<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="scripts/app.js"></script>
|
||||
</body>
|
||||
</html>
|
||||
Reference in New Issue
Block a user