CSS3 Hourglass

Size
5,732 Kb
Views
24,288

How do I make an css3 hourglass?

CSS3 hourglass project.. What is a css3 hourglass? How do you make a css3 hourglass? This script and codes were developed by Özgür Sağıroğlu on 13 August 2022, Saturday.

CSS3 Hourglass Previews

CSS3 Hourglass - Script Codes HTML Codes

<!DOCTYPE html>
<html >
<head> <meta charset="UTF-8"> <title>CSS3 Hourglass</title> <style> /* NOTE: The styles were added inline because Prefixfree needs access to your styles and they must be inlined if they are on local disk! */ html, body, div, span, applet, object, iframe,
h1, h2, h3, h4, h5, h6, p, blockquote, pre,
a, abbr, acronym, address, big, cite, code,
del, dfn, em, img, ins, kbd, q, s, samp,
small, strike, strong, sub, sup, tt, var,
b, u, i, center,
dl, dt, dd, ol, ul, li,
fieldset, form, label, legend,
table, caption, tbody, tfoot, thead, tr, th, td,
article, aside, canvas, details, embed,
figure, figcaption, footer, header, hgroup,
menu, nav, output, ruby, section, summary,
time, mark, audio, video { margin: 0; padding: 0; border: 0; font: inherit; font-size: 100%; vertical-align: baseline;
}
html { line-height: 1;
}
ol, ul { list-style: none;
}
table { border-collapse: collapse; border-spacing: 0;
}
caption, th, td { text-align: left; font-weight: normal; vertical-align: middle;
}
q, blockquote { quotes: none;
}
q:before, q:after, blockquote:before, blockquote:after { content: ""; content: none;
}
a img { border: none;
}
article, aside, details, figcaption, figure, footer, header, hgroup, main, menu, nav, section, summary { display: block;
}
body { background: #eaeaea;
}
.hourglass-bg { position: absolute; top: 50%; left: 50%; width: 60px; height: 120px; margin: -50px 0 0 -30px;
}
.tank { height: 60px; width: 50px; background: #ffffff; position: relative; -moz-box-shadow: 0 0 10px 0px rgba(0, 0, 0, 0.05), 0 0 20px 0px rgba(0, 0, 0, 0.15) inset; -webkit-box-shadow: 0 0 10px 0px rgba(0, 0, 0, 0.05), 0 0 20px 0px rgba(0, 0, 0, 0.15) inset; box-shadow: 0 0 10px 0px rgba(0, 0, 0, 0.05), 0 0 20px 0px rgba(0, 0, 0, 0.15) inset; border: solid 1px #aaa;
}
.tank:after, .tank:before { content: ""; height: 5px; width: 60px; background-image: url('data:image/svg+xml;base64,PD94bWwgdmVyc2lvbj0iMS4wIiBlbmNvZGluZz0idXRmLTgiPz4gPHN2ZyB2ZXJzaW9uPSIxLjEiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyI+PGRlZnM+PGxpbmVhckdyYWRpZW50IGlkPSJncmFkIiBncmFkaWVudFVuaXRzPSJvYmplY3RCb3VuZGluZ0JveCIgeDE9IjAuNSIgeTE9IjAuMCIgeDI9IjAuNSIgeTI9IjEuMCI+PHN0b3Agb2Zmc2V0PSIwJSIgc3RvcC1jb2xvcj0iIzI1MjUyNSIvPjxzdG9wIG9mZnNldD0iMTAwJSIgc3RvcC1jb2xvcj0iIzE0MTQxNCIvPjwvbGluZWFyR3JhZGllbnQ+PC9kZWZzPjxyZWN0IHg9IjAiIHk9IjAiIHdpZHRoPSIxMDAlIiBoZWlnaHQ9IjEwMCUiIGZpbGw9InVybCgjZ3JhZCkiIC8+PC9zdmc+IA=='); background-size: 100%; background-image: -webkit-gradient(linear, 50% 0%, 50% 100%, color-stop(0%, #252525), color-stop(100%, #141414)); background-image: -moz-linear-gradient(#252525, #141414); background-image: -webkit-linear-gradient(#252525, #141414); background-image: linear-gradient(#252525, #141414); display: block; position: absolute; left: -5px;
}
.tank.top { -moz-border-radius: 0 0 500px 500px / 0 0 1000px 1000px; -webkit-border-radius: 0 0; border-radius: 0 0 500px 500px / 0 0 1000px 1000px;
}
.tank.top:after { display: none;
}
.tank.top:before { top: -1px;
}
.tank.top .water { top: 4px; height: 54px; -moz-border-radius: 0 0 700px 700px/0 0 1700px 1700px; -webkit-border-radius: 0; border-radius: 0 0 700px 700px/0 0 1700px 1700px; animation: topAnim 5s 1s both;
}
.tank.bottom { -moz-border-radius: 500px 500px 0 0 / 1000px 1000px 0 0; -webkit-border-radius: 500px 1000px; border-radius: 500px 500px 0 0 / 1000px 1000px 0 0;
}
.tank.bottom { margin-top: -2px;
}
.tank.bottom:before { display: none;
}
.tank.bottom:after { bottom: -1px;
}
.tank.bottom .water { bottom: 4px; -moz-border-radius: 700px 700px 0 0/1700px 1700px 0 0; -webkit-border-radius: 700px; border-radius: 700px 700px 0 0/1700px 1700px 0 0; animation: botAnim 5s 1s both;
}
.tank .water { background: #36c; width: 46px; height: 0px; position: absolute; z-index: 4; left: 2px;
}
.tunnel { width: 6px; height: 12px; background: #f3f3f3; position: absolute; top: 54px; left: 23px; z-index: 3;
}
.tunnel .wt { background: #36c; width: 3px; -moz-border-radius: 100% 0; -webkit-border-radius: 100%; border-radius: 100% 0; margin-top: 3px; animation: wt 7s 0ms both;
}
@keyframes wt { from { height: 0px; -moz-transform: translateY(0px); -ms-transform: translateY(0px); -webkit-transform: translateY(0px); transform: translateY(0px); } 25% { height: 60px; } 75% { height: 60px; -moz-transform: translateY(0px); -ms-transform: translateY(0px); -webkit-transform: translateY(0px); transform: translateY(0px); } to { height: 0px; -moz-transform: translateY(30px); -ms-transform: translateY(30px); -webkit-transform: translateY(30px); transform: translateY(30px); }
}
@keyframes botAnim { from { width: 10px; height: 0px; left: 50%; margin-left: -7px; } to { width: 48px; height: 45px; left: 1px; margin-left: 0; }
}
@keyframes topAnim { to { height: 0px; top: 58px; width: 10px; left: 50%; margin-left: -5px; }
} </style> <script src="https://cdnjs.cloudflare.com/ajax/libs/prefixfree/1.0.7/prefixfree.min.js"></script>
</head>
<body>
<section class="hourglass-bg"> <div class="tank top"> <div class="water"></div> </div> <div class="tunnel"> <div class="wt"></div> </div> <div class="tank bottom"> <div class="water"></div> </div>
</section>
</body>
</html>

CSS3 Hourglass - Script Codes CSS Codes

html, body, div, span, applet, object, iframe,
h1, h2, h3, h4, h5, h6, p, blockquote, pre,
a, abbr, acronym, address, big, cite, code,
del, dfn, em, img, ins, kbd, q, s, samp,
small, strike, strong, sub, sup, tt, var,
b, u, i, center,
dl, dt, dd, ol, ul, li,
fieldset, form, label, legend,
table, caption, tbody, tfoot, thead, tr, th, td,
article, aside, canvas, details, embed,
figure, figcaption, footer, header, hgroup,
menu, nav, output, ruby, section, summary,
time, mark, audio, video { margin: 0; padding: 0; border: 0; font: inherit; font-size: 100%; vertical-align: baseline;
}
html { line-height: 1;
}
ol, ul { list-style: none;
}
table { border-collapse: collapse; border-spacing: 0;
}
caption, th, td { text-align: left; font-weight: normal; vertical-align: middle;
}
q, blockquote { quotes: none;
}
q:before, q:after, blockquote:before, blockquote:after { content: ""; content: none;
}
a img { border: none;
}
article, aside, details, figcaption, figure, footer, header, hgroup, main, menu, nav, section, summary { display: block;
}
body { background: #eaeaea;
}
.hourglass-bg { position: absolute; top: 50%; left: 50%; width: 60px; height: 120px; margin: -50px 0 0 -30px;
}
.tank { height: 60px; width: 50px; background: #ffffff; position: relative; -moz-box-shadow: 0 0 10px 0px rgba(0, 0, 0, 0.05), 0 0 20px 0px rgba(0, 0, 0, 0.15) inset; -webkit-box-shadow: 0 0 10px 0px rgba(0, 0, 0, 0.05), 0 0 20px 0px rgba(0, 0, 0, 0.15) inset; box-shadow: 0 0 10px 0px rgba(0, 0, 0, 0.05), 0 0 20px 0px rgba(0, 0, 0, 0.15) inset; border: solid 1px #aaa;
}
.tank:after, .tank:before { content: ""; height: 5px; width: 60px; background-image: url('data:image/svg+xml;base64,PD94bWwgdmVyc2lvbj0iMS4wIiBlbmNvZGluZz0idXRmLTgiPz4gPHN2ZyB2ZXJzaW9uPSIxLjEiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyI+PGRlZnM+PGxpbmVhckdyYWRpZW50IGlkPSJncmFkIiBncmFkaWVudFVuaXRzPSJvYmplY3RCb3VuZGluZ0JveCIgeDE9IjAuNSIgeTE9IjAuMCIgeDI9IjAuNSIgeTI9IjEuMCI+PHN0b3Agb2Zmc2V0PSIwJSIgc3RvcC1jb2xvcj0iIzI1MjUyNSIvPjxzdG9wIG9mZnNldD0iMTAwJSIgc3RvcC1jb2xvcj0iIzE0MTQxNCIvPjwvbGluZWFyR3JhZGllbnQ+PC9kZWZzPjxyZWN0IHg9IjAiIHk9IjAiIHdpZHRoPSIxMDAlIiBoZWlnaHQ9IjEwMCUiIGZpbGw9InVybCgjZ3JhZCkiIC8+PC9zdmc+IA=='); background-size: 100%; background-image: -webkit-gradient(linear, 50% 0%, 50% 100%, color-stop(0%, #252525), color-stop(100%, #141414)); background-image: -moz-linear-gradient(#252525, #141414); background-image: -webkit-linear-gradient(#252525, #141414); background-image: linear-gradient(#252525, #141414); display: block; position: absolute; left: -5px;
}
.tank.top { -moz-border-radius: 0 0 500px 500px / 0 0 1000px 1000px; -webkit-border-radius: 0 0; border-radius: 0 0 500px 500px / 0 0 1000px 1000px;
}
.tank.top:after { display: none;
}
.tank.top:before { top: -1px;
}
.tank.top .water { top: 4px; height: 54px; -moz-border-radius: 0 0 700px 700px/0 0 1700px 1700px; -webkit-border-radius: 0; border-radius: 0 0 700px 700px/0 0 1700px 1700px; animation: topAnim 5s 1s both;
}
.tank.bottom { -moz-border-radius: 500px 500px 0 0 / 1000px 1000px 0 0; -webkit-border-radius: 500px 1000px; border-radius: 500px 500px 0 0 / 1000px 1000px 0 0;
}
.tank.bottom { margin-top: -2px;
}
.tank.bottom:before { display: none;
}
.tank.bottom:after { bottom: -1px;
}
.tank.bottom .water { bottom: 4px; -moz-border-radius: 700px 700px 0 0/1700px 1700px 0 0; -webkit-border-radius: 700px; border-radius: 700px 700px 0 0/1700px 1700px 0 0; animation: botAnim 5s 1s both;
}
.tank .water { background: #36c; width: 46px; height: 0px; position: absolute; z-index: 4; left: 2px;
}
.tunnel { width: 6px; height: 12px; background: #f3f3f3; position: absolute; top: 54px; left: 23px; z-index: 3;
}
.tunnel .wt { background: #36c; width: 3px; -moz-border-radius: 100% 0; -webkit-border-radius: 100%; border-radius: 100% 0; margin-top: 3px; animation: wt 7s 0ms both;
}
@keyframes wt { from { height: 0px; -moz-transform: translateY(0px); -ms-transform: translateY(0px); -webkit-transform: translateY(0px); transform: translateY(0px); } 25% { height: 60px; } 75% { height: 60px; -moz-transform: translateY(0px); -ms-transform: translateY(0px); -webkit-transform: translateY(0px); transform: translateY(0px); } to { height: 0px; -moz-transform: translateY(30px); -ms-transform: translateY(30px); -webkit-transform: translateY(30px); transform: translateY(30px); }
}
@keyframes botAnim { from { width: 10px; height: 0px; left: 50%; margin-left: -7px; } to { width: 48px; height: 45px; left: 1px; margin-left: 0; }
}
@keyframes topAnim { to { height: 0px; top: 58px; width: 10px; left: 50%; margin-left: -5px; }
}
CSS3 Hourglass - Script Codes
CSS3 Hourglass - Script Codes
Home Page Home
Developer Özgür Sağıroğlu
Username ozgursagiroglu
Uploaded August 13, 2022
Rating 3.5
Size 5,732 Kb
Views 24,288
Do you need developer help for CSS3 Hourglass?

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!

Özgür Sağıroğlu (ozgursagiroglu) Script Codes
Create amazing captions with AI!

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!