inital commit

This commit is contained in:
2022-02-23 21:55:13 +01:00
commit 52347d357d
9 changed files with 1102 additions and 0 deletions

View File

@ -0,0 +1,24 @@
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<!-- Created with Inkscape (http://www.inkscape.org/) -->
<svg xmlns:svg="http://www.w3.org/2000/svg" xmlns="http://www.w3.org/2000/svg" version="1.0" width="672" height="504" id="svg2">
<defs id="defs4"/>
<g id="layer1">
<rect width="672" height="504" x="0" y="0" style="fill:#131313;fill-opacity:1;fill-rule:nonzero" id="rect2762"/>
<rect width="96" height="336" x="0" y="0" style="fill:silver;fill-opacity:1;fill-rule:nonzero" id="rect2768"/>
<rect width="96" height="336" x="96" y="0" transform="translate(-6.4e-5,0)" style="fill:#c0c000;fill-opacity:1;fill-rule:nonzero" id="rect2770"/>
<rect width="128" height="336" x="192" y="0" transform="matrix(0.75,0,0,1,48,0)" style="fill:#00c0c0;fill-opacity:1;fill-rule:nonzero" id="rect2772"/>
<rect width="128" height="336" x="288" y="0" transform="matrix(0.75,0,0,1,72,0)" style="fill:#00c000;fill-opacity:1;fill-rule:nonzero" id="rect2774"/>
<rect width="128" height="336" x="384" y="0" transform="matrix(0.75,0,0,1,96,0)" style="fill:#c000c0;fill-opacity:1;fill-rule:nonzero" id="rect2776"/>
<rect width="128" height="336" x="480" y="0" transform="matrix(0.75,0,0,1,120,0)" style="fill:#c00000;fill-opacity:1;fill-rule:nonzero" id="rect2778"/>
<rect width="128" height="336" x="576" y="0" transform="matrix(0.75,0,0,1,144,0)" style="fill:#0000c0;fill-opacity:1;fill-rule:nonzero" id="rect2780"/>
<rect width="96" height="42" x="0" y="336" style="fill:#0000c0;fill-opacity:1;fill-rule:nonzero" id="rect2782"/>
<rect width="96" height="42" x="192" y="336" style="fill:#c000c0;fill-opacity:1;fill-rule:nonzero" id="rect2784"/>
<rect width="96" height="42" x="384" y="336" style="fill:#00c0c0;fill-opacity:1;fill-rule:nonzero" id="rect2786"/>
<rect width="96" height="42" x="576" y="336" style="fill:silver;fill-opacity:1;fill-rule:nonzero" id="rect2788"/>
<rect width="128" height="126" x="0" y="378" transform="scale(0.9375,1)" style="fill:#00214c;fill-opacity:1;fill-rule:nonzero" id="rect2790"/>
<rect width="128" height="126" x="0" y="378" transform="matrix(0.9375,0,0,1,120,0)" style="fill:white;fill-opacity:1;fill-rule:nonzero" id="rect2796"/>
<rect width="128" height="126" x="0" y="378" transform="matrix(0.9375,0,0,1,240,0)" style="fill:#32006a;fill-opacity:1;fill-rule:nonzero" id="rect2798"/>
<rect width="32" height="126" x="480" y="378" style="fill:#090909;fill-opacity:1;fill-rule:nonzero" id="rect2800"/>
<rect width="32" height="126" x="544" y="378" style="fill:#1d1d1d;fill-opacity:1;fill-rule:nonzero" id="rect2802"/>
</g>
</svg>

After

Width:  |  Height:  |  Size: 2.6 KiB

33
static/css/styles.css Normal file
View File

@ -0,0 +1,33 @@
html, body {
height: 100%;
width: 100%;
background-color: black;
color: white;
overflow: hidden;
margin: 0px;
}
.container {
margin: 0px;
width: 100%;
height: 100%;
outline: dashed 1px black;
display: flex;
margin-left: auto;
margin-right: auto;
/* Setup */
position: relative;
justify-content: center;
align-items: center;
}
.timer {
font-size: 200px;
text-align: center;
}
.testImg{
height: 100%;
width: 100%;
}

44
static/js/script.js Normal file
View File

@ -0,0 +1,44 @@
function handleUpdate() {
resp = httpGet("/api/v1/data");
var data = JSON.parse(resp);
if (data.mode == "clock") {
document.getElementById("timer").innerHTML = getTime();
document.getElementById("testImg").style.display = "none";
} else if (data.mode == "timer") {
document.getElementById("timer").innerHTML = data.timeLeft;
document.getElementById("testImg").style.display = "none";
} else if (data.mode == "black") {
document.getElementById("timer").innerHTML = "";
document.getElementById("testImg").style.display = "none";
} else if (data.mode == "test") {
document.getElementById("timer").innerHTML = "";
document.getElementById("testImg").style.display = "block";
}
}
function httpGet(theUrl) {
var xmlHttp = new XMLHttpRequest();
xmlHttp.open("GET", theUrl, false); // false for synchronous request
xmlHttp.send(null);
return xmlHttp.responseText;
}
function getTime() {
var date = new Date();
var h = date.getHours(); // 0 - 23
var m = date.getMinutes(); // 0 - 59
var s = date.getSeconds(); // 0 - 59
h = h < 10 ? "0" + h : h;
m = m < 10 ? "0" + m : m;
s = s < 10 ? "0" + s : s;
var time = h + ":" + m + ":" + s;
return time;
}
setInterval(handleUpdate, 50);