Modern Dark Theme CoffeeScript Timer
How do I make an modern dark theme coffeescript timer?
A spin on my Retro Timer. This time, styles a bit more modern. Still the same CoffeeScript powering it. . What is a modern dark theme coffeescript timer? How do you make a modern dark theme coffeescript timer? This script and codes were developed by Joshua Michael Waggoner on 11 October 2022, Tuesday.
Modern Dark Theme CoffeeScript Timer - Script Codes HTML Codes
<!DOCTYPE html>
<html >
<head> <meta charset="UTF-8"> <title>Modern Dark Theme CoffeeScript Timer</title> <link href='https://fonts.googleapis.com/css?family=Oswald|Roboto+Condensed' rel='stylesheet' type='text/css'> <link rel="stylesheet" href="css/style.css">
</head>
<body> <div id='header'> <h1>Modern Dark Theme Timer</h1>
</div>
<div id='timer'> <div id='hours'>00</div> <div id='colon'>:</div> <div id='minutes'>00</div> <div id='colon'>:</div> <div id='seconds'>00</div> <div id='ms'>000ms</div>
</div>
<div id='buttons'> <button id='start'>Start</button> <button id='stop'>Stop</button> <button id='reset'>Reset</button>
</div> <script src='http://cdnjs.cloudflare.com/ajax/libs/jquery/2.1.3/jquery.min.js'></script> <script src="js/index.js"></script>
</body>
</html>
Modern Dark Theme CoffeeScript Timer - Script Codes CSS Codes
body { margin:30px; text-align: center; background-color: #333; color: #DDD;
}
footer { margin-top:40px; font-size: 8px;
}
button { margin: 8px; padding: 8px; background-color: #CCC; -moz-border-radius: 5px; -webkit-border-radius: 5px; border: 4px solid #AAA; padding: 5px;
}
#header { color: #F33; font-family: 'Oswald', sans-serif;
}
#hours, #minutes, #seconds, #ms, #colon { display: inline;
}
#timer { font-size: 50px;
}
#ms { font-size: 25px;
}
#start, #stop, #reset { font-size: 20px; margin-top: 20px; display: inline; width: 100px; color: #000;
}
#timer, #buttons button, #footer{ font-family: 'Roboto Condensed', sans-serif;
}
#footer { margin-top: 20px; font-size: 10px;
}
/*Blinks the timer when stopped*/
@keyframes blinker { 50% { opacity: 0.0; }
}
Modern Dark Theme CoffeeScript Timer - Script Codes JS Codes
(function() { var display, h, interval, m, ms, pauseTimer, resetTimer, runTimer, s; ms = 0; m = 0; s = 0; h = 0; interval = void 0; $('#start').click(function() { runTimer(); }); $('#stop').click(function() { pauseTimer(); }); $('#reset').click(function() { resetTimer(); }); /* * Run the timer */ runTimer = function() { $('#start').css('color', '#0D0'); $('#stop').css('color', '#000'); $('#timer').css('animation', 'none'); interval = setInterval((function() { ms += 10; if (ms === 1000) { s++; ms = 0; } if (s === 60) { m++; s = 0; } if (m === 60) { h++; m = 0; } display(); }), 10); }; /* * Pause the timer */ pauseTimer = function() { clearInterval(interval); $('#start').css('color', '#000'); $('#stop').css('color', '#F33'); $('#timer').css('animation', 'blinker 3s linear infinite'); display(); }; /* * Reset the timer */ resetTimer = function() { clearInterval(interval); ms = 0; s = 0; m = 0; h = 0; $('#start').css('color', '#000'); $('#stop').css('color', '#000'); $('#timer').css('animation', 'none'); display(); }; /* * Display the timer */ display = function() { var x; x = ms; if ((x + '').length === 2) { x = '0' + x; } if ((x + '').length === 1) { x = '00' + x; } if ((s + '').length === 1) { s = '0' + s; } if ((m + '').length === 1) { m = '0' + m; } if ((h + '').length === 1) { h = '0' + h; } $('#hours').text(h); $('#minutes').text(m); $('#seconds').text(s); $('#ms').text(x + 'ms'); };
}).call(this);
Developer | Joshua Michael Waggoner |
Username | rabbitfighter81 |
Uploaded | October 11, 2022 |
Rating | 3 |
Size | 3,257 Kb |
Views | 14,168 |
Find the perfect freelance services for your business! Fiverr's mission is to change how the world works together. Fiverr connects businesses with freelancers offering digital services in 500+ categories. Find Developer!
Name | Size |
FE ReactJS F.A.Q. Menu System | 5,920 Kb |
Running Man Sprite Demo | 4,003 Kb |
Random Dice | 3,422 Kb |
Cool menu with psychedelic circles. | 4,630 Kb |
MomentJS Clock | 2,940 Kb |
Denver Broncos Arrests Since January 1, 2000 | 11,439 Kb |
Simple Popup Window with Dark Alpha Overlay | 3,433 Kb |
CSS Media Queries Example | 6,470 Kb |
Quiz - Question4 | 2,559 Kb |
A Pen by Joshua Michael Waggoner | 4,218 Kb |
Jasper is the AI Content Generator that helps you and your team break through creative blocks to create amazing, original content 10X faster. Discover all the ways the Jasper AI Content Platform can help streamline your creative workflows. Start For Free!
Name | Username | Size |
Fullscreen Parallax | Bassta | 3,313 Kb |
Hoi hoi | JohnTheCat | 7,248 Kb |
A bit of elegance | Hackthevoid | 9,095 Kb |
Elephants Full screen site | Orrinward | 3,981 Kb |
Tester1 | Sasquatchbrawley | 2,001 Kb |
Experiment | Toddmoy | 2,849 Kb |
Isometric css island | Xaddict | 2,950 Kb |
Vanilla JS - A toggleClass function | Woodwork | 2,532 Kb |
P5.js data visualization | Enginarslan | 2,233 Kb |
Pattern lab logo | TimPietrusky | 3,666 Kb |
Surf anonymously, prevent hackers from acquiring your IP address, send anonymous email, and encrypt your Internet connection. High speed, ultra secure, and easy to use. Instant setup. Hide Your IP Now!