-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathindex.html
More file actions
147 lines (129 loc) · 5.88 KB
/
index.html
File metadata and controls
147 lines (129 loc) · 5.88 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
<!doctype html>
<html lang="hu">
<head>
<meta charset="utf-8" />
<meta name="viewport" content="width=device-width,initial-scale=1" />
<title>Visszaszámláló — 2026.12.31</title>
<style>
:root{--bg:#0f1720;--card:#0b1220;--accent:#7dd3fc;--muted:#94a3b8}
html,body{height:100%;margin:0;font-family:Inter,ui-sans-serif,system-ui,Segoe UI,Roboto,'Helvetica Neue',Arial}
body{display:grid;place-items:center;background:linear-gradient(180deg,#071029 0%,#071018 60%);color:white;padding:24px}
.card{background:linear-gradient(180deg,rgba(255,255,255,0.02),rgba(0,0,0,0.05));padding:28px;border-radius:12px;box-shadow:0 10px 30px rgba(2,6,23,0.6);max-width:820px;width:100%}
h1{margin:0 0 6px 0;font-size:20px}
p.lead{margin:0 0 14px 0;color:var(--muted)}
.grid{display:grid;grid-template-columns:repeat(4,1fr);gap:12px;margin-top:18px}
.tile{background:rgba(255,255,255,0.02);padding:16px;border-radius:10px;text-align:center}
.num{font-size:28px;font-weight:700;color:var(--accent)}
.label{font-size:12px;color:var(--muted);margin-top:6px}
.meta{display:flex;gap:10px;margin-top:16px;flex-wrap:wrap}
.meta div{background:rgba(255,255,255,0.02);padding:8px 10px;border-radius:8px;font-size:13px;color:var(--muted)}
footer{margin-top:18px;color:var(--muted);font-size:13px}
.small{font-size:12px;color:var(--muted)}
@media (max-width:640px){.grid{grid-template-columns:repeat(2,1fr)}}
</style>
</head>
<body>
<div class="card">
<h1>Visszaszámláló <span class="small">(2026.12.31 23:59:59 helyi idő)</span></h1>
<p class="lead">Másodpercre pontos visszaszámlálás, a hátralévő napok, sprint(2 hét), munkanapok és negyedévek számával.</p>
<div id="countdown" aria-live="polite">
<div class="grid">
<div class="tile">
<div class="num" id="days">—</div>
<div class="label">Nap</div>
</div>
<div class="tile">
<div class="num" id="hours">—</div>
<div class="label">Óra</div>
</div>
<div class="tile">
<div class="num" id="minutes">—</div>
<div class="label">Perc</div>
</div>
<div class="tile">
<div class="num" id="seconds">—</div>
<div class="label">Másodperc</div>
</div>
</div>
<div class="meta">
<div>Hátralévő teljes napok: <strong id="fullDays">—</strong></div>
<div>Hátralévő munkanapok (hétfő–péntek): <strong id="workdays">—</strong></div>
<div>Hátralévő sprint(14 nap): <strong id="sprints">—</strong></div>
<div>Hátralévő negyedévek: <strong id="quarters">—</strong></div>
<div>Végső dátum: <strong>2026-12-31 23:59:59</strong></div>
</div>
<footer>
<div>Megjegyzés: a visszaszámlálás a böngésződ helyi idejét használja (felhasználói időzóna). A sprint hossza alapértelmezés szerint 14 nap — módosítható a <code>SPRINT_DAYS</code> változóban. A munkanap-számítás csak hétfőtől péntekig számol, munkaszüneti napok nélkül.</div>
</footer>
</div>
</div>
<script>
// Cél: 2026-12-31 23:59:59 a felhasználó helyi időzónájában
const TARGET = new Date(2026, 11, 31, 23, 59, 59); // hónap: 0=jan ... 11=dec
const SPRINT_DAYS = 14; // ha más sprinthosszt szeretnél, itt állítsd át
const $days = document.getElementById('days');
const $hours = document.getElementById('hours');
const $minutes = document.getElementById('minutes');
const $seconds = document.getElementById('seconds');
const $fullDays = document.getElementById('fullDays');
const $workdays = document.getElementById('workdays');
const $sprints = document.getElementById('sprints');
const $quarters = document.getElementById('quarters');
function pad(n){return String(n).padStart(2,'0')}
function calc() {
const now = new Date();
let diffMs = TARGET.getTime() - now.getTime();
if (diffMs < 0) diffMs = 0; // lejárt esetén nulla
const totalSeconds = Math.floor(diffMs/1000);
const days = Math.floor(totalSeconds / (24*3600));
const hours = Math.floor((totalSeconds % (24*3600)) / 3600);
const minutes = Math.floor((totalSeconds % 3600) / 60);
const seconds = totalSeconds % 60;
$days.textContent = days;
$hours.textContent = pad(hours);
$minutes.textContent = pad(minutes);
$seconds.textContent = pad(seconds);
$fullDays.textContent = days;
const sprintSeconds = SPRINT_DAYS * 24 * 3600;
const sprintsRemaining = Math.ceil((totalSeconds) / sprintSeconds);
$sprints.textContent = sprintsRemaining;
function addMonths(date, m){
const d = new Date(date.getTime());
d.setMonth(d.getMonth() + m);
return d;
}
const nowQuarterStart = new Date(now.getFullYear(), Math.floor(now.getMonth()/3)*3, 1);
let qStart = new Date(nowQuarterStart.getTime());
let quarters = 0;
while (qStart <= TARGET) {
const qEnd = addMonths(qStart, 3);
if (qEnd.getTime() > now.getTime() && qStart.getTime() <= TARGET.getTime()) {
quarters++;
}
qStart = addMonths(qStart, 3);
if (quarters > 1000) break;
}
$quarters.textContent = quarters;
// munkanapok (hétfő–péntek)
let wd = 0;
const iter = new Date(now.getFullYear(), now.getMonth(), now.getDate());
while (iter <= TARGET) {
const day = iter.getDay(); // 0=vasárnap, 1=hétfő, ... 6=szombat
if (day >= 1 && day <= 5) wd++;
iter.setDate(iter.getDate() + 1);
}
$workdays.textContent = wd;
}
function start() {
calc();
const now = new Date();
const msToNextSecond = 1000 - now.getMilliseconds();
setTimeout(() => {
calc();
setInterval(calc, 1000);
}, msToNextSecond);
}
start();
</script>
</body>
</html>