Commit 407d8dfd authored by Frank Fuhlbrück's avatar Frank Fuhlbrück
Browse files

diverses

parent d32de9e9
image: alpine:latest
pages:
stage: deploy
script:
- echo 'Nothing to do...'
artifacts:
paths:
- klausuhr/
only:
- master
......@@ -4,10 +4,10 @@
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<meta charset="utf-8"/>
<title>Klausuhr - die Klausuruhr</title>
<style>
body {
background-color:black
background-color:black;
overflow:hidden;
}
#setup {
font-size:20pt;
......@@ -16,9 +16,14 @@
color:black;
position: absolute;
width: 95vw;
height: 95vh;
height: 90vh;
top:2vh;
left:2vh;
padding:2vh
}
.minsec {
margin-left:-6%;
margin-right:-6%;
}
#time {
font-size:40vw;
......@@ -26,8 +31,15 @@
color:white;
text-align: center;
vertical-align: center;
position: relative;
top:12vh;
margin:0px;
}
#secondsmini {
font-family: monospace;
color:white;
position: absolute;
right:1vh;
bottom:0vh;
font-size:2vw;
}
#wc {
font-size:10vh;
......@@ -39,7 +51,7 @@
top:2vh;
padding:0.3vw;
visibility:hidden;
}
}
</style>
<script>
var started = false;
......@@ -49,24 +61,64 @@
var elapsed = 0;
var remaining = 0;
var finalFiveMin = false;
var finallNinetyNine = false;
var neverFinalFive = false;
var noPause = true;
var minute = "<span class='minsec'>'</span>";
var colon = '<span class="minsec">:</span>';
var fullscreen = function(){};
if(document.documentElement.requestFullscreen)
fullscreen = function(){document.documentElement.requestFullscreen();}
else if(document.documentElement.mozRequestFullscreen)
fullscreen = function(){document.documentElement.mozRequestFullscreen();}
else if(document.documentElement.webkitRequestFullscreen)
fullscreen = function(){document.documentElement.webkitRequestFullscreen();}
else if(document.documentElement.msRequestFullscreen)
fullscreen = function(){document.documentElement.msRequestFullscreen();};
var exitFullscreen = function(){};
if(document.exitFullscreen)
exitFullscreen = function(){document.exitFullscreen();}
else if(document.mozCancelFullScreen)
exitFullscreen = function(){document.mozCancelFullScreen();}
else if(document.webkitExitFullscreen)
exitFullscreen = function(){document.webkitExitFullscreen();}
else if(document.msExitFullscreen)
exitFullscreen = function(){document.msExitFullscreen();};
function init(){
fullOrig = document.getElementById("fullmin").value * 60;
full = fullOrig;
remaining = full;
document.getElementById("setup").style.visibility = "hidden";
document.getElementById("time").innerHTML =
(Math.floor(remaining / 60) + "'");
document.getElementById('set').blur();
document.getElementById("time").innerHTML =
(Math.floor(remaining / 60) + minute);
document.getElementById('set').blur();
if(!document.getElementById('autoFullscreen').checked){
fullscreen = function(){};
exitFullscreen = fullscreen;
}
if(!document.getElementById('finalFive').checked){
neverFinalFive = true;
}
if(!document.getElementById('noPause').checked){
noPause = true;
}
}
function toggleClock(){
if(started){
if(noPause)
return;
full = remaining;
started = false;
exitFullscreen();
} else {
startDate = Math.floor(new Date().getTime()/1000);
started = true;
fullscreen();
}
}
function toggleWC() {
......@@ -74,12 +126,19 @@
document.getElementById("wc").style.visibility == "hidden" ?
"visible" : "hidden";
}
window.onload=function(){
document.getElementById("set").onclick=init;
document.getElementById("time").ondblclick=toggleClock;
document.getElementById("time").onclick=toggleWC;
};
document.addEventListener('keydown', function(event){
if (event.key == " ")
if (event.key == " "){
toggleClock();
else
toggleWC();
} else if (event.key != "F5" && event.key != "F11") {
toggleWC();
}
});
setInterval(function(){
......@@ -99,37 +158,55 @@
return;
}
if (remaining < 6000 && !finallNinetyNine){
document.getElementById("time").style.fontSize = "50vw";
finallNinetyNine = true;
}
if (remaining < 300 && !finalFiveMin){
if (remaining < 300 && !neverFinalFive && !finalFiveMin){
finalFiveMin = true;
document.body.style.backgroundColor = "red";
document.getElementById("time").style.fontSize = "30vw";
document.getElementById("time").style.fontSize = "40vw";
document.getElementById("secondsmini").style.visibility = "hidden";
}
if (finalFiveMin){
document.getElementById("time").innerHTML =
(Math.floor(remaining / 60) + "'")+
(Math.floor(remaining / 60) + colon)+
((remaining % 60)<10?"0":"")+
((remaining % 60) + '"');
(remaining % 60);
} else {
document.getElementById("time").innerHTML =
(Math.floor(remaining / 60) + "'");
Math.floor(remaining / 60) + minute;
document.getElementById("secondsmini").innerHTML = remaining % 60;
}
}, 1000);
}, 1000);
</script>
</head>
<body>
<div id="time">???</div>
<div id="time"></div>
<div id="wc">WC</div>
<div id="secondsmini"></div>
<div id="setup">
<h3>Klausuhr - die Klausuruhr</h3>
<form action="">
<form action="klausuhr.html">
Dauer in Minuten: <input id="fullmin" type="text" value="120"><br>
<input type="button" value="Setzen" id="set" onclick="init()">
<input type="checkbox" id="autoFullscreen"> Autovollbild bei Start/Stop<br>
<input type="checkbox" id="finalFive" checked="checked"> Sekundenanzeige für letzte 5 Minuten<br>
<input type="checkbox" id="noPause" checked="checked"> Pausentasten deaktivieren<br>
<input type="button" value="OK" id="set"><br>
</form>
Starten der Uhr danach mit Leertaste, jede andere Taste wechselt
die WC-Anzeige.
<p>
Starten/Pausieren der Uhr danach mit Leertaste oder Doppelclick, jede andere Taste oder Einzelclick wechselt
die WC-Anzeige.</p>
<p>
Aktuelle Version jeweils unter: <a href="https://hu.berlin/klausuhr">hu.berlin/klausuhr</a>.<br>
Version zum Herunterladen in einer Datei <a href="https://hu.berlin/klausuhr-dl">hu.berlin/klausuhr-dl</a>.<br>
Änderungsvorschläge etc. gerne über
<a href="https://gitlab.informatik.hu-berlin.de/werkzeuge/werkzeuge/tree/master/klausuhr">das gitlab des Instituts für Informatik</a>.
</p>
</div>
</body>
</html>
......@@ -9,17 +9,29 @@
<script src="script.js" type="text/javascript"></script>
</head>
<body>
<div id="time">???</div>
<div id="time"></div>
<div id="wc">WC</div>
<div id="secondsmini"></div>
<div id="setup">
<h3>Klausuhr - die Klausuruhr</h3>
<form action="klausuhr.html">
Dauer in Minuten: <input id="fullmin" type="text" value="120"><br>
<input type="button" value="Setzen" id="set">
<input type="checkbox" id="autoFullscreen"> Autovollbild bei Start/Stop<br>
<input type="checkbox" id="finalFive" checked="checked"> Sekundenanzeige für letzte 5 Minuten<br>
<input type="checkbox" id="noPause" checked="checked"> Pausentasten deaktivieren<br>
<input type="button" value="OK" id="set"><br>
</form>
Starten der Uhr danach mit Leertaste, jede andere Taste wechselt
die WC-Anzeige.
<p>
Starten/Pausieren der Uhr danach mit Leertaste oder Doppelclick, jede andere Taste oder Einzelclick wechselt
die WC-Anzeige.</p>
<p>
Aktuelle Version jeweils unter: <a href="https://hu.berlin/klausuhr">hu.berlin/klausuhr</a>.<br>
Version zum Herunterladen in einer Datei <a href="https://hu.berlin/klausuhr-dl">hu.berlin/klausuhr-dl</a>.<br>
Änderungsvorschläge etc. gerne über
<a href="https://gitlab.informatik.hu-berlin.de/werkzeuge/werkzeuge/tree/master/klausuhr">das gitlab des Instituts für Informatik</a>.
</p>
</div>
</body>
</html>
#!/bin/bash
csplit klausuhrmulti.html '/.*link.*/-1' '/.*script.*/+1'
cat xx00 > klausuhr.html
echo ' <style>' >> klausuhr.html
sed -e 's/^/ /g' style.css >> klausuhr.html
echo ' </style>' >> klausuhr.html
echo ' <script>' >> klausuhr.html
sed -e 's/^/ /g' script.js >> klausuhr.html
echo ' </script>' >> klausuhr.html
cat xx02 >> klausuhr.html
rm xx0*
sed -i 's/^ $//g' klausuhr.html
......@@ -5,6 +5,32 @@ var startDate = 0;
var elapsed = 0;
var remaining = 0;
var finalFiveMin = false;
var finallNinetyNine = false;
var neverFinalFive = false;
var noPause = true;
var minute = "<span class='minsec'>'</span>";
var colon = '<span class="minsec">:</span>';
var fullscreen = function(){};
if(document.documentElement.requestFullscreen)
fullscreen = function(){document.documentElement.requestFullscreen();}
else if(document.documentElement.mozRequestFullscreen)
fullscreen = function(){document.documentElement.mozRequestFullscreen();}
else if(document.documentElement.webkitRequestFullscreen)
fullscreen = function(){document.documentElement.webkitRequestFullscreen();}
else if(document.documentElement.msRequestFullscreen)
fullscreen = function(){document.documentElement.msRequestFullscreen();};
var exitFullscreen = function(){};
if(document.exitFullscreen)
exitFullscreen = function(){document.exitFullscreen();}
else if(document.mozCancelFullScreen)
exitFullscreen = function(){document.mozCancelFullScreen();}
else if(document.webkitExitFullscreen)
exitFullscreen = function(){document.webkitExitFullscreen();}
else if(document.msExitFullscreen)
exitFullscreen = function(){document.msExitFullscreen();};
function init(){
fullOrig = document.getElementById("fullmin").value * 60;
......@@ -12,17 +38,31 @@ function init(){
remaining = full;
document.getElementById("setup").style.visibility = "hidden";
document.getElementById("time").innerHTML =
(Math.floor(remaining / 60) + "'");
(Math.floor(remaining / 60) + minute);
document.getElementById('set').blur();
if(!document.getElementById('autoFullscreen').checked){
fullscreen = function(){};
exitFullscreen = fullscreen;
}
if(!document.getElementById('finalFive').checked){
neverFinalFive = true;
}
if(!document.getElementById('noPause').checked){
noPause = true;
}
}
function toggleClock(){
if(started){
if(noPause)
return;
full = remaining;
started = false;
exitFullscreen();
} else {
startDate = Math.floor(new Date().getTime()/1000);
started = true;
fullscreen();
}
}
function toggleWC() {
......@@ -33,13 +73,16 @@ function toggleWC() {
window.onload=function(){
document.getElementById("set").onclick=init;
document.getElementById("time").ondblclick=toggleClock;
document.getElementById("time").onclick=toggleWC;
};
document.addEventListener('keydown', function(event){
if (event.key == " ")
if (event.key == " "){
toggleClock();
else
} else if (event.key != "F5" && event.key != "F11") {
toggleWC();
}
});
setInterval(function(){
......@@ -59,20 +102,26 @@ setInterval(function(){
return;
}
if (remaining < 6000 && !finallNinetyNine){
document.getElementById("time").style.fontSize = "50vw";
finallNinetyNine = true;
}
if (remaining < 300 && !finalFiveMin){
if (remaining < 300 && !neverFinalFive && !finalFiveMin){
finalFiveMin = true;
document.body.style.backgroundColor = "red";
document.getElementById("time").style.fontSize = "30vw";
document.getElementById("time").style.fontSize = "40vw";
document.getElementById("secondsmini").style.visibility = "hidden";
}
if (finalFiveMin){
document.getElementById("time").innerHTML =
(Math.floor(remaining / 60) + "'")+
(Math.floor(remaining / 60) + colon)+
((remaining % 60)<10?"0":"")+
((remaining % 60) + '"');
(remaining % 60);
} else {
document.getElementById("time").innerHTML =
(Math.floor(remaining / 60) + "'");
Math.floor(remaining / 60) + minute;
document.getElementById("secondsmini").innerHTML = remaining % 60;
}
}, 1000);
body {
background-color:black
background-color:black;
overflow:hidden;
}
#setup {
font-size:20pt;
......@@ -8,9 +9,14 @@ body {
color:black;
position: absolute;
width: 95vw;
height: 95vh;
height: 90vh;
top:2vh;
left:2vh;
padding:2vh
}
.minsec {
margin-left:-6%;
margin-right:-6%;
}
#time {
font-size:40vw;
......@@ -18,8 +24,15 @@ body {
color:white;
text-align: center;
vertical-align: center;
position: relative;
top:12vh;
margin:0px;
}
#secondsmini {
font-family: monospace;
color:white;
position: absolute;
right:1vh;
bottom:0vh;
font-size:2vw;
}
#wc {
font-size:10vh;
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment