Skip to content

Instantly share code, notes, and snippets.

@bennpearson
Last active January 27, 2018 18:56
Show Gist options
  • Save bennpearson/730512b12a5de34455aae4969d97854c to your computer and use it in GitHub Desktop.
Save bennpearson/730512b12a5de34455aae4969d97854c to your computer and use it in GitHub Desktop.
Wave 4 - css
<!DOCTYPE html>
<html lang="en" >
<head>
<meta charset="UTF-8">
<title>Waves</title>
<style>
html, body {
height: 100%;
}
html {
background: #eee;
}
body {
display: -webkit-box;
display: -ms-flexbox;
display: flex;
-webkit-box-pack: center;
-ms-flex-pack: center;
justify-content: center;
-webkit-box-align: center;
-ms-flex-align: center;
align-items: center;
}
.box {
width: 300px;
height: 300px;
border-radius: 5px;
-webkit-box-shadow: 0 2px 30px rgba(0, 0, 0, 0.2);
box-shadow: 0 2px 30px rgba(0, 0, 0, 0.2);
background: #fff;
position: relative;
overflow: hidden;
-webkit-transform: translate3d(0, 0, 0);
transform: translate3d(0, 0, 0);
}
.wave {
opacity: .4;
position: absolute;
top: 100%;
left: 50%;
background: #0af;
width: 500px;
height: 500px;
margin-left: -250px;
margin-top: -250px;
-webkit-transform-origin: 50% 48%;
transform-origin: 50% 48%;
border-radius: 43%;
-webkit-animation: drift 3000ms infinite linear;
animation: drift 3000ms infinite linear;
}
.wave.-three {
-webkit-animation: drift 5000ms infinite linear;
animation: drift 5000ms infinite linear;
}
.wave.-two {
-webkit-animation: drift 7000ms infinite linear;
animation: drift 7000ms infinite linear;
opacity: .1;
background: yellow;
}
.box:after {
content: '';
display: block;
left: 0;
top: 0;
width: 100%;
height: 100%;
z-index: 11;
-webkit-transform: translate3d(0, 0, 0);
transform: translate3d(0, 0, 0);
}
.title {
position: absolute;
left: 0;
top: 0;
width: 100%;
z-index: 1;
line-height: 300px;
text-align: center;
-webkit-transform: translate3d(0, 0, 0);
transform: translate3d(0, 0, 0);
color: white;
text-transform: uppercase;
font-family: arial, serif;
letter-spacing: .4em;
font-size: 20px;
text-shadow: 0 1px 0 rgba(0, 0, 0, 0.1);
text-indent: .3em;
}
@-webkit-keyframes drift {
from {
-webkit-transform: rotate(0deg);
transform: rotate(0deg);
}
from {
-webkit-transform: rotate(360deg);
transform: rotate(360deg);
}
}
@keyframes drift {
from {
-webkit-transform: rotate(0deg);
transform: rotate(0deg);
}
from {
-webkit-transform: rotate(360deg);
transform: rotate(360deg);
}
}
</style>
</head>
<body>
<div class='box'>
<div class='wave -one'></div>
<div class='wave -two'></div>
<div class='wave -three'></div>
<div class='title'>Go surfing</div>
</div>
</body>
</html>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment