Toggle navigation
Bootsnipp
Bootstrap
For
CSS Frameworks
Bootstrap
Foundation
Semantic UI
Materialize
Pure
Bulma
References
CSS Reference
Tools
Community
Page Builder
Form Builder
Button Builder
Icon Search
Dan's Tools
Diff / Merge
Color Picker
Keyword Tool
Web Fonts
.htaccess Generator
Favicon Generator
Site Speed Test
Snippets
Featured
Tags
By Bootstrap Version
4.1.1
4.0.0
3.3.0
3.2.0
3.1.0
3.0.3
3.0.1
3.0.0
2.3.2
Register
Login
"Clock"
Bootstrap 4.1.1 Snippet by
Milind_Kamthe
4.1.1
Preview
HTML
CSS
JS
View Full Screen
Fork
Fork this
897
 
0 Fav
Post to Facebook
Tweet this
<link href="//maxcdn.bootstrapcdn.com/bootstrap/4.1.1/css/bootstrap.min.css" rel="stylesheet" id="bootstrap-css"> <script src="//maxcdn.bootstrapcdn.com/bootstrap/4.1.1/js/bootstrap.min.js"></script> <script src="//cdnjs.cloudflare.com/ajax/libs/jquery/3.2.1/jquery.min.js"></script> <!------ Include the above in your HEAD tag ----------> <div class="container"> <div class="row" style="text-align:center;color:#fff"> <h2 style="text-align:center;color:#fff;width:100%">Minutes Remaining</h2> </div> </div> <!DOCTYPE html> <html> <head> <title>clock</title> <link rel="preconnect" href="https://fonts.googleapis.com"> <link rel="preconnect" href="https://fonts.gstatic.com" crossorigin> <link href="https://fonts.googleapis.com/css2?family=Monoton&display=swap" rel="stylesheet"> <style> </style> </head> <body> <div id="MyClockDisplay" class="clock" onload="showTime()"></div> <div id="clock"> <span id="seconds">180 Min.</span> </div> <script> function showTime(){ var date = new Date(); var h = date.getHours(); // 0 - 23 var m = date.getMinutes(); // 0 - 59 var s = date.getSeconds(); // 0 - 59 var session = "AM"; if(h == 0){ h = 12; } if(h > 12){ h = h - 12; session = "PM"; } h = (h < 10) ? "0" + h : h; m = (m < 10) ? "0" + m : m; s = (s < 10) ? "0" + s : s; var time = h + ":" + m + ":" + s + " " + session; document.getElementById("MyClockDisplay").innerText = time; document.getElementById("MyClockDisplay").textContent = time; setTimeout(showTime, 1000); } showTime(); </script> <script type="text/javascript"> timeLeft = 228; function countdown() { timeLeft--; document.getElementById("seconds").innerHTML = String( timeLeft ); if (timeLeft > 0) { setTimeout(countdown,60000); } }; setTimeout(countdown, 0); </script> </body> <html>
body { background-image: radial-gradient( circle 610px at 5.2% 51.6%, rgba(5,8,114,1) 0%, rgba(7,3,53,1) 97.5% ); } .clock { position: absolute; top: 60%; left: 50%; transform: translateX(-50%) translateY(-50%); color: #fff; font-size: 25px; letter-spacing:0px;box-shadow:0 0 5px #000,inset 0 0 5px #000;padding:10px;border: 2px solid #fff;border-radius:7px;background:green;text-shadow: 2px 2px 2px #000;} #clock { width: auto; height: 70px; border-radius: 0; background-color: lightgrey; margin: auto; } span { display: block; width: 100%; margin: auto; padding-top: 0; text-align: center; font-size: 60px; }
timeLeft = 228; function countdown() { timeLeft--; document.getElementById("seconds").innerHTML = String( timeLeft ); if (timeLeft > 0) { setTimeout(countdown,60000); } }; setTimeout(countdown, 0);
Related:
See More
Free Template
Light Bootstrap Dashboard React
Questions / Comments:
Post
Posting Guidelines
Formatting
- Now
×
Close
Donate
BTC: 12JxYMYi6Vt3mx3hcmP3B2oyFiCSF3FhYT
ETH: 0xCD715b2E3549c54A40e6ecAaFeB82138148a6c76