A Pen by Tripp Lyons on CodePen.
Created
May 1, 2017 20:38
-
-
Save tripplyons/bb5802610cf3af5bcf6a31683ffa9ef0 to your computer and use it in GitHub Desktop.
Stupid Timer
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<div id="card"></div> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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; | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<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