4 Element CSS Clock
How do I make an 4 element css clock?
Using the single element number flippers, I just put a few together and update their values with some javascript. . What is a 4 element css clock? How do you make a 4 element css clock? This script and codes were developed by Roman Diaz on 23 July 2022, Saturday.
4 Element CSS Clock - Script Codes HTML Codes
<!DOCTYPE html>
<html >
<head> <meta charset="UTF-8"> <title>4 Element CSS Clock</title> <link rel="stylesheet" href="css/style.css">
</head>
<body> <clock> <number id="hours">12</number> <number id="minutes">45</number> <number id="ampm">AM</number>
</clock> <script src='http://cdnjs.cloudflare.com/ajax/libs/jquery/2.1.3/jquery.min.js'></script> <script src="js/index.js"></script>
</body>
</html>
4 Element CSS Clock - Script Codes CSS Codes
@import url(http://fonts.googleapis.com/css?family=Doppio+One);
body { text-align: center; font-family: 'Doppio One', sans-serif; background: url(https://dl.dropbox.com/u/47224881/Demo/wood-tile-background.jpg) center center;
}
clock { position: relative; display: inline-block; padding: 1em 1em 1.5em 1em; -webkit-box-shadow: inset 0 0 1em black; -moz-box-shadow: inset 0 0 1em black; box-shadow: inset 0 0 1em black; -webkit-border-radius: 10px; -moz-border-radius: 10px; border-radius: 10px; margin: 3em; background: #000000; /* Old browsers */ /* IE9 SVG, needs conditional override of 'filter' to 'none' */ background: url(data:image/svg+xml;base64,PD94bWwgdmVyc2lvbj0iMS4wIiA/Pgo8c3ZnIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyIgd2lkdGg9IjEwMCUiIGhlaWdodD0iMTAwJSIgdmlld0JveD0iMCAwIDEgMSIgcHJlc2VydmVBc3BlY3RSYXRpbz0ibm9uZSI+CiAgPGxpbmVhckdyYWRpZW50IGlkPSJncmFkLXVjZ2ctZ2VuZXJhdGVkIiBncmFkaWVudFVuaXRzPSJ1c2VyU3BhY2VPblVzZSIgeDE9IjAlIiB5MT0iMCUiIHgyPSIwJSIgeTI9IjEwMCUiPgogICAgPHN0b3Agb2Zmc2V0PSIwJSIgc3RvcC1jb2xvcj0iIzAwMDAwMCIgc3RvcC1vcGFjaXR5PSIxIi8+CiAgICA8c3RvcCBvZmZzZXQ9IjIwJSIgc3RvcC1jb2xvcj0iIzI3MjgyYiIgc3RvcC1vcGFjaXR5PSIxIi8+CiAgICA8c3RvcCBvZmZzZXQ9IjEwMCUiIHN0b3AtY29sb3I9IiMwYzBjMGMiIHN0b3Atb3BhY2l0eT0iMSIvPgogIDwvbGluZWFyR3JhZGllbnQ+CiAgPHJlY3QgeD0iMCIgeT0iMCIgd2lkdGg9IjEiIGhlaWdodD0iMSIgZmlsbD0idXJsKCNncmFkLXVjZ2ctZ2VuZXJhdGVkKSIgLz4KPC9zdmc+); background: -moz-linear-gradient(top, #000000 0%, #27282b 20%, #0c0c0c 100%); /* FF3.6+ */ background: -webkit-gradient(linear, left top, left bottom, color-stop(0%, #000000), color-stop(20%, #27282b), color-stop(100%, #0c0c0c)); /* Chrome,Safari4+ */ background: -webkit-linear-gradient(top, #000000 0%, #27282b 20%, #0c0c0c 100%); /* Chrome10+,Safari5.1+ */ background: -o-linear-gradient(top, #000000 0%, #27282b 20%, #0c0c0c 100%); /* Opera 11.10+ */ background: -ms-linear-gradient(top, #000000 0%, #27282b 20%, #0c0c0c 100%); /* IE10+ */ background: linear-gradient(to bottom, #000000 0%, #27282b 20%, #0c0c0c 100%); /* W3C */ filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#000000', endColorstr='#0c0c0c', GradientType=0); /* IE6-8 */
}
clock:after { content: ""; position: absolute; top: 0; bottom: 0; left: 0; right: 0; -webkit-border-radius: 10px; -moz-border-radius: 10px; border-radius: 10px; box-shadow: 0 1px 1px rgba(255, 255, 255, 0.5), 0 0 0 5px red, 0 -6px 1px rgba(255, 255, 255, 0.5), 0 0 0 7px black;
}
clock:before { content: "CASIO"; letter-spacing: .2em; color: rgba(255, 255, 255, 0.25); position: absolute; display: block; background: darkred; width: 70%; font-size: 12px; height: 1.5em; bottom: -2em; margin: 0 10%; z-index: -1; border-bottom: 1px solid black; -webkit-border-radius: 0 0 3px 3px; -moz-border-radius: 0 0 3px 3px; border-radius: 0 0 3px 3px; -webkit-box-shadow: inset 0 7px 8px rgba(0, 0, 0, 0.75); -moz-box-shadow: inset 0 7px 8px rgba(0, 0, 0, 0.75); box-shadow: inset 0 7px 8px rgba(0, 0, 0, 0.75);
}
number { border-top: 1px solid rgba(255, 255, 255, 0.5); color: white; text-align: center; text-shadow: -1px -1px 0 black; font-size: 65px; line-height: 100px; position: relative; display: inline-block; margin: 5px; -webkit-border-radius: 5px; -moz-border-radius: 5px; border-radius: 5px; background: grey; width: 110px; height: 100px; -webkit-box-shadow: 0 1px 0 black,0 3px 0 grey,0 4px 0 black,0 6px 0 grey,0 7px 0 black,0 2px 5px black; -moz-box-shadow: 0 1px 0 black,0 3px 0 grey,0 4px 0 black,0 6px 0 grey,0 7px 0 black,0 2px 5px black; box-shadow: 0 1px 0 black,0 3px 0 grey,0 4px 0 black,0 6px 0 grey,0 7px 0 black,0 2px 5px black; background: #4c4c4c; /* Old browsers */ /* IE9 SVG, needs conditional override of 'filter' to 'none' */ background: url(data:image/svg+xml;base64,PD94bWwgdmVyc2lvbj0iMS4wIiA/Pgo8c3ZnIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyIgd2lkdGg9IjEwMCUiIGhlaWdodD0iMTAwJSIgdmlld0JveD0iMCAwIDEgMSIgcHJlc2VydmVBc3BlY3RSYXRpbz0ibm9uZSI+CiAgPGxpbmVhckdyYWRpZW50IGlkPSJncmFkLXVjZ2ctZ2VuZXJhdGVkIiBncmFkaWVudFVuaXRzPSJ1c2VyU3BhY2VPblVzZSIgeDE9IjAlIiB5MT0iMCUiIHgyPSIwJSIgeTI9IjEwMCUiPgogICAgPHN0b3Agb2Zmc2V0PSIwJSIgc3RvcC1jb2xvcj0iIzRjNGM0YyIgc3RvcC1vcGFjaXR5PSIxIi8+CiAgICA8c3RvcCBvZmZzZXQ9IjEyJSIgc3RvcC1jb2xvcj0iIzU5NTk1OSIgc3RvcC1vcGFjaXR5PSIxIi8+CiAgICA8c3RvcCBvZmZzZXQ9IjI1JSIgc3RvcC1jb2xvcj0iIzY2NjY2NiIgc3RvcC1vcGFjaXR5PSIxIi8+CiAgICA8c3RvcCBvZmZzZXQ9IjM5JSIgc3RvcC1jb2xvcj0iIzQ3NDc0NyIgc3RvcC1vcGFjaXR5PSIxIi8+CiAgICA8c3RvcCBvZmZzZXQ9IjUwJSIgc3RvcC1jb2xvcj0iIzJjMmMyYyIgc3RvcC1vcGFjaXR5PSIxIi8+CiAgICA8c3RvcCBvZmZzZXQ9IjUxJSIgc3RvcC1jb2xvcj0iIzAwMDAwMCIgc3RvcC1vcGFjaXR5PSIxIi8+CiAgICA8c3RvcCBvZmZzZXQ9IjYwJSIgc3RvcC1jb2xvcj0iIzExMTExMSIgc3RvcC1vcGFjaXR5PSIxIi8+CiAgICA8c3RvcCBvZmZzZXQ9Ijc2JSIgc3RvcC1jb2xvcj0iIzJiMmIyYiIgc3RvcC1vcGFjaXR5PSIxIi8+CiAgICA8c3RvcCBvZmZzZXQ9IjkxJSIgc3RvcC1jb2xvcj0iIzFjMWMxYyIgc3RvcC1vcGFjaXR5PSIxIi8+CiAgICA8c3RvcCBvZmZzZXQ9IjEwMCUiIHN0b3AtY29sb3I9IiMxMzEzMTMiIHN0b3Atb3BhY2l0eT0iMSIvPgogIDwvbGluZWFyR3JhZGllbnQ+CiAgPHJlY3QgeD0iMCIgeT0iMCIgd2lkdGg9IjEiIGhlaWdodD0iMSIgZmlsbD0idXJsKCNncmFkLXVjZ2ctZ2VuZXJhdGVkKSIgLz4KPC9zdmc+); background: -moz-linear-gradient(top, #4c4c4c 0%, #595959 12%, #666666 25%, #474747 39%, #2c2c2c 50%, #000000 51%, #111111 60%, #2b2b2b 76%, #1c1c1c 91%, #131313 100%); /* FF3.6+ */ background: -webkit-gradient(linear, left top, left bottom, color-stop(0%, #4c4c4c), color-stop(12%, #595959), color-stop(25%, #666666), color-stop(39%, #474747), color-stop(50%, #2c2c2c), color-stop(51%, #000000), color-stop(60%, #111111), color-stop(76%, #2b2b2b), color-stop(91%, #1c1c1c), color-stop(100%, #131313)); /* Chrome,Safari4+ */ background: -webkit-linear-gradient(top, #4c4c4c 0%, #595959 12%, #666666 25%, #474747 39%, #2c2c2c 50%, #000000 51%, #111111 60%, #2b2b2b 76%, #1c1c1c 91%, #131313 100%); /* Chrome10+,Safari5.1+ */ background: -o-linear-gradient(top, #4c4c4c 0%, #595959 12%, #666666 25%, #474747 39%, #2c2c2c 50%, #000000 51%, #111111 60%, #2b2b2b 76%, #1c1c1c 91%, #131313 100%); /* Opera 11.10+ */ background: -ms-linear-gradient(top, #4c4c4c 0%, #595959 12%, #666666 25%, #474747 39%, #2c2c2c 50%, #000000 51%, #111111 60%, #2b2b2b 76%, #1c1c1c 91%, #131313 100%); /* IE10+ */ background: linear-gradient(to bottom, #4c4c4c 0%, #595959 12%, #666666 25%, #474747 39%, #2c2c2c 50%, #000000 51%, #111111 60%, #2b2b2b 76%, #1c1c1c 91%, #131313 100%); /* W3C */ filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#4c4c4c', endColorstr='#131313', GradientType=0); /* IE6-8 */
}
number:before { content: ""; border-left: 4px solid lightgrey; border-right: 4px solid lightgrey; width: 100%; top: 50%; margin-top: -4px; left: -4px; -webkit-border-radius: 2px; -moz-border-radius: 2px; border-radius: 2px; position: absolute; height: 10px;
}
number:after { content: ""; height: 0; width: 100%; position: absolute; top: 50%; left: 0; border-top: 1px solid black; border-bottom: 1px solid rgba(255, 255, 255, 0.35);
}
4 Element CSS Clock - Script Codes JS Codes
var ampm = "AM";
function parseHour(hour){ if (hour>11){ hour=hour-12; ampm="PM" } if(hour==0){ hour=12; } hour = (hour < 10 ? '0' : '') + hour; return hour
}
function parseSecond(secs){ secs = (secs < 10 ? '0' : '') + secs; return secs;
}
function setup(){ var todayDate=new Date(); $("#hours").text(parseHour(todayDate.getHours())); $("#minutes").text(parseSecond(todayDate.getMinutes())); $("#ampm").text(ampm);
}
setInterval(function(){ setup();
}, 30000);
setup();
Developer | Roman Diaz |
Username | romandiaz |
Uploaded | July 23, 2022 |
Rating | 3 |
Size | 5,695 Kb |
Views | 36,432 |
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 |
A Pen by Roman Diaz | 2,267 Kb |
Basic Usage | 3,310 Kb |
Obligatory CSS3 UI Nav | 9,017 Kb |
A Pen by Roman Diaz | 2,874 Kb |
Snazzy glass buttons | 3,910 Kb |
The Creation of Adam - Pure CSS | 145,130 Kb |
Browser window | 4,200 Kb |
The Creation of Adam - Pure CSS | 243,196 Kb |
CSS full size background | 1,572 Kb |
Pure CSS tooltips | 2,273 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 |
A Pen by Patrick Cox | Pcridesagain | 2,899 Kb |
Promodoro | Bencarp | 1,712 Kb |
Guidepopup | Wooljs | 3,747 Kb |
Ionic - Wordpress REST API starter | Superpikar | 2,961 Kb |
Canvas stripes | Adrianparr | 1,948 Kb |
Zip Button test | Lje7462 | 1,932 Kb |
Pruebas de d3.js | Juanmanuelcarnerero | 2,485 Kb |
Realistic Buttons | Stoypenny | 2,248 Kb |
Simple Login Form Template | Banunn | 3,571 Kb |
TweetBox with React JS | J0zelito | 3,325 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!