Skip to content

Instantly share code, notes, and snippets.

@nucliweb
Created July 11, 2014 07:50
Show Gist options
  • Save nucliweb/9fedc6b533256dce9e96 to your computer and use it in GitHub Desktop.
Save nucliweb/9fedc6b533256dce9e96 to your computer and use it in GitHub Desktop.
A Pen by Katy DeCorah.
.container
- 20.times do
.wave
// inspiration: http://imgur.com/gallery/0het78q
@import "compass/css3";
// fun to customize, guaranteed. act now.
$size: 500px; // project size
$max-w: 10em; // biggest wave
$min-w: .25em; // smallest wave
$r: $max-w - $min-w; // width range
$speed: 1500ms; // wave speed
$f: 20; // number of waves
$s-w: 0.1em; // wave width
$c: #1abc9c; // wave color
body {
background: #2c3e50;
}
.container {
position: relative;
width: $max-w;
height: $max-w / 2;
font-size: ($size / ($max-w / 1em));
overflow: hidden;
}
.wave {
border-width: $s-w;
border-style: solid;
position: absolute;
animation: wave $speed infinite alternate;
transform: rotate(-44.5deg);
$a: 1; // alpha
@for $i from 1 through $f {
&:nth-child(#{$i}) {
$w: $max-w - (($r/$f) * $i);
@if $i > 1 { $a: 1 - ((1 / ($f+1)) * $i); }
width: $w;
height: $w;
bottom: $w/-2;
left: ($max-w - $w ) / 2;
animation-delay: $i * ($speed / $f);
border-color: transparent transparent rgba($c,$a) rgba($c,$a);
border-radius: $w;
}
}
}
@keyframes wave {
to { transform: rotate(135deg); }
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment