Compare commits
3 Commits
Author | SHA1 | Date | |
---|---|---|---|
826f7868e8 | |||
3150e07ece | |||
e36dbb2a52 |
@ -6,5 +6,7 @@
|
||||
- [X] time on countdown page
|
||||
- [X] one-way messaging
|
||||
- [ ] Better UI
|
||||
- [ ] Wait for all resources to load
|
||||
- [ ] Error popups
|
||||
- [X] Progress bar
|
||||
- [P] Endpoint docs
|
||||
|
16
index.js
16
index.js
@ -39,10 +39,16 @@ currentState.textColors = currentState.colorSegments
|
||||
|
||||
|
||||
app.get("/", function (req, res) {
|
||||
const data = fs.readFileSync("templates/newAdminPanel.html", "utf8");
|
||||
res.send(data);
|
||||
});
|
||||
|
||||
app.get("/old", function (req, res) {
|
||||
const data = fs.readFileSync("templates/adminPanel.html", "utf8");
|
||||
res.send(data);
|
||||
});
|
||||
|
||||
|
||||
app.get("/timer", function (req, res) {
|
||||
const data = fs.readFileSync("templates/timerPage.html", "utf8");
|
||||
res.send(data);
|
||||
@ -81,8 +87,12 @@ app.get("/api/v1/ctrl/timer/pause", function (req, res) {
|
||||
});
|
||||
|
||||
app.get("/api/v1/ctrl/timer/play", function (req, res) {
|
||||
currentState.timerRunState = true
|
||||
currentState.countdownGoal += new Date().getTime() - currentState.pauseMoment;
|
||||
|
||||
if(currentState.timerRunState == false){
|
||||
currentState.timerRunState = true
|
||||
currentState.countdownGoal += new Date().getTime() - currentState.pauseMoment;
|
||||
}
|
||||
|
||||
res.json({ status: "ok" });
|
||||
});
|
||||
|
||||
@ -145,3 +155,5 @@ app.get("/api/v1/ctrl/message/hide", function (req, res) {
|
||||
});
|
||||
|
||||
app.listen(3005);
|
||||
|
||||
console.log("Server running on port 3005");
|
||||
|
116
package-lock.json
generated
116
package-lock.json
generated
@ -10,8 +10,25 @@
|
||||
"license": "ISC",
|
||||
"dependencies": {
|
||||
"body-parser": "^1.19.2",
|
||||
"bootstrap": "^5.1.3",
|
||||
"bootstrap-icons": "^1.8.1",
|
||||
"countdown": "^2.6.0",
|
||||
"express": "^4.17.3"
|
||||
"darkreader": "^4.9.44",
|
||||
"express": "^4.17.3",
|
||||
"jquery": "^3.6.0",
|
||||
"js-cookie": "^3.0.1",
|
||||
"mdbootstrap": "^4.20.0",
|
||||
"moment": "^2.29.1"
|
||||
}
|
||||
},
|
||||
"node_modules/@popperjs/core": {
|
||||
"version": "2.11.2",
|
||||
"resolved": "https://registry.npmjs.org/@popperjs/core/-/core-2.11.2.tgz",
|
||||
"integrity": "sha512-92FRmppjjqz29VMJ2dn+xdyXZBrMlE42AV6Kq6BwjWV7CNUW1hs2FtxSNLQE+gJhaZ6AAmYuO9y8dshhcBl7vA==",
|
||||
"peer": true,
|
||||
"funding": {
|
||||
"type": "opencollective",
|
||||
"url": "https://opencollective.com/popperjs"
|
||||
}
|
||||
},
|
||||
"node_modules/accepts": {
|
||||
@ -51,6 +68,26 @@
|
||||
"node": ">= 0.8"
|
||||
}
|
||||
},
|
||||
"node_modules/bootstrap": {
|
||||
"version": "5.1.3",
|
||||
"resolved": "https://registry.npmjs.org/bootstrap/-/bootstrap-5.1.3.tgz",
|
||||
"integrity": "sha512-fcQztozJ8jToQWXxVuEyXWW+dSo8AiXWKwiSSrKWsRB/Qt+Ewwza+JWoLKiTuQLaEPhdNAJ7+Dosc9DOIqNy7Q==",
|
||||
"funding": {
|
||||
"type": "opencollective",
|
||||
"url": "https://opencollective.com/bootstrap"
|
||||
},
|
||||
"peerDependencies": {
|
||||
"@popperjs/core": "^2.10.2"
|
||||
}
|
||||
},
|
||||
"node_modules/bootstrap-icons": {
|
||||
"version": "1.8.1",
|
||||
"resolved": "https://registry.npmjs.org/bootstrap-icons/-/bootstrap-icons-1.8.1.tgz",
|
||||
"integrity": "sha512-IXUqislddPJfwq6H+2nTkHyr9epO9h6u1AG0OZCx616w+TgzeoCjfmI3qJMQqt1J586gN2IxzB4M99Ip4sTZ1w==",
|
||||
"engines": {
|
||||
"node": ">=10"
|
||||
}
|
||||
},
|
||||
"node_modules/bytes": {
|
||||
"version": "3.1.2",
|
||||
"resolved": "https://registry.npmjs.org/bytes/-/bytes-3.1.2.tgz",
|
||||
@ -96,6 +133,15 @@
|
||||
"resolved": "https://registry.npmjs.org/countdown/-/countdown-2.6.0.tgz",
|
||||
"integrity": "sha1-Z3+446nUzE52QVkBuiU7UYrzQXc="
|
||||
},
|
||||
"node_modules/darkreader": {
|
||||
"version": "4.9.44",
|
||||
"resolved": "https://registry.npmjs.org/darkreader/-/darkreader-4.9.44.tgz",
|
||||
"integrity": "sha512-Mrt5s5eMaFC24Tfi2nNsXpYIfzWK/RUzJxgk0Ysqokvk9lBCn/pkUTyQGYeQbU/U3aKZEYXXqsxZjNfiLoA6QQ==",
|
||||
"funding": {
|
||||
"type": "opencollective",
|
||||
"url": "https://opencollective.com/darkreader/donate"
|
||||
}
|
||||
},
|
||||
"node_modules/debug": {
|
||||
"version": "2.6.9",
|
||||
"resolved": "https://registry.npmjs.org/debug/-/debug-2.6.9.tgz",
|
||||
@ -255,6 +301,24 @@
|
||||
"node": ">= 0.10"
|
||||
}
|
||||
},
|
||||
"node_modules/jquery": {
|
||||
"version": "3.6.0",
|
||||
"resolved": "https://registry.npmjs.org/jquery/-/jquery-3.6.0.tgz",
|
||||
"integrity": "sha512-JVzAR/AjBvVt2BmYhxRCSYysDsPcssdmTFnzyLEts9qNwmjmu4JTAMYubEfwVOSwpQ1I1sKKFcxhZCI2buerfw=="
|
||||
},
|
||||
"node_modules/js-cookie": {
|
||||
"version": "3.0.1",
|
||||
"resolved": "https://registry.npmjs.org/js-cookie/-/js-cookie-3.0.1.tgz",
|
||||
"integrity": "sha512-+0rgsUXZu4ncpPxRL+lNEptWMOWl9etvPHc/koSRp6MPwpRYAhmk0dUG00J4bxVV3r9uUzfo24wW0knS07SKSw==",
|
||||
"engines": {
|
||||
"node": ">=12"
|
||||
}
|
||||
},
|
||||
"node_modules/mdbootstrap": {
|
||||
"version": "4.20.0",
|
||||
"resolved": "https://registry.npmjs.org/mdbootstrap/-/mdbootstrap-4.20.0.tgz",
|
||||
"integrity": "sha512-eIxaYsvHct2BKqkJWphh6j7nFQXHh9NjbbN7a+dctfrVsKaydNW5XpKIxmq2tDSb9+XYGm9hK7hMTlHgeV6wdw=="
|
||||
},
|
||||
"node_modules/media-typer": {
|
||||
"version": "0.3.0",
|
||||
"resolved": "https://registry.npmjs.org/media-typer/-/media-typer-0.3.0.tgz",
|
||||
@ -306,6 +370,14 @@
|
||||
"node": ">= 0.6"
|
||||
}
|
||||
},
|
||||
"node_modules/moment": {
|
||||
"version": "2.29.1",
|
||||
"resolved": "https://registry.npmjs.org/moment/-/moment-2.29.1.tgz",
|
||||
"integrity": "sha512-kHmoybcPV8Sqy59DwNDY3Jefr64lK/by/da0ViFcuA4DH0vQg5Q6Ze5VimxkfQNSC+Mls/Kx53s7TjP1RhFEDQ==",
|
||||
"engines": {
|
||||
"node": "*"
|
||||
}
|
||||
},
|
||||
"node_modules/ms": {
|
||||
"version": "2.0.0",
|
||||
"resolved": "https://registry.npmjs.org/ms/-/ms-2.0.0.tgz",
|
||||
@ -513,6 +585,12 @@
|
||||
}
|
||||
},
|
||||
"dependencies": {
|
||||
"@popperjs/core": {
|
||||
"version": "2.11.2",
|
||||
"resolved": "https://registry.npmjs.org/@popperjs/core/-/core-2.11.2.tgz",
|
||||
"integrity": "sha512-92FRmppjjqz29VMJ2dn+xdyXZBrMlE42AV6Kq6BwjWV7CNUW1hs2FtxSNLQE+gJhaZ6AAmYuO9y8dshhcBl7vA==",
|
||||
"peer": true
|
||||
},
|
||||
"accepts": {
|
||||
"version": "1.3.8",
|
||||
"resolved": "https://registry.npmjs.org/accepts/-/accepts-1.3.8.tgz",
|
||||
@ -544,6 +622,17 @@
|
||||
"type-is": "~1.6.18"
|
||||
}
|
||||
},
|
||||
"bootstrap": {
|
||||
"version": "5.1.3",
|
||||
"resolved": "https://registry.npmjs.org/bootstrap/-/bootstrap-5.1.3.tgz",
|
||||
"integrity": "sha512-fcQztozJ8jToQWXxVuEyXWW+dSo8AiXWKwiSSrKWsRB/Qt+Ewwza+JWoLKiTuQLaEPhdNAJ7+Dosc9DOIqNy7Q==",
|
||||
"requires": {}
|
||||
},
|
||||
"bootstrap-icons": {
|
||||
"version": "1.8.1",
|
||||
"resolved": "https://registry.npmjs.org/bootstrap-icons/-/bootstrap-icons-1.8.1.tgz",
|
||||
"integrity": "sha512-IXUqislddPJfwq6H+2nTkHyr9epO9h6u1AG0OZCx616w+TgzeoCjfmI3qJMQqt1J586gN2IxzB4M99Ip4sTZ1w=="
|
||||
},
|
||||
"bytes": {
|
||||
"version": "3.1.2",
|
||||
"resolved": "https://registry.npmjs.org/bytes/-/bytes-3.1.2.tgz",
|
||||
@ -577,6 +666,11 @@
|
||||
"resolved": "https://registry.npmjs.org/countdown/-/countdown-2.6.0.tgz",
|
||||
"integrity": "sha1-Z3+446nUzE52QVkBuiU7UYrzQXc="
|
||||
},
|
||||
"darkreader": {
|
||||
"version": "4.9.44",
|
||||
"resolved": "https://registry.npmjs.org/darkreader/-/darkreader-4.9.44.tgz",
|
||||
"integrity": "sha512-Mrt5s5eMaFC24Tfi2nNsXpYIfzWK/RUzJxgk0Ysqokvk9lBCn/pkUTyQGYeQbU/U3aKZEYXXqsxZjNfiLoA6QQ=="
|
||||
},
|
||||
"debug": {
|
||||
"version": "2.6.9",
|
||||
"resolved": "https://registry.npmjs.org/debug/-/debug-2.6.9.tgz",
|
||||
@ -706,6 +800,21 @@
|
||||
"resolved": "https://registry.npmjs.org/ipaddr.js/-/ipaddr.js-1.9.1.tgz",
|
||||
"integrity": "sha512-0KI/607xoxSToH7GjN1FfSbLoU0+btTicjsQSWQlh/hZykN8KpmMf7uYwPW3R+akZ6R/w18ZlXSHBYXiYUPO3g=="
|
||||
},
|
||||
"jquery": {
|
||||
"version": "3.6.0",
|
||||
"resolved": "https://registry.npmjs.org/jquery/-/jquery-3.6.0.tgz",
|
||||
"integrity": "sha512-JVzAR/AjBvVt2BmYhxRCSYysDsPcssdmTFnzyLEts9qNwmjmu4JTAMYubEfwVOSwpQ1I1sKKFcxhZCI2buerfw=="
|
||||
},
|
||||
"js-cookie": {
|
||||
"version": "3.0.1",
|
||||
"resolved": "https://registry.npmjs.org/js-cookie/-/js-cookie-3.0.1.tgz",
|
||||
"integrity": "sha512-+0rgsUXZu4ncpPxRL+lNEptWMOWl9etvPHc/koSRp6MPwpRYAhmk0dUG00J4bxVV3r9uUzfo24wW0knS07SKSw=="
|
||||
},
|
||||
"mdbootstrap": {
|
||||
"version": "4.20.0",
|
||||
"resolved": "https://registry.npmjs.org/mdbootstrap/-/mdbootstrap-4.20.0.tgz",
|
||||
"integrity": "sha512-eIxaYsvHct2BKqkJWphh6j7nFQXHh9NjbbN7a+dctfrVsKaydNW5XpKIxmq2tDSb9+XYGm9hK7hMTlHgeV6wdw=="
|
||||
},
|
||||
"media-typer": {
|
||||
"version": "0.3.0",
|
||||
"resolved": "https://registry.npmjs.org/media-typer/-/media-typer-0.3.0.tgz",
|
||||
@ -739,6 +848,11 @@
|
||||
"mime-db": "1.51.0"
|
||||
}
|
||||
},
|
||||
"moment": {
|
||||
"version": "2.29.1",
|
||||
"resolved": "https://registry.npmjs.org/moment/-/moment-2.29.1.tgz",
|
||||
"integrity": "sha512-kHmoybcPV8Sqy59DwNDY3Jefr64lK/by/da0ViFcuA4DH0vQg5Q6Ze5VimxkfQNSC+Mls/Kx53s7TjP1RhFEDQ=="
|
||||
},
|
||||
"ms": {
|
||||
"version": "2.0.0",
|
||||
"resolved": "https://registry.npmjs.org/ms/-/ms-2.0.0.tgz",
|
||||
|
@ -10,7 +10,14 @@
|
||||
"license": "ISC",
|
||||
"dependencies": {
|
||||
"body-parser": "^1.19.2",
|
||||
"bootstrap": "^5.1.3",
|
||||
"bootstrap-icons": "^1.8.1",
|
||||
"countdown": "^2.6.0",
|
||||
"express": "^4.17.3"
|
||||
"darkreader": "^4.9.44",
|
||||
"express": "^4.17.3",
|
||||
"jquery": "^3.6.0",
|
||||
"js-cookie": "^3.0.1",
|
||||
"mdbootstrap": "^4.20.0",
|
||||
"moment": "^2.29.1"
|
||||
}
|
||||
}
|
||||
|
1
static/bootstrap/dist
Symbolic link
1
static/bootstrap/dist
Symbolic link
@ -0,0 +1 @@
|
||||
../../node_modules/bootstrap/dist
|
1
static/css/bootstrap-icons.css
vendored
Symbolic link
1
static/css/bootstrap-icons.css
vendored
Symbolic link
@ -0,0 +1 @@
|
||||
../../node_modules/bootstrap-icons/font/bootstrap-icons.css
|
110
static/css/mainStyle.css
Normal file
110
static/css/mainStyle.css
Normal file
@ -0,0 +1,110 @@
|
||||
body {
|
||||
min-height: 100vh;
|
||||
min-height: -webkit-fill-available;
|
||||
}
|
||||
|
||||
html {
|
||||
height: -webkit-fill-available;
|
||||
}
|
||||
|
||||
main {
|
||||
display: flex;
|
||||
flex-wrap: nowrap;
|
||||
height: 100vh;
|
||||
height: -webkit-fill-available;
|
||||
max-height: 100vh;
|
||||
overflow-x: auto;
|
||||
overflow-y: hidden;
|
||||
}
|
||||
|
||||
.b-example-divider {
|
||||
flex-shrink: 0;
|
||||
width: 1.5rem;
|
||||
height: 100vh;
|
||||
background-color: rgba(0, 0, 0, .1);
|
||||
border: solid rgba(0, 0, 0, .15);
|
||||
border-width: 1px 0;
|
||||
box-shadow: inset 0 .5em 1.5em rgba(0, 0, 0, .1), inset 0 .125em .5em rgba(0, 0, 0, .15);
|
||||
}
|
||||
|
||||
.bi {
|
||||
vertical-align: -.125em;
|
||||
pointer-events: none;
|
||||
fill: currentColor;
|
||||
}
|
||||
|
||||
.dropdown-toggle { outline: 0; }
|
||||
|
||||
.nav-flush .nav-link {
|
||||
border-radius: 0;
|
||||
}
|
||||
|
||||
.btn-toggle {
|
||||
display: inline-flex;
|
||||
align-items: center;
|
||||
padding: .25rem .5rem;
|
||||
font-weight: 600;
|
||||
color: rgba(0, 0, 0, .65);
|
||||
background-color: transparent;
|
||||
border: 0;
|
||||
}
|
||||
.btn-toggle:hover,
|
||||
.btn-toggle:focus {
|
||||
color: rgba(0, 0, 0, .85);
|
||||
background-color: #d2f4ea;
|
||||
}
|
||||
|
||||
.btn-toggle::before {
|
||||
width: 1.25em;
|
||||
line-height: 0;
|
||||
content: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 16 16'%3e%3cpath fill='none' stroke='rgba%280,0,0,.5%29' stroke-linecap='round' stroke-linejoin='round' stroke-width='2' d='M5 14l6-6-6-6'/%3e%3c/svg%3e");
|
||||
transition: transform .35s ease;
|
||||
transform-origin: .5em 50%;
|
||||
}
|
||||
|
||||
.btn-toggle[aria-expanded="true"] {
|
||||
color: rgba(0, 0, 0, .85);
|
||||
}
|
||||
.btn-toggle[aria-expanded="true"]::before {
|
||||
transform: rotate(90deg);
|
||||
}
|
||||
|
||||
.btn-toggle-nav a {
|
||||
display: inline-flex;
|
||||
padding: .1875rem .5rem;
|
||||
margin-top: .125rem;
|
||||
margin-left: 1.25rem;
|
||||
text-decoration: none;
|
||||
}
|
||||
.btn-toggle-nav a:hover,
|
||||
.btn-toggle-nav a:focus {
|
||||
background-color: #d2f4ea;
|
||||
}
|
||||
|
||||
.scrollarea {
|
||||
overflow-y: auto;
|
||||
}
|
||||
|
||||
.fw-semibold { font-weight: 600; }
|
||||
.lh-tight { line-height: 1.25; }
|
||||
|
||||
|
||||
.hidden{
|
||||
display: none;
|
||||
}
|
||||
|
||||
.pageC {
|
||||
padding: 20px;
|
||||
}
|
||||
|
||||
|
||||
placeholder {
|
||||
border: red 2px dashed;
|
||||
background-color: yellow;
|
||||
}
|
||||
|
||||
pre {
|
||||
overflow: auto;
|
||||
word-wrap: normal;
|
||||
white-space: pre;
|
||||
}
|
@ -1,3 +1,3 @@
|
||||
body {
|
||||
font-size:0.5em;
|
||||
font-size:0.3em;
|
||||
}
|
@ -103,4 +103,4 @@ html, body {
|
||||
.blink {
|
||||
animation:fade 1000ms infinite;
|
||||
-webkit-animation:fade 1000ms infinite;
|
||||
}
|
||||
}
|
||||
|
1
static/js/cookie.js
Symbolic link
1
static/js/cookie.js
Symbolic link
@ -0,0 +1 @@
|
||||
../../node_modules/js-cookie/dist/js.cookie.min.js
|
1
static/js/darkreader.js
Symbolic link
1
static/js/darkreader.js
Symbolic link
@ -0,0 +1 @@
|
||||
../../node_modules/darkreader/darkreader.js
|
1
static/js/jquery.min.js
vendored
Symbolic link
1
static/js/jquery.min.js
vendored
Symbolic link
@ -0,0 +1 @@
|
||||
../../node_modules/jquery/dist/jquery.min.js
|
1
static/js/moment.js
Symbolic link
1
static/js/moment.js
Symbolic link
@ -0,0 +1 @@
|
||||
../../node_modules/moment/dist/moment.js
|
@ -2,6 +2,7 @@ var newDateObj = new Date();
|
||||
newDateObj = new Date(newDateObj.getTime() + 1000 * 20)
|
||||
|
||||
allowFullscreen = true
|
||||
let dataFame = {}
|
||||
|
||||
function enterFullscreen(element) {
|
||||
if (element.requestFullscreen) {
|
||||
@ -69,93 +70,99 @@ function findProgessColor(colors, value) {
|
||||
return (resColor)
|
||||
}
|
||||
|
||||
function handleUpdate() {
|
||||
function requestBackend() {
|
||||
resp = httpGet("/api/v1/data");
|
||||
|
||||
resp.onloadend = function (e) {
|
||||
if(resp.status == 200){
|
||||
if (resp.status == 200) {
|
||||
resp = resp.responseText;
|
||||
var data = JSON.parse(resp);
|
||||
document.getElementById("incomeData").innerHTML = JSON.stringify(data)
|
||||
document.getElementById("timediff").innerHTML = new Date().getTime() - data.srvTime;
|
||||
if(data.debug){
|
||||
document.getElementById("timediff").style.display = "block";
|
||||
}else{
|
||||
document.getElementById("timediff").style.display = "none";
|
||||
}
|
||||
|
||||
if (data.defaultFullScreen && document.getElementById("initalDate").innerHTML.includes("true") && allowFullscreen) {
|
||||
enterFullscreen(document.documentElement);
|
||||
document.getElementById("initalDate").innerHTML = "false"
|
||||
}
|
||||
|
||||
if (data.showMessage) {
|
||||
document.getElementById("overlay").style.display = "block";
|
||||
document.getElementById("text").innerHTML = data.message
|
||||
} else {
|
||||
off()
|
||||
}
|
||||
|
||||
if (new Date().getTime() - data.messageAppearTime < 5000) {
|
||||
if (!document.getElementById("text").classList.contains('blink')) {
|
||||
document.getElementById("text").classList.add("blink")
|
||||
}
|
||||
} else {
|
||||
if (document.getElementById("text").classList.contains('blink')) {
|
||||
document.getElementById("text").classList.remove("blink")
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
if (data.mode == "clock") {
|
||||
document.getElementById("timer").innerHTML = getTime();
|
||||
document.getElementById("testImg").style.display = "none";
|
||||
document.getElementById("wholeProgBar").style.display = "none";
|
||||
|
||||
} else if (data.mode == "timer") {
|
||||
|
||||
document.getElementById("wholeProgBar").style.display = "block";
|
||||
|
||||
if (data.timerRunState) {
|
||||
const now = new Date()
|
||||
const diff = data.countdownGoal - now.getTime()
|
||||
document.getElementById("timer").innerHTML = msToTime(diff, data);
|
||||
if (diff > 0) {
|
||||
document.getElementById("progBar").style.width = percentage(diff, data.timeAmountInital) + "%";
|
||||
} else {
|
||||
document.getElementById("progBar").style.width = "0%";
|
||||
}
|
||||
|
||||
document.getElementById("progBar").style.backgroundColor = findProgessColor(data.colorSegments, diff)
|
||||
document.getElementById("testImg").style.display = "none";
|
||||
if (data.enableColoredText) {
|
||||
document.getElementById("timer").style.color = findProgessColor(data.textColors, diff)
|
||||
} else {
|
||||
document.getElementById("timer").style.color = "white"
|
||||
}
|
||||
|
||||
}
|
||||
if (data.showTimeOnCountdown) {
|
||||
document.getElementById("clockSec").innerHTML = getTime();
|
||||
} else {
|
||||
document.getElementById("clockSec").innerHTML = "";
|
||||
}
|
||||
|
||||
} else if (data.mode == "black") {
|
||||
document.getElementById("timer").innerHTML = "";
|
||||
document.getElementById("testImg").style.display = "none";
|
||||
document.getElementById("wholeProgBar").style.display = "none";
|
||||
|
||||
} else if (data.mode == "test") {
|
||||
document.getElementById("timer").innerHTML = "";
|
||||
document.getElementById("testImg").style.display = "block";
|
||||
document.getElementById("progBar").style.display = "none";
|
||||
}
|
||||
dataFame = data;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
function handleUpdate() {
|
||||
var data = dataFame;
|
||||
document.getElementById("incomeData").innerHTML = JSON.stringify(data)
|
||||
document.getElementById("timediff").innerHTML = new Date().getTime() - data.srvTime;
|
||||
|
||||
if (data.debug) {
|
||||
document.getElementById("timediff").style.display = "block";
|
||||
} else {
|
||||
document.getElementById("timediff").style.display = "none";
|
||||
}
|
||||
|
||||
if (data.defaultFullScreen && document.getElementById("initalDate").innerHTML.includes("true") && allowFullscreen) {
|
||||
enterFullscreen(document.documentElement);
|
||||
document.getElementById("initalDate").innerHTML = "false"
|
||||
}
|
||||
|
||||
if (data.showMessage) {
|
||||
document.getElementById("overlay").style.display = "block";
|
||||
document.getElementById("text").innerHTML = data.message
|
||||
} else {
|
||||
off()
|
||||
}
|
||||
|
||||
if (new Date().getTime() - data.messageAppearTime < 5000) {
|
||||
if (!document.getElementById("text").classList.contains('blink')) {
|
||||
document.getElementById("text").classList.add("blink")
|
||||
}
|
||||
} else {
|
||||
if (document.getElementById("text").classList.contains('blink')) {
|
||||
document.getElementById("text").classList.remove("blink")
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
if (data.mode == "clock") {
|
||||
document.getElementById("timer").innerHTML = getTime();
|
||||
document.getElementById("testImg").style.display = "none";
|
||||
document.getElementById("wholeProgBar").style.display = "none";
|
||||
document.getElementById("clockSec").innerHTML = "";
|
||||
document.getElementById("timer").style.color = "white"
|
||||
|
||||
} else if (data.mode == "timer") {
|
||||
|
||||
document.getElementById("wholeProgBar").style.display = "block";
|
||||
|
||||
if (data.timerRunState) {
|
||||
const now = new Date()
|
||||
const diff = data.countdownGoal - now.getTime()
|
||||
document.getElementById("timer").innerHTML = msToTime(diff, data);
|
||||
if (diff > 0) {
|
||||
document.getElementById("progBar").style.width = percentage(diff, data.timeAmountInital) + "%";
|
||||
} else {
|
||||
document.getElementById("progBar").style.width = "0%";
|
||||
}
|
||||
|
||||
document.getElementById("progBar").style.backgroundColor = findProgessColor(data.colorSegments, diff)
|
||||
document.getElementById("testImg").style.display = "none";
|
||||
if (data.enableColoredText) {
|
||||
document.getElementById("timer").style.color = findProgessColor(data.textColors, diff)
|
||||
} else {
|
||||
document.getElementById("timer").style.color = "white"
|
||||
}
|
||||
|
||||
}
|
||||
if (data.showTimeOnCountdown) {
|
||||
document.getElementById("clockSec").innerHTML = getTime();
|
||||
} else {
|
||||
document.getElementById("clockSec").innerHTML = "";
|
||||
}
|
||||
|
||||
} else if (data.mode == "black") {
|
||||
document.getElementById("timer").innerHTML = "";
|
||||
document.getElementById("testImg").style.display = "none";
|
||||
document.getElementById("wholeProgBar").style.display = "none";
|
||||
document.getElementById("clockSec").innerHTML = "";
|
||||
|
||||
} else if (data.mode == "test") {
|
||||
document.getElementById("timer").innerHTML = "";
|
||||
document.getElementById("testImg").style.display = "block";
|
||||
document.getElementById("progBar").style.display = "none";
|
||||
document.getElementById("clockSec").innerHTML = "";
|
||||
}
|
||||
}
|
||||
|
||||
function httpGet(theUrl) {
|
||||
@ -190,7 +197,8 @@ function off() {
|
||||
document.getElementById("overlay").style.display = "none";
|
||||
}
|
||||
|
||||
setInterval(handleUpdate, 200);
|
||||
setInterval(requestBackend, 500);
|
||||
setInterval(handleUpdate, 2);
|
||||
|
||||
let temp = new URLSearchParams(window.location.search).get("smaller");
|
||||
|
||||
|
1
static/mdbootstrap/css
Symbolic link
1
static/mdbootstrap/css
Symbolic link
@ -0,0 +1 @@
|
||||
../../node_modules/mdbootstrap/css/
|
1
static/mdbootstrap/js
Symbolic link
1
static/mdbootstrap/js
Symbolic link
@ -0,0 +1 @@
|
||||
../../node_modules/mdbootstrap/js
|
733
templates/newAdminPanel.html
Normal file
733
templates/newAdminPanel.html
Normal file
@ -0,0 +1,733 @@
|
||||
<!doctype html>
|
||||
<html lang="en">
|
||||
|
||||
<head>
|
||||
<meta charset="utf-8">
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1">
|
||||
|
||||
<title>openCountdown - Admin</title>
|
||||
<meta name="description" content="openCountdown">
|
||||
<meta name="author" content="TheGreydiamond">
|
||||
|
||||
|
||||
<link rel="stylesheet" href="/css/bootstrap-icons.css">
|
||||
<link rel="stylesheet" href="/mdbootstrap/css/style.css">
|
||||
|
||||
<script src="/bootstrap/dist/js/bootstrap.bundle.min.js"></script>
|
||||
<script src="/js/jquery.min.js"></script>
|
||||
<script type="text/javascript" src="/mdbootstrap/js/mdb.min.js"></script>
|
||||
|
||||
<script type="text/javascript" src="/js/darkreader.js"></script>
|
||||
<script type="text/javascript" src="/js/cookie.js"></script>
|
||||
<link href="/bootstrap/dist/css/bootstrap.min.css" rel="stylesheet">
|
||||
<link href="/css/mainStyle.css" rel="stylesheet">
|
||||
</head>
|
||||
|
||||
<body>
|
||||
<svg xmlns="http://www.w3.org/2000/svg" style="display: none;">
|
||||
<symbol id="bootstrap" viewBox="0 0 118 94">
|
||||
<title>Bootstrap</title>
|
||||
<path fill-rule="evenodd" clip-rule="evenodd"
|
||||
d="M24.509 0c-6.733 0-11.715 5.893-11.492 12.284.214 6.14-.064 14.092-2.066 20.577C8.943 39.365 5.547 43.485 0 44.014v5.972c5.547.529 8.943 4.649 10.951 11.153 2.002 6.485 2.28 14.437 2.066 20.577C12.794 88.106 17.776 94 24.51 94H93.5c6.733 0 11.714-5.893 11.491-12.284-.214-6.14.064-14.092 2.066-20.577 2.009-6.504 5.396-10.624 10.943-11.153v-5.972c-5.547-.529-8.934-4.649-10.943-11.153-2.002-6.484-2.28-14.437-2.066-20.577C105.214 5.894 100.233 0 93.5 0H24.508zM80 57.863C80 66.663 73.436 72 62.543 72H44a2 2 0 01-2-2V24a2 2 0 012-2h18.437c9.083 0 15.044 4.92 15.044 12.474 0 5.302-4.01 10.049-9.119 10.88v.277C75.317 46.394 80 51.21 80 57.863zM60.521 28.34H49.948v14.934h8.905c6.884 0 10.68-2.772 10.68-7.727 0-4.643-3.264-7.207-9.012-7.207zM49.948 49.2v16.458H60.91c7.167 0 10.964-2.876 10.964-8.281 0-5.406-3.903-8.178-11.425-8.178H49.948z">
|
||||
</path>
|
||||
</symbol>
|
||||
<symbol id="home" viewBox="0 0 16 16">
|
||||
<path
|
||||
d="M8.354 1.146a.5.5 0 0 0-.708 0l-6 6A.5.5 0 0 0 1.5 7.5v7a.5.5 0 0 0 .5.5h4.5a.5.5 0 0 0 .5-.5v-4h2v4a.5.5 0 0 0 .5.5H14a.5.5 0 0 0 .5-.5v-7a.5.5 0 0 0-.146-.354L13 5.793V2.5a.5.5 0 0 0-.5-.5h-1a.5.5 0 0 0-.5.5v1.293L8.354 1.146zM2.5 14V7.707l5.5-5.5 5.5 5.5V14H10v-4a.5.5 0 0 0-.5-.5h-3a.5.5 0 0 0-.5.5v4H2.5z" />
|
||||
</symbol>
|
||||
<symbol id="speedometer2" viewBox="0 0 16 16">
|
||||
<path
|
||||
d="M8 4a.5.5 0 0 1 .5.5V6a.5.5 0 0 1-1 0V4.5A.5.5 0 0 1 8 4zM3.732 5.732a.5.5 0 0 1 .707 0l.915.914a.5.5 0 1 1-.708.708l-.914-.915a.5.5 0 0 1 0-.707zM2 10a.5.5 0 0 1 .5-.5h1.586a.5.5 0 0 1 0 1H2.5A.5.5 0 0 1 2 10zm9.5 0a.5.5 0 0 1 .5-.5h1.5a.5.5 0 0 1 0 1H12a.5.5 0 0 1-.5-.5zm.754-4.246a.389.389 0 0 0-.527-.02L7.547 9.31a.91.91 0 1 0 1.302 1.258l3.434-4.297a.389.389 0 0 0-.029-.518z" />
|
||||
<path fill-rule="evenodd"
|
||||
d="M0 10a8 8 0 1 1 15.547 2.661c-.442 1.253-1.845 1.602-2.932 1.25C11.309 13.488 9.475 13 8 13c-1.474 0-3.31.488-4.615.911-1.087.352-2.49.003-2.932-1.25A7.988 7.988 0 0 1 0 10zm8-7a7 7 0 0 0-6.603 9.329c.203.575.923.876 1.68.63C4.397 12.533 6.358 12 8 12s3.604.532 4.923.96c.757.245 1.477-.056 1.68-.631A7 7 0 0 0 8 3z" />
|
||||
</symbol>
|
||||
<symbol id="table" viewBox="0 0 16 16">
|
||||
<path
|
||||
d="M0 2a2 2 0 0 1 2-2h12a2 2 0 0 1 2 2v12a2 2 0 0 1-2 2H2a2 2 0 0 1-2-2V2zm15 2h-4v3h4V4zm0 4h-4v3h4V8zm0 4h-4v3h3a1 1 0 0 0 1-1v-2zm-5 3v-3H6v3h4zm-5 0v-3H1v2a1 1 0 0 0 1 1h3zm-4-4h4V8H1v3zm0-4h4V4H1v3zm5-3v3h4V4H6zm4 4H6v3h4V8z" />
|
||||
</symbol>
|
||||
<symbol id="people-circle" viewBox="0 0 16 16">
|
||||
<path d="M11 6a3 3 0 1 1-6 0 3 3 0 0 1 6 0z" />
|
||||
<path fill-rule="evenodd"
|
||||
d="M0 8a8 8 0 1 1 16 0A8 8 0 0 1 0 8zm8-7a7 7 0 0 0-5.468 11.37C3.242 11.226 4.805 10 8 10s4.757 1.225 5.468 2.37A7 7 0 0 0 8 1z" />
|
||||
</symbol>
|
||||
<symbol id="grid" viewBox="0 0 16 16">
|
||||
<path
|
||||
d="M1 2.5A1.5 1.5 0 0 1 2.5 1h3A1.5 1.5 0 0 1 7 2.5v3A1.5 1.5 0 0 1 5.5 7h-3A1.5 1.5 0 0 1 1 5.5v-3zM2.5 2a.5.5 0 0 0-.5.5v3a.5.5 0 0 0 .5.5h3a.5.5 0 0 0 .5-.5v-3a.5.5 0 0 0-.5-.5h-3zm6.5.5A1.5 1.5 0 0 1 10.5 1h3A1.5 1.5 0 0 1 15 2.5v3A1.5 1.5 0 0 1 13.5 7h-3A1.5 1.5 0 0 1 9 5.5v-3zm1.5-.5a.5.5 0 0 0-.5.5v3a.5.5 0 0 0 .5.5h3a.5.5 0 0 0 .5-.5v-3a.5.5 0 0 0-.5-.5h-3zM1 10.5A1.5 1.5 0 0 1 2.5 9h3A1.5 1.5 0 0 1 7 10.5v3A1.5 1.5 0 0 1 5.5 15h-3A1.5 1.5 0 0 1 1 13.5v-3zm1.5-.5a.5.5 0 0 0-.5.5v3a.5.5 0 0 0 .5.5h3a.5.5 0 0 0 .5-.5v-3a.5.5 0 0 0-.5-.5h-3zm6.5.5A1.5 1.5 0 0 1 10.5 9h3a1.5 1.5 0 0 1 1.5 1.5v3a1.5 1.5 0 0 1-1.5 1.5h-3A1.5 1.5 0 0 1 9 13.5v-3zm1.5-.5a.5.5 0 0 0-.5.5v3a.5.5 0 0 0 .5.5h3a.5.5 0 0 0 .5-.5v-3a.5.5 0 0 0-.5-.5h-3z" />
|
||||
</symbol>
|
||||
<symbol id="collection" viewBox="0 0 16 16">
|
||||
<path
|
||||
d="M2.5 3.5a.5.5 0 0 1 0-1h11a.5.5 0 0 1 0 1h-11zm2-2a.5.5 0 0 1 0-1h7a.5.5 0 0 1 0 1h-7zM0 13a1.5 1.5 0 0 0 1.5 1.5h13A1.5 1.5 0 0 0 16 13V6a1.5 1.5 0 0 0-1.5-1.5h-13A1.5 1.5 0 0 0 0 6v7zm1.5.5A.5.5 0 0 1 1 13V6a.5.5 0 0 1 .5-.5h13a.5.5 0 0 1 .5.5v7a.5.5 0 0 1-.5.5h-13z" />
|
||||
</symbol>
|
||||
<symbol id="calendar3" viewBox="0 0 16 16">
|
||||
<path
|
||||
d="M14 0H2a2 2 0 0 0-2 2v12a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V2a2 2 0 0 0-2-2zM1 3.857C1 3.384 1.448 3 2 3h12c.552 0 1 .384 1 .857v10.286c0 .473-.448.857-1 .857H2c-.552 0-1-.384-1-.857V3.857z" />
|
||||
<path
|
||||
d="M6.5 7a1 1 0 1 0 0-2 1 1 0 0 0 0 2zm3 0a1 1 0 1 0 0-2 1 1 0 0 0 0 2zm3 0a1 1 0 1 0 0-2 1 1 0 0 0 0 2zm-9 3a1 1 0 1 0 0-2 1 1 0 0 0 0 2zm3 0a1 1 0 1 0 0-2 1 1 0 0 0 0 2zm3 0a1 1 0 1 0 0-2 1 1 0 0 0 0 2zm3 0a1 1 0 1 0 0-2 1 1 0 0 0 0 2zm-9 3a1 1 0 1 0 0-2 1 1 0 0 0 0 2zm3 0a1 1 0 1 0 0-2 1 1 0 0 0 0 2zm3 0a1 1 0 1 0 0-2 1 1 0 0 0 0 2z" />
|
||||
</symbol>
|
||||
<symbol id="chat-quote-fill" viewBox="0 0 16 16">
|
||||
<path
|
||||
d="M16 8c0 3.866-3.582 7-8 7a9.06 9.06 0 0 1-2.347-.306c-.584.296-1.925.864-4.181 1.234-.2.032-.352-.176-.273-.362.354-.836.674-1.95.77-2.966C.744 11.37 0 9.76 0 8c0-3.866 3.582-7 8-7s8 3.134 8 7zM7.194 6.766a1.688 1.688 0 0 0-.227-.272 1.467 1.467 0 0 0-.469-.324l-.008-.004A1.785 1.785 0 0 0 5.734 6C4.776 6 4 6.746 4 7.667c0 .92.776 1.666 1.734 1.666.343 0 .662-.095.931-.26-.137.389-.39.804-.81 1.22a.405.405 0 0 0 .011.59c.173.16.447.155.614-.01 1.334-1.329 1.37-2.758.941-3.706a2.461 2.461 0 0 0-.227-.4zM11 9.073c-.136.389-.39.804-.81 1.22a.405.405 0 0 0 .012.59c.172.16.446.155.613-.01 1.334-1.329 1.37-2.758.942-3.706a2.466 2.466 0 0 0-.228-.4 1.686 1.686 0 0 0-.227-.273 1.466 1.466 0 0 0-.469-.324l-.008-.004A1.785 1.785 0 0 0 10.07 6c-.957 0-1.734.746-1.734 1.667 0 .92.777 1.666 1.734 1.666.343 0 .662-.095.931-.26z" />
|
||||
</symbol>
|
||||
<symbol id="cpu-fill" viewBox="0 0 16 16">
|
||||
<path d="M6.5 6a.5.5 0 0 0-.5.5v3a.5.5 0 0 0 .5.5h3a.5.5 0 0 0 .5-.5v-3a.5.5 0 0 0-.5-.5h-3z" />
|
||||
<path
|
||||
d="M5.5.5a.5.5 0 0 0-1 0V2A2.5 2.5 0 0 0 2 4.5H.5a.5.5 0 0 0 0 1H2v1H.5a.5.5 0 0 0 0 1H2v1H.5a.5.5 0 0 0 0 1H2v1H.5a.5.5 0 0 0 0 1H2A2.5 2.5 0 0 0 4.5 14v1.5a.5.5 0 0 0 1 0V14h1v1.5a.5.5 0 0 0 1 0V14h1v1.5a.5.5 0 0 0 1 0V14h1v1.5a.5.5 0 0 0 1 0V14a2.5 2.5 0 0 0 2.5-2.5h1.5a.5.5 0 0 0 0-1H14v-1h1.5a.5.5 0 0 0 0-1H14v-1h1.5a.5.5 0 0 0 0-1H14v-1h1.5a.5.5 0 0 0 0-1H14A2.5 2.5 0 0 0 11.5 2V.5a.5.5 0 0 0-1 0V2h-1V.5a.5.5 0 0 0-1 0V2h-1V.5a.5.5 0 0 0-1 0V2h-1V.5zm1 4.5h3A1.5 1.5 0 0 1 11 6.5v3A1.5 1.5 0 0 1 9.5 11h-3A1.5 1.5 0 0 1 5 9.5v-3A1.5 1.5 0 0 1 6.5 5z" />
|
||||
</symbol>
|
||||
<symbol id="gear-fill" viewBox="0 0 16 16">
|
||||
<path
|
||||
d="M9.405 1.05c-.413-1.4-2.397-1.4-2.81 0l-.1.34a1.464 1.464 0 0 1-2.105.872l-.31-.17c-1.283-.698-2.686.705-1.987 1.987l.169.311c.446.82.023 1.841-.872 2.105l-.34.1c-1.4.413-1.4 2.397 0 2.81l.34.1a1.464 1.464 0 0 1 .872 2.105l-.17.31c-.698 1.283.705 2.686 1.987 1.987l.311-.169a1.464 1.464 0 0 1 2.105.872l.1.34c.413 1.4 2.397 1.4 2.81 0l.1-.34a1.464 1.464 0 0 1 2.105-.872l.31.17c1.283.698 2.686-.705 1.987-1.987l-.169-.311a1.464 1.464 0 0 1 .872-2.105l.34-.1c1.4-.413 1.4-2.397 0-2.81l-.34-.1a1.464 1.464 0 0 1-.872-2.105l.17-.31c.698-1.283-.705-2.686-1.987-1.987l-.311.169a1.464 1.464 0 0 1-2.105-.872l-.1-.34zM8 10.93a2.929 2.929 0 1 1 0-5.86 2.929 2.929 0 0 1 0 5.858z" />
|
||||
</symbol>
|
||||
<symbol id="speedometer" viewBox="0 0 16 16">
|
||||
<path
|
||||
d="M8 2a.5.5 0 0 1 .5.5V4a.5.5 0 0 1-1 0V2.5A.5.5 0 0 1 8 2zM3.732 3.732a.5.5 0 0 1 .707 0l.915.914a.5.5 0 1 1-.708.708l-.914-.915a.5.5 0 0 1 0-.707zM2 8a.5.5 0 0 1 .5-.5h1.586a.5.5 0 0 1 0 1H2.5A.5.5 0 0 1 2 8zm9.5 0a.5.5 0 0 1 .5-.5h1.5a.5.5 0 0 1 0 1H12a.5.5 0 0 1-.5-.5zm.754-4.246a.389.389 0 0 0-.527-.02L7.547 7.31A.91.91 0 1 0 8.85 8.569l3.434-4.297a.389.389 0 0 0-.029-.518z" />
|
||||
<path fill-rule="evenodd"
|
||||
d="M6.664 15.889A8 8 0 1 1 9.336.11a8 8 0 0 1-2.672 15.78zm-4.665-4.283A11.945 11.945 0 0 1 8 10c2.186 0 4.236.585 6.001 1.606a7 7 0 1 0-12.002 0z" />
|
||||
</symbol>
|
||||
<symbol id="toggles2" viewBox="0 0 16 16">
|
||||
<path d="M9.465 10H12a2 2 0 1 1 0 4H9.465c.34-.588.535-1.271.535-2 0-.729-.195-1.412-.535-2z" />
|
||||
<path
|
||||
d="M6 15a3 3 0 1 0 0-6 3 3 0 0 0 0 6zm0 1a4 4 0 1 1 0-8 4 4 0 0 1 0 8zm.535-10a3.975 3.975 0 0 1-.409-1H4a1 1 0 0 1 0-2h2.126c.091-.355.23-.69.41-1H4a2 2 0 1 0 0 4h2.535z" />
|
||||
<path d="M14 4a4 4 0 1 1-8 0 4 4 0 0 1 8 0z" />
|
||||
</symbol>
|
||||
<symbol id="tools" viewBox="0 0 16 16">
|
||||
<path
|
||||
d="M1 0L0 1l2.2 3.081a1 1 0 0 0 .815.419h.07a1 1 0 0 1 .708.293l2.675 2.675-2.617 2.654A3.003 3.003 0 0 0 0 13a3 3 0 1 0 5.878-.851l2.654-2.617.968.968-.305.914a1 1 0 0 0 .242 1.023l3.356 3.356a1 1 0 0 0 1.414 0l1.586-1.586a1 1 0 0 0 0-1.414l-3.356-3.356a1 1 0 0 0-1.023-.242L10.5 9.5l-.96-.96 2.68-2.643A3.005 3.005 0 0 0 16 3c0-.269-.035-.53-.102-.777l-2.14 2.141L12 4l-.364-1.757L13.777.102a3 3 0 0 0-3.675 3.68L7.462 6.46 4.793 3.793a1 1 0 0 1-.293-.707v-.071a1 1 0 0 0-.419-.814L1 0zm9.646 10.646a.5.5 0 0 1 .708 0l3 3a.5.5 0 0 1-.708.708l-3-3a.5.5 0 0 1 0-.708zM3 11l.471.242.529.026.287.445.445.287.026.529L5 13l-.242.471-.026.529-.445.287-.287.445-.529.026L3 15l-.471-.242L2 14.732l-.287-.445L1.268 14l-.026-.529L1 13l.242-.471.026-.529.445-.287.287-.445.529-.026L3 11z" />
|
||||
</symbol>
|
||||
<symbol id="chevron-right" viewBox="0 0 16 16">
|
||||
<path fill-rule="evenodd"
|
||||
d="M4.646 1.646a.5.5 0 0 1 .708 0l6 6a.5.5 0 0 1 0 .708l-6 6a.5.5 0 0 1-.708-.708L10.293 8 4.646 2.354a.5.5 0 0 1 0-.708z" />
|
||||
</symbol>
|
||||
<symbol id="geo-fill" viewBox="0 0 16 16">
|
||||
<path fill-rule="evenodd"
|
||||
d="M4 4a4 4 0 1 1 4.5 3.969V13.5a.5.5 0 0 1-1 0V7.97A4 4 0 0 1 4 3.999zm2.493 8.574a.5.5 0 0 1-.411.575c-.712.118-1.28.295-1.655.493a1.319 1.319 0 0 0-.37.265.301.301 0 0 0-.057.09V14l.002.008a.147.147 0 0 0 .016.033.617.617 0 0 0 .145.15c.165.13.435.27.813.395.751.25 1.82.414 3.024.414s2.273-.163 3.024-.414c.378-.126.648-.265.813-.395a.619.619 0 0 0 .146-.15.148.148 0 0 0 .015-.033L12 14v-.004a.301.301 0 0 0-.057-.09 1.318 1.318 0 0 0-.37-.264c-.376-.198-.943-.375-1.655-.493a.5.5 0 1 1 .164-.986c.77.127 1.452.328 1.957.594C12.5 13 13 13.4 13 14c0 .426-.26.752-.544.977-.29.228-.68.413-1.116.558-.878.293-2.059.465-3.34.465-1.281 0-2.462-.172-3.34-.465-.436-.145-.826-.33-1.116-.558C3.26 14.752 3 14.426 3 14c0-.599.5-1 .961-1.243.505-.266 1.187-.467 1.957-.594a.5.5 0 0 1 .575.411z" />
|
||||
</symbol>
|
||||
</svg>
|
||||
<main>
|
||||
<div class="d-flex flex-column flex-shrink-0 p-3 text-white bg-dark" style="width: 280px;">
|
||||
<a href="/" class="d-flex align-items-center mb-3 mb-md-0 me-md-auto text-white text-decoration-none">
|
||||
<svg class="bi me-2" width="40" height="32">
|
||||
<use xlink:href="#bootstrap" />
|
||||
</svg>
|
||||
<span class="fs-4">Sidebar</span>
|
||||
</a>
|
||||
<hr>
|
||||
<ul class="nav nav-pills flex-column mb-auto">
|
||||
<li class="nav-item">
|
||||
<a href="#homeP" class="nav-link active" aria-current="page" id="PageIndex">
|
||||
<svg class="bi me-2" width="16" height="16">
|
||||
<use xlink:href="#home" />
|
||||
</svg>
|
||||
Home
|
||||
</a>
|
||||
</li>
|
||||
<li>
|
||||
<a href="#debug" class="nav-link text-white" id="PageDebug">
|
||||
<svg class="bi me-2" width="16" height="16">
|
||||
<use xlink:href="#grid" />
|
||||
</svg>
|
||||
Debug
|
||||
</a>
|
||||
</li>
|
||||
<li>
|
||||
<a href="#about" class="nav-link text-white" id="PageAbout">
|
||||
<svg class="bi me-2" width="16" height="16">
|
||||
<use xlink:href="#people-circle" />
|
||||
</svg>
|
||||
About
|
||||
</a>
|
||||
</li>
|
||||
</ul>
|
||||
<hr>
|
||||
openCountdown <div class="btn-group" role="group" aria-label="Basic radio toggle button group">
|
||||
|
||||
<input type="radio" class="btn-check" name="btnradio2" id="Mbtnradio1" autocomplete="off" checked>
|
||||
<label class="btn btn-outline-primary" for="Mbtnradio1"><svg xmlns="http://www.w3.org/2000/svg"
|
||||
width="16" height="16" fill="currentColor" class="bi bi-brightness-high-fill"
|
||||
viewBox="0 0 16 16">
|
||||
<path
|
||||
d="M12 8a4 4 0 1 1-8 0 4 4 0 0 1 8 0zM8 0a.5.5 0 0 1 .5.5v2a.5.5 0 0 1-1 0v-2A.5.5 0 0 1 8 0zm0 13a.5.5 0 0 1 .5.5v2a.5.5 0 0 1-1 0v-2A.5.5 0 0 1 8 13zm8-5a.5.5 0 0 1-.5.5h-2a.5.5 0 0 1 0-1h2a.5.5 0 0 1 .5.5zM3 8a.5.5 0 0 1-.5.5h-2a.5.5 0 0 1 0-1h2A.5.5 0 0 1 3 8zm10.657-5.657a.5.5 0 0 1 0 .707l-1.414 1.415a.5.5 0 1 1-.707-.708l1.414-1.414a.5.5 0 0 1 .707 0zm-9.193 9.193a.5.5 0 0 1 0 .707L3.05 13.657a.5.5 0 0 1-.707-.707l1.414-1.414a.5.5 0 0 1 .707 0zm9.193 2.121a.5.5 0 0 1-.707 0l-1.414-1.414a.5.5 0 0 1 .707-.707l1.414 1.414a.5.5 0 0 1 0 .707zM4.464 4.465a.5.5 0 0 1-.707 0L2.343 3.05a.5.5 0 1 1 .707-.707l1.414 1.414a.5.5 0 0 1 0 .708z" />
|
||||
</svg>
|
||||
</label>
|
||||
|
||||
<input type="radio" class="btn-check" name="btnradio2" id="Mbtnradio2" autocomplete="off">
|
||||
<label class="btn btn-outline-primary" for="Mbtnradio2">
|
||||
<svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" fill="currentColor"
|
||||
class="bi bi-moon-fill" viewBox="0 0 16 16">
|
||||
<path
|
||||
d="M6 .278a.768.768 0 0 1 .08.858 7.208 7.208 0 0 0-.878 3.46c0 4.021 3.278 7.277 7.318 7.277.527 0 1.04-.055 1.533-.16a.787.787 0 0 1 .81.316.733.733 0 0 1-.031.893A8.349 8.349 0 0 1 8.344 16C3.734 16 0 12.286 0 7.71 0 4.266 2.114 1.312 5.124.06A.752.752 0 0 1 6 .278z" />
|
||||
</svg>
|
||||
</label>
|
||||
|
||||
<input type="radio" class="btn-check" name="btnradio2" id="Mbtnradio3" autocomplete="off">
|
||||
<label class="btn btn-outline-primary" for="Mbtnradio3">
|
||||
Auto
|
||||
</label>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
<pages class="d-flex flex-fill">
|
||||
|
||||
|
||||
<page id="homeP" class="pageC flex-fill overflow-auto">
|
||||
<h1>Home page</h1>
|
||||
|
||||
<div class="container">
|
||||
<div class="row">
|
||||
<div class="col">
|
||||
<h3>Preview: </h3>
|
||||
<iframe src="/timer?smaller=true" height="100%" width="100%"> </iframe>
|
||||
</div>
|
||||
<div class="col">
|
||||
<h3>Mode</h3>
|
||||
<div class="btn-group" role="group" aria-label="Basic radio toggle button group">
|
||||
<input type="radio" class="btn-check" name="btnradio" id="btnradio1" autocomplete="off"
|
||||
checked>
|
||||
<label class="btn btn-outline-primary" for="btnradio1">Timer</label>
|
||||
|
||||
<input type="radio" class="btn-check" name="btnradio" id="btnradio2" autocomplete="off">
|
||||
<label class="btn btn-outline-primary" for="btnradio2">Clock</label>
|
||||
|
||||
<input type="radio" class="btn-check" name="btnradio" id="btnradio3" autocomplete="off">
|
||||
<label class="btn btn-outline-primary" for="btnradio3">Black</label>
|
||||
|
||||
<input type="radio" class="btn-check" name="btnradio" id="btnradio4" autocomplete="off">
|
||||
<label class="btn btn-outline-primary" for="btnradio4">Testimage</label>
|
||||
</div>
|
||||
<br>
|
||||
<br>
|
||||
<br>
|
||||
<controls>
|
||||
<button class="btn btn-outline-success p-4" id="funcPlay"><svg
|
||||
xmlns="http://www.w3.org/2000/svg" width="16" height="16" fill="currentColor"
|
||||
class="bi bi-play-fill" viewBox="0 0 16 16">
|
||||
<path
|
||||
d="m11.596 8.697-6.363 3.692c-.54.313-1.233-.066-1.233-.697V4.308c0-.63.692-1.01 1.233-.696l6.363 3.692a.802.802 0 0 1 0 1.393z" />
|
||||
</svg></button>
|
||||
|
||||
<button class="btn btn-outline-warning p-4" id="funcPause"><svg
|
||||
xmlns="http://www.w3.org/2000/svg" width="16" height="16" fill="currentColor"
|
||||
class="bi bi-pause" viewBox="0 0 16 16">
|
||||
<path
|
||||
d="M6 3.5a.5.5 0 0 1 .5.5v8a.5.5 0 0 1-1 0V4a.5.5 0 0 1 .5-.5zm4 0a.5.5 0 0 1 .5.5v8a.5.5 0 0 1-1 0V4a.5.5 0 0 1 .5-.5z" />
|
||||
</svg></button>
|
||||
<button class="btn btn-outline-info p-4" id="funcRestart"><svg
|
||||
xmlns="http://www.w3.org/2000/svg" width="16" height="16" fill="currentColor"
|
||||
class="bi bi-arrow-clockwise" viewBox="0 0 16 16">
|
||||
<path fill-rule="evenodd"
|
||||
d="M8 3a5 5 0 1 0 4.546 2.914.5.5 0 0 1 .908-.417A6 6 0 1 1 8 2v1z" />
|
||||
<path
|
||||
d="M8 4.466V.534a.25.25 0 0 1 .41-.192l2.36 1.966c.12.1.12.284 0 .384L8.41 4.658A.25.25 0 0 1 8 4.466z" />
|
||||
</svg></button>
|
||||
</controls>
|
||||
<br>
|
||||
<br>
|
||||
<br>
|
||||
|
||||
<presets>
|
||||
<button class="btn btn-outline-secondary m-1 pres" value="300000">00:05:00</button>
|
||||
<button class="btn btn-outline-secondary m-1 pres" value="600000">00:10:00</button>
|
||||
<button class="btn btn-outline-secondary m-1 pres" value="900000">00:15:00</button><br>
|
||||
<button class="btn btn-outline-secondary m-1 pres" value="1200000">00:20:00</button>
|
||||
<button class="btn btn-outline-secondary m-1 pres" value="1500000">00:25:00</button>
|
||||
<button class="btn btn-outline-secondary m-1 pres"
|
||||
value="1800000">00:30:00</button><button class="btn btn-outline-primary m-1 mt-0"
|
||||
id="GoPreset">Go</button><br>
|
||||
<button class="btn btn-outline-secondary m-1 pres" value="2100000">00:35:00</button>
|
||||
<button class="btn btn-outline-secondary m-1 pres" value="2400000">00:40:00</button>
|
||||
<button class="btn btn-outline-secondary m-1 pres" value="2700000">00:45:00</button>
|
||||
</presets>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<br><br><br>
|
||||
<h3>Timer / Messaging</h3>
|
||||
<div class="container">
|
||||
<div class="row" style="width: 60%;">
|
||||
<div class="col">
|
||||
<h4>H</h4>
|
||||
<button class="btn btn-outline-secondary" id="timerHourInc">
|
||||
<svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" fill="currentColor"
|
||||
class="bi bi-plus" viewBox="0 0 16 16">
|
||||
<path
|
||||
d="M8 4a.5.5 0 0 1 .5.5v3h3a.5.5 0 0 1 0 1h-3v3a.5.5 0 0 1-1 0v-3h-3a.5.5 0 0 1 0-1h3v-3A.5.5 0 0 1 8 4z" />
|
||||
</svg>
|
||||
</button><br>
|
||||
<b id="timerHoursV">0</b><br>
|
||||
<button class="btn btn-outline-secondary" id="timerHourDec">
|
||||
<svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" fill="currentColor"
|
||||
class="bi bi-dash" viewBox="0 0 16 16">
|
||||
<path d="M4 8a.5.5 0 0 1 .5-.5h7a.5.5 0 0 1 0 1h-7A.5.5 0 0 1 4 8z" />
|
||||
</svg>
|
||||
</button>
|
||||
</div>
|
||||
|
||||
<div class="col">
|
||||
<h4>M</h4>
|
||||
<button class="btn btn-outline-secondary" id="timerMinuteInc">
|
||||
<svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" fill="currentColor"
|
||||
class="bi bi-plus" viewBox="0 0 16 16">
|
||||
<path
|
||||
d="M8 4a.5.5 0 0 1 .5.5v3h3a.5.5 0 0 1 0 1h-3v3a.5.5 0 0 1-1 0v-3h-3a.5.5 0 0 1 0-1h3v-3A.5.5 0 0 1 8 4z" />
|
||||
</svg>
|
||||
</button><br>
|
||||
<b id="timerMinuteV">0</b><br>
|
||||
<button class="btn btn-outline-secondary" id="timerMinuteDev">
|
||||
<svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" fill="currentColor"
|
||||
class="bi bi-dash" viewBox="0 0 16 16">
|
||||
<path d="M4 8a.5.5 0 0 1 .5-.5h7a.5.5 0 0 1 0 1h-7A.5.5 0 0 1 4 8z" />
|
||||
</svg>
|
||||
</button>
|
||||
</div>
|
||||
|
||||
<div class="col">
|
||||
<h4>S</h4>
|
||||
<button class="btn btn-outline-secondary" id="timerSecondsInc">
|
||||
<svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" fill="currentColor"
|
||||
class="bi bi-plus" viewBox="0 0 16 16">
|
||||
<path
|
||||
d="M8 4a.5.5 0 0 1 .5.5v3h3a.5.5 0 0 1 0 1h-3v3a.5.5 0 0 1-1 0v-3h-3a.5.5 0 0 1 0-1h3v-3A.5.5 0 0 1 8 4z" />
|
||||
</svg>
|
||||
</button><br>
|
||||
<b id="timerSecondsV">0</b><br>
|
||||
<button class="btn btn-outline-secondary" id="timerSecondsDec">
|
||||
<svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" fill="currentColor"
|
||||
class="bi bi-dash" viewBox="0 0 16 16">
|
||||
<path d="M4 8a.5.5 0 0 1 .5-.5h7a.5.5 0 0 1 0 1h-7A.5.5 0 0 1 4 8z" />
|
||||
</svg>
|
||||
</button>
|
||||
</div>
|
||||
<div class="col">
|
||||
<button class="btn btn-outline-primary m-1 mt-0" id="goJogger">Go</button>
|
||||
</div>
|
||||
<div class="col">
|
||||
<div style="border-left:1px solid #000;height:100%"></div>
|
||||
|
||||
</div>
|
||||
|
||||
<div class="col">
|
||||
<br>
|
||||
<input type="text" id="messageContent" class="form-control" style="width: 200%"
|
||||
placeholder="Message here">
|
||||
<button class="btn btn-outline-primary m-1" id="sendMessage"><svg
|
||||
xmlns="http://www.w3.org/2000/svg" width="16" height="16" fill="currentColor"
|
||||
class="bi bi-send" viewBox="0 0 16 16">
|
||||
<path
|
||||
d="M15.854.146a.5.5 0 0 1 .11.54l-5.819 14.547a.75.75 0 0 1-1.329.124l-3.178-4.995L.643 7.184a.75.75 0 0 1 .124-1.33L15.314.037a.5.5 0 0 1 .54.11ZM6.636 10.07l2.761 4.338L14.13 2.576 6.636 10.07Zm6.787-8.201L1.591 6.602l4.339 2.76 7.494-7.493Z" />
|
||||
</svg></button>
|
||||
<button class="btn btn-outline-primary m-1" id="ctrlRemoveMessage">
|
||||
<svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" fill="currentColor"
|
||||
class="bi bi-eye-slash-fill" viewBox="0 0 16 16">
|
||||
<path
|
||||
d="m10.79 12.912-1.614-1.615a3.5 3.5 0 0 1-4.474-4.474l-2.06-2.06C.938 6.278 0 8 0 8s3 5.5 8 5.5a7.029 7.029 0 0 0 2.79-.588zM5.21 3.088A7.028 7.028 0 0 1 8 2.5c5 0 8 5.5 8 5.5s-.939 1.721-2.641 3.238l-2.062-2.062a3.5 3.5 0 0 0-4.474-4.474L5.21 3.089z" />
|
||||
<path
|
||||
d="M5.525 7.646a2.5 2.5 0 0 0 2.829 2.829l-2.83-2.829zm4.95.708-2.829-2.83a2.5 2.5 0 0 1 2.829 2.829zm3.171 6-12-12 .708-.708 12 12-.708.708z" />
|
||||
</svg>
|
||||
</button>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
<hr>
|
||||
<h3>Layout</h3>
|
||||
|
||||
|
||||
<label for="showTime">Show clock on Timer:</label>
|
||||
<input type="checkbox" name="showTime" id="showTime"><br>
|
||||
|
||||
<label for="showMillis">Show Milliseconds on Timer:</label>
|
||||
<input type="checkbox" name="showMillis" id="showMillis"><br>
|
||||
|
||||
<label for="progBarShow">Show progressbar:</label>
|
||||
<input type="checkbox" name="progBarShow" id="progBarShow"><br>
|
||||
<br>
|
||||
<placeholder>Colors</placeholder><br>
|
||||
<label for="textColors">Enable Text Colors:</label>
|
||||
<input type="checkbox" name="textColors" id="textColors"><br>
|
||||
<br>
|
||||
<placeholder>Colors</placeholder><br>
|
||||
|
||||
<button type="button" class="btn btn-outline-success" id="applyLayout">Apply settings</button>
|
||||
|
||||
<button type="button" class="btn btn-outline-success" id="saveLayout">Save as startup settings (Layout
|
||||
only)</button>
|
||||
|
||||
</page>
|
||||
|
||||
<page id="debug" class="pageC hidden flex-fill">
|
||||
<h1>Debug page</h1>
|
||||
<div class="alert alert-warning" role="alert">
|
||||
<h4 class="alert-heading">Attention</h4>
|
||||
<p>This is a debug page which should only be used by professionals. Changing any options below might
|
||||
impact operation.</p>
|
||||
<hr>
|
||||
<p class="mb-0">Proceed with caution.</p>
|
||||
</div>
|
||||
<label for="debugMode">Enable time variance display:</label>
|
||||
<input type="checkbox" name="debugMode" id="debugModeEnable" value="true"><br><br>
|
||||
|
||||
<button type="button" class="btn btn-outline-success" id="applyDebug">Apply settings</button>
|
||||
<br><br>
|
||||
<h3>Raw server reponse</h3>
|
||||
<code id="responeSnippet" style="width: 40%; display: inline-block;">
|
||||
|
||||
</code>
|
||||
|
||||
|
||||
|
||||
<div class="card">
|
||||
<div class="card-body">
|
||||
<div id="table" class="table-editable">
|
||||
<span class="table-add float-right mb-3 mr-2"><a href="#!" class="text-success"><i
|
||||
class="fas fa-plus fa-2x" aria-hidden="true"></i></a></span>
|
||||
<table class="table table-bordered table-responsive-md table-striped text-center">
|
||||
<thead>
|
||||
<tr>
|
||||
<th class="text-center">Time</th>
|
||||
<th class="text-center">Color</th>
|
||||
<th class="text-center">Remove</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
<tr>
|
||||
<td class="pt-3-half" contenteditable="true">Aurelia Vega</td>
|
||||
<td class="pt-3-half" contenteditable="false"><input type="color"></td>
|
||||
|
||||
<td>
|
||||
<span class="table-remove"><button type="button"
|
||||
class="btn btn-danger btn-rounded btn-sm my-0">
|
||||
Remove
|
||||
</button></span>
|
||||
</td>
|
||||
</tr>
|
||||
<!-- This is our clonable table line -->
|
||||
<tr>
|
||||
<td class="pt-3-half" contenteditable="true">5000</td>
|
||||
<td class="pt-3-half" contenteditable="false"><input type="color"></td>
|
||||
<td>
|
||||
<span class="table-remove"><button type="button"
|
||||
class="btn btn-danger btn-rounded btn-sm my-0">
|
||||
Remove
|
||||
</button></span>
|
||||
</td>
|
||||
</tr>
|
||||
<!-- This is our clonable table line -->
|
||||
<tr>
|
||||
<td class="pt-3-half" contenteditable="true">Guadalupe House</td>
|
||||
<td class="pt-3-half" contenteditable="false"><input type="color"></td>
|
||||
<td>
|
||||
<span class="table-remove"><button type="button"
|
||||
class="btn btn-danger btn-rounded btn-sm my-0">
|
||||
Remove
|
||||
</button></span>
|
||||
</td>
|
||||
</tr>
|
||||
<!-- This is our clonable table line -->
|
||||
<tr class="hide">
|
||||
<td class="pt-3-half" contenteditable="true">Elisa Gallagher</td>
|
||||
<td class="pt-3-half" contenteditable="false"><input type="color"></td>
|
||||
|
||||
<td>
|
||||
<span class="table-remove"><button type="button"
|
||||
class="btn btn-danger btn-rounded btn-sm my-0">
|
||||
Remove
|
||||
</button></span>
|
||||
</td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
</page>
|
||||
<page id="about" class="pageC hidden flex-fill">
|
||||
<h1>About</h1>
|
||||
Version: 1.0.0<br>
|
||||
NodeJS Version: UNKNOWN<br>
|
||||
Express Version: UNKNOWN<br>
|
||||
</page>
|
||||
</pages>
|
||||
</main>
|
||||
<script>
|
||||
|
||||
|
||||
$(document).ready(function () {
|
||||
const modes = ["timer", "clock", "black", "test"]
|
||||
let selectPresetTime = 0;
|
||||
|
||||
if (Cookies.get("interfaceColor") != undefined) {
|
||||
const color = Cookies.get("interfaceColor");
|
||||
$("#Mbtnradio" + (color))[0].checked = true
|
||||
if (color == 1) {
|
||||
DarkReader.disable()
|
||||
} else if (color == 2) {
|
||||
DarkReader.enable()
|
||||
} else {
|
||||
DarkReader.auto()
|
||||
}
|
||||
}
|
||||
|
||||
$("input[name='btnradio2']").click(function (event) {
|
||||
console.debug()
|
||||
const darkid = parseInt(event.currentTarget.id.replace("Mbtnradio", ""))
|
||||
if (darkid == 1) {
|
||||
DarkReader.disable()
|
||||
} else if (darkid == 2) {
|
||||
DarkReader.enable()
|
||||
} else {
|
||||
DarkReader.auto()
|
||||
}
|
||||
Cookies.set("interfaceColor", darkid)
|
||||
});
|
||||
|
||||
// Restore settings
|
||||
saveOption("/api/v1/data", function (event, xmlHttp) {
|
||||
|
||||
const jsonResult = JSON.parse(xmlHttp.response)
|
||||
document.getElementById("responeSnippet").innerHTML = JSON.stringify(jsonResult)
|
||||
// Restore mode radio
|
||||
const currentModeInt = modes.indexOf(jsonResult.mode);
|
||||
$("#btnradio" + (currentModeInt + 1))[0].checked = true
|
||||
// Restore layout settings
|
||||
$("#showTime")[0].checked = jsonResult.showTimeOnCountdown;
|
||||
$("#showMillis")[0].checked = jsonResult.showMilliSeconds;
|
||||
$("#progBarShow")[0].checked = jsonResult.showProgressbar;
|
||||
$("#textColors")[0].checked = jsonResult.enableColoredText;
|
||||
console.debug(jsonResult, currentModeInt)
|
||||
})
|
||||
|
||||
// Presets
|
||||
$(".pres").click(function (event) {
|
||||
selectPresetTime = parseInt(event.currentTarget.value)
|
||||
})
|
||||
|
||||
$("#GoPreset").click(function (event) {
|
||||
$("#GoPreset")[0].innerHTML = '<div class="spinner-border-sm spinner-border"></div>'
|
||||
|
||||
saveOption("/api/v1/set/addMillisToTimer?time=" + selectPresetTime, function (event) {
|
||||
setTimeout(function () {
|
||||
$("#GoPreset")[0].innerHTML = 'Go'
|
||||
}, 200)
|
||||
|
||||
})
|
||||
})
|
||||
|
||||
|
||||
$("#goJogger").click(function (event) {
|
||||
$("#goJogger")[0].innerHTML = '<div class="spinner-border-sm spinner-border"></div>'
|
||||
|
||||
saveOption("/api/v1/set/addMillisToTimer?time=" + currentTime, function (event) {
|
||||
setTimeout(function () {
|
||||
$("#goJogger")[0].innerHTML = 'Go'
|
||||
}, 200)
|
||||
|
||||
})
|
||||
})
|
||||
|
||||
// Layout settings
|
||||
$("#applyLayout").click(function (event) {
|
||||
$("#applyLayout")[0].innerHTML = '<div class="spinner-border-sm spinner-border"></div>'
|
||||
|
||||
// Collect all data, build all paths3
|
||||
const allPathes = [];
|
||||
|
||||
const showTimeB = $("#showTime")[0].checked
|
||||
const showMillisB = $("#showMillis")[0].checked
|
||||
const progBarShowB = $("#progBarShow")[0].checked
|
||||
const textColorsB = $("#textColors")[0].checked
|
||||
allPathes.push("/api/v1/set/layout/showTime?show=" + showTimeB)
|
||||
allPathes.push("/api/v1/set/layout/showMillis?show=" + showMillisB)
|
||||
allPathes.push("/api/v1/set/progressbar/show?show=" + progBarShowB)
|
||||
allPathes.push("/api/v1/set/text/enableColoring?show=" + textColorsB)
|
||||
|
||||
for (pI in allPathes) {
|
||||
const path = allPathes[pI];
|
||||
saveOption(path, function (event) {
|
||||
console.debug(event)
|
||||
})
|
||||
}
|
||||
|
||||
setTimeout(function () {
|
||||
$("#applyLayout")[0].innerHTML = 'Apply settings'
|
||||
}, 500)
|
||||
|
||||
})
|
||||
|
||||
|
||||
function msToTime(s, data) {
|
||||
var ms = s % 1000;
|
||||
s = (s - ms) / 1000;
|
||||
var secs = s % 60;
|
||||
s = (s - secs) / 60;
|
||||
var mins = s % 60;
|
||||
var hrs = (s - mins) / 60;
|
||||
let out = ""
|
||||
|
||||
return [ms, secs, mins, hrs];
|
||||
}
|
||||
|
||||
// Timer custom
|
||||
let currentTime = 0;
|
||||
$("#timerHourInc").click(function (event) {
|
||||
currentTime += 3600000
|
||||
const times = msToTime(currentTime)
|
||||
$("#timerHoursV")[0].innerHTML = times[3];
|
||||
$("#timerMinuteV")[0].innerHTML = times[2];
|
||||
$("#timerSecondsV")[0].innerHTML = times[1];
|
||||
})
|
||||
|
||||
$("#timerHourDec").click(function (event) {
|
||||
if (currentTime > 3600000) {
|
||||
currentTime -= 3600000
|
||||
const times = msToTime(currentTime)
|
||||
$("#timerHoursV")[0].innerHTML = times[3];
|
||||
$("#timerMinuteV")[0].innerHTML = times[2];
|
||||
$("#timerSecondsV")[0].innerHTML = times[1];
|
||||
}
|
||||
})
|
||||
|
||||
$("#timerMinuteInc").click(function (event) {
|
||||
currentTime += 60000
|
||||
const times = msToTime(currentTime)
|
||||
$("#timerHoursV")[0].innerHTML = times[3];
|
||||
$("#timerMinuteV")[0].innerHTML = times[2];
|
||||
$("#timerSecondsV")[0].innerHTML = times[1];
|
||||
})
|
||||
$("#timerMinuteDec").click(function (event) {
|
||||
if (currentTime > 60000) {
|
||||
currentTime -= 60000
|
||||
const times = msToTime(currentTime)
|
||||
$("#timerHoursV")[0].innerHTML = times[3];
|
||||
$("#timerMinuteV")[0].innerHTML = times[2];
|
||||
$("#timerSecondsV")[0].innerHTML = times[1];
|
||||
}
|
||||
})
|
||||
$("#timerSecondsInc").click(function (event) {
|
||||
currentTime += 1000
|
||||
const times = msToTime(currentTime)
|
||||
$("#timerHoursV")[0].innerHTML = times[3];
|
||||
$("#timerMinuteV")[0].innerHTML = times[2];
|
||||
$("#timerSecondsV")[0].innerHTML = times[1];
|
||||
})
|
||||
$("#timerSecondsDec").click(function (event) {
|
||||
if (currentTime > 1000) {
|
||||
currentTime -= 1000
|
||||
const times = msToTime(currentTime)
|
||||
$("#timerHoursV")[0].innerHTML = times[3];
|
||||
$("#timerMinuteV")[0].innerHTML = times[2];
|
||||
$("#timerSecondsV")[0].innerHTML = times[1];
|
||||
}
|
||||
})
|
||||
|
||||
$("input[name='btnradio']").click(function (event) {
|
||||
$("#sendMessage")[0].innerHTML = '<div class="spinner-border-sm spinner-border"></div>'
|
||||
let value = modes[parseInt(event.currentTarget.id.replace("btnradio", "")) - 1]
|
||||
console.log(value, parseInt(event.currentTarget.id.replace("btnradio", "")))
|
||||
saveOption("/api/v1/set/mode?mode=" + value, function (event) {
|
||||
setTimeout(function () {
|
||||
$("#sendMessage")[0].innerHTML = '<svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" fill="currentColor" class="bi bi-send" viewBox="0 0 16 16"> \
|
||||
<path d="M15.854.146a.5.5 0 0 1 .11.54l-5.819 14.547a.75.75 0 0 1-1.329.124l-3.178-4.995L.643 7.184a.75.75 0 0 1 .124-1.33L15.314.037a.5.5 0 0 1 .54.11ZM6.636 10.07l2.761 4.338L14.13 2.576 6.636 10.07Zm6.787-8.201L1.591 6.602l4.339 2.76 7.494-7.493Z"/> \
|
||||
</svg>'
|
||||
}, 200)
|
||||
|
||||
})
|
||||
})
|
||||
|
||||
|
||||
$("#sendMessage").click(function (event) {
|
||||
$("#sendMessage")[0].innerHTML = '<div class="spinner-border-sm spinner-border"></div>'
|
||||
let value = $("#messageContent").val()
|
||||
saveOption("/api/v1/ctrl/message/show?msg=" + value, function (event) {
|
||||
setTimeout(function () {
|
||||
$("#sendMessage")[0].innerHTML = '<svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" fill="currentColor" class="bi bi-send" viewBox="0 0 16 16"> \
|
||||
<path d="M15.854.146a.5.5 0 0 1 .11.54l-5.819 14.547a.75.75 0 0 1-1.329.124l-3.178-4.995L.643 7.184a.75.75 0 0 1 .124-1.33L15.314.037a.5.5 0 0 1 .54.11ZM6.636 10.07l2.761 4.338L14.13 2.576 6.636 10.07Zm6.787-8.201L1.591 6.602l4.339 2.76 7.494-7.493Z"/> \
|
||||
</svg>'
|
||||
}, 200)
|
||||
|
||||
})
|
||||
})
|
||||
|
||||
$("#ctrlRemoveMessage").click(function (event) {
|
||||
$("#ctrlRemoveMessage")[0].innerHTML = '<div class="spinner-border-sm spinner-border"></div>'
|
||||
saveOption("/api/v1/ctrl/message/hide", function (event) {
|
||||
setTimeout(function () {
|
||||
$("#ctrlRemoveMessage")[0].innerHTML = '<svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" fill="currentColor" class="bi bi-eye-slash-fill" viewBox="0 0 16 16">\
|
||||
<path d="m10.79 12.912-1.614-1.615a3.5 3.5 0 0 1-4.474-4.474l-2.06-2.06C.938 6.278 0 8 0 8s3 5.5 8 5.5a7.029 7.029 0 0 0 2.79-.588zM5.21 3.088A7.028 7.028 0 0 1 8 2.5c5 0 8 5.5 8 5.5s-.939 1.721-2.641 3.238l-2.062-2.062a3.5 3.5 0 0 0-4.474-4.474L5.21 3.089z"/>\
|
||||
<path d="M5.525 7.646a2.5 2.5 0 0 0 2.829 2.829l-2.83-2.829zm4.95.708-2.829-2.83a2.5 2.5 0 0 1 2.829 2.829zm3.171 6-12-12 .708-.708 12 12-.708.708z"/>\
|
||||
</svg>'
|
||||
}, 200)
|
||||
|
||||
})
|
||||
})
|
||||
|
||||
$("#funcPlay").click(function (event) {
|
||||
$("#funcPlay")[0].innerHTML = '<div class="spinner-border-sm spinner-border"></div>'
|
||||
saveOption("/api/v1/ctrl/timer/play", function (event) {
|
||||
setTimeout(function () {
|
||||
$("#funcPlay")[0].innerHTML = '<svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" fill="currentColor" class="bi bi-play-fill" viewBox="0 0 16 16"><path d="m11.596 8.697-6.363 3.692c-.54.313-1.233-.066-1.233-.697V4.308c0-.63.692-1.01 1.233-.696l6.363 3.692a.802.802 0 0 1 0 1.393z"></path></svg>'
|
||||
}, 200);
|
||||
})
|
||||
})
|
||||
|
||||
|
||||
$("#funcPause").click(function (event) {
|
||||
$("#funcPause")[0].innerHTML = '<div class="spinner-border-sm spinner-border"></div>'
|
||||
|
||||
saveOption("/api/v1/ctrl/timer/pause", function (event) {
|
||||
setTimeout(function () {
|
||||
$("#funcPause")[0].innerHTML = '<svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" fill="currentColor" class="bi bi-pause" viewBox="0 0 16 16" style="--darkreader-inline-fill: currentColor;" data-darkreader-inline-fill=""><path d="M6 3.5a.5.5 0 0 1 .5.5v8a.5.5 0 0 1-1 0V4a.5.5 0 0 1 .5-.5zm4 0a.5.5 0 0 1 .5.5v8a.5.5 0 0 1-1 0V4a.5.5 0 0 1 .5-.5z"></path></svg>'
|
||||
}, 200);
|
||||
})
|
||||
})
|
||||
|
||||
$("#funcRestart").click(function (event) {
|
||||
$("#funcRestart")[0].innerHTML = '<div class="spinner-border-sm spinner-border"></div>'
|
||||
saveOption("/api/v1/ctrl/timer/restart", function (event) {
|
||||
setTimeout(function () {
|
||||
$("#funcRestart")[0].innerHTML = '<svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" fill="currentColor" class="bi bi-arrow-clockwise" viewBox="0 0 16 16" style="--darkreader-inline-fill: currentColor;" data-darkreader-inline-fill=""><path fill-rule="evenodd" d="M8 3a5 5 0 1 0 4.546 2.914.5.5 0 0 1 .908-.417A6 6 0 1 1 8 2v1z"></path><path d="M8 4.466V.534a.25.25 0 0 1 .41-.192l2.36 1.966c.12.1.12.284 0 .384L8.41 4.658A.25.25 0 0 1 8 4.466z"></path></svg>'
|
||||
}, 200)
|
||||
})
|
||||
})
|
||||
|
||||
$("#applyDebug").click(function (event) {
|
||||
$("#applyDebug")[0].innerHTML = '<div class="spinner-border-sm spinner-border"></div>'
|
||||
let value = $("#debugModeEnable")[0].checked
|
||||
saveOption("/api/v1/debug?enable=" + value, function (event) {
|
||||
setTimeout(function () {
|
||||
$("#applyDebug")[0].innerHTML = "Apply settings"
|
||||
}, 200)
|
||||
|
||||
})
|
||||
})
|
||||
|
||||
$("a.nav-link").click(function (event) {
|
||||
event.preventDefault();
|
||||
$("a.nav-link").removeClass("active")
|
||||
|
||||
event.currentTarget.classList.add("active")
|
||||
|
||||
$(".pageC").addClass("hidden")
|
||||
$("#" + event.target.href.split("#")[1]).removeClass("hidden")
|
||||
console.log(event.target.href.split("#")[1])
|
||||
});
|
||||
});
|
||||
|
||||
function saveOption(path, callback) {
|
||||
var xmlHttp = new XMLHttpRequest();
|
||||
xmlHttp.open("GET", path, true); // false for synchronous request
|
||||
xmlHttp.send(null);
|
||||
xmlHttp.onerror = function (e) {
|
||||
console.log(e); // ToDo: Popup, etc.
|
||||
};
|
||||
xmlHttp.onloadend = function (event) {
|
||||
callback(event, xmlHttp)
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
|
||||
</body>
|
||||
|
||||
</html>
|
Reference in New Issue
Block a user