Skip to content

Instantly share code, notes, and snippets.

@tripplyons
Created May 1, 2017 20:38
Show Gist options
  • Save tripplyons/bb5802610cf3af5bcf6a31683ffa9ef0 to your computer and use it in GitHub Desktop.
Save tripplyons/bb5802610cf3af5bcf6a31683ffa9ef0 to your computer and use it in GitHub Desktop.
Stupid Timer
<div id="card"></div>
var sound = new Audio('https://www.soundjay.com/button/beep-07.wav');
var card = document.getElementById('card');
var n = 60;
card.innerHTML = (n--).toString();
var x = setInterval(function() {
card.innerHTML = n.toString();
if(n <= 0)
sound.play();
else
n--;
}, 1000);
html, body {
background-image: linear-gradient(120deg, #f43b47 0%, #453a94 100%);
width: 100vw;
height: 100vh;
}
#card {
background-color: #f0f0f0;
width: 50vw;
height: 50vh;
top: 50%;
left: 50%;
position: absolute;
transform: translate(-50%, -50%);
border-radius: 24px;
box-shadow: 0 19px 38px rgba(0,0,0,0.30), 0 15px 12px rgba(0,0,0,0.22);
font-family: 'Roboto', sans-serif;
display:flex;justify-content:center;align-items:center;font-size:160px;
color: #808080;
}
<link href="https://fonts.googleapis.com/css?family=Roboto" rel="stylesheet" />
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment