move public files to public folder

This commit is contained in:
bence committed 2023-07-02 15:02:55 +02:00
1 parent d1d384bce8
commit 6af3422928
6 files changed

No files matched your search

+71
View File
@@ -0,0 +1,71 @@
* {
margin: 0;
padding: 0;
border: 0;
font-size: 100%;
vertical-align: baseline;
}
body {
background-color: #eee;
font-family: 'Oxygen', sans-serif;
}
main {
display: block;
background-color: #fff;
border-radius: 15px;
width: 600px;
margin: 50px auto;
padding: 25px 25px 25px;
text-align: center;
}
a:link, a:visited {
color: #38488f;
text-decoration: none;
}
h1 {
font-size: 35px;
font-weight: normal;
}
p {
margin-top: 12px;
font-size: 15px;
line-height: 125%;
}
p.date {
font-size: 30px;
font-weight: bold;
}
p.time {
font-family: 'Cousine', monospace;;
font-size: 50px;
font-weight: bold;
}
span.correct {
font-weight: bold;
}
hr {
background-color: #ccc;
height: 3px;
margin: 20px 0;
}
@media (max-width: 700px) {
body {
background-color: #fff;
}
main {
border-radius: 0;
width: auto;
margin: 0 auto;
padding: 10px 10px 10px;
}
}
+75
View File
@@ -0,0 +1,75 @@
(function () {
var _MONTHS_ = ['január', 'február', 'március', 'április', 'május', 'június', 'július', 'augusztus', 'szeptember', 'október', 'november', 'december'];
var _DAYS_ = ['vasárnap', 'hétfő', 'kedd', 'szerda', 'csütörtök', 'péntek', 'szombat'];
var syncTimeout;
var clockTimeout;
var correct = 0;
function getSyncedDateTime() {
return new Date(new Date().getTime() - correct);
}
function fillZero(param) {
return param < 10 ? '0' + String(param) : String(param);
}
function sync() {
clearTimeout(syncTimeout);
var started;
var latency;
var syncRequest = new XMLHttpRequest();
syncRequest.onreadystatechange = function () {
switch (syncRequest.readyState) {
case XMLHttpRequest.OPENED:
started = new Date().getTime();
break;
case XMLHttpRequest.HEADERS_RECEIVED:
latency = (new Date().getTime() - started) / 2;
break;
case XMLHttpRequest.DONE:
correct = new Date().getTime() - (parseInt(syncRequest.responseText) + latency);
syncTimeout = setTimeout(sync, 10000);
break;
}
}
syncRequest.open('GET', 'getTime.php', true);
syncRequest.send();
}
function clock() {
var dateTime = getSyncedDateTime();
document.getElementById('year').innerHTML = dateTime.getFullYear();
document.getElementById('month').innerHTML = _MONTHS_[dateTime.getMonth()];
document.getElementById('date').innerHTML = dateTime.getDate();
document.getElementById('day').innerHTML = _DAYS_[dateTime.getDay()];
document.getElementById('time').innerHTML = fillZero(dateTime.getHours()) + ':' + fillZero(dateTime.getMinutes()) + ':' + fillZero(dateTime.getSeconds());
if (Math.abs(correct) < 100) {
document.getElementById('correct').style.display = 'none';
} else {
document.getElementById('correct').style.display = 'block';
document.getElementById('correct_seconds').innerHTML = (correct > 0 ? '+' : '') + (correct / 1000).toFixed(1);
}
clockTimeout = setTimeout(clock, 100);
}
document.getElementsByTagName('main')[0].ondblclick = function () {
sync();
}
clock();
sync();
})();
Binary file not shown.

After

Width:  |  Height:  |  Size: 383 B