Skip to content

Instantly share code, notes, and snippets.

@KaczkaYT
Created January 30, 2026 00:05
Show Gist options
  • Select an option

  • Save KaczkaYT/de3bb9b3f50ca919f7cc77ed1b06ec3c to your computer and use it in GitHub Desktop.

Select an option

Save KaczkaYT/de3bb9b3f50ca919f7cc77ed1b06ec3c to your computer and use it in GitHub Desktop.
<!DOCTYPE html>
<html>
<head>
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<style>
body { background: #000; color: #fff; text-align: center; font-family: sans-serif; height: 100vh; display: flex; flex-direction: column; justify-content: center; margin: 0; }
#timer { font-size: 70px; color: #00ff00; margin: 20px; }
input { background: #222; border: 2px solid #00ff00; color: #fff; padding: 10px; font-size: 20px; width: 80px; text-align: center; border-radius: 5px; }
button { background: #00ff00; color: #000; border: none; padding: 20px 40px; font-size: 22px; font-weight: bold; margin-top: 30px; border-radius: 50px; }
</style>
</head>
<body>
<div id="ui">
<h2>USTAW MINUTY (MAX 10)</h2>
<input type="number" id="m" value="1" min="1" max="10">
<br>
<button onclick="start()">UZBRÓJ I CZEKAJ</button>
</div>
<div id="running" style="display:none">
<div id="timer">00:00</div>
<p>NIE WYŁĄCZAJ EKRANU!</p>
</div>
<div id="player" style="position:absolute;top:-999px"></div>
<script src="https://www.youtube.com/iframe_api"></script>
<script>
let p;
function onYouTubeIframeAPIReady() {
p = new YT.Player('player', { height: '1', width: '1', videoId: 'FNJt8Itl9xA' });
}
function start() {
let s = document.getElementById('m').value * 60;
document.getElementById('ui').style.display = 'none';
document.getElementById('running').style.display = 'block';
const i = setInterval(() => {
s--;
let m = Math.floor(s / 60);
let sec = s % 60;
document.getElementById('timer').innerText = (m<10?'0':'')+m+':'+(sec<10?'0':'')+sec;
if (s <= 0) { clearInterval(i); p.playVideo(); }
}, 1000);
}
</script>
</body>
</html>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment