Skip to content

Instantly share code, notes, and snippets.

@uriuriuriu
Created June 30, 2014 11:20
Show Gist options
  • Select an option

  • Save uriuriuriu/26e307d449f31f6d755e to your computer and use it in GitHub Desktop.

Select an option

Save uriuriuriu/26e307d449f31f6d755e to your computer and use it in GitHub Desktop.
A Pen by uriuriuriu.
<section>
<div class="circle anim-symbol-scale">scale</div>
<div class="circle anim-symbol-rotate">rotate</div>
<div class="circle anim-symbol-scale"><div class="anim-symbol-rotate">S&R</div></div>
</section>
@import "compass/css3";
// mixin
@mixin anims($animation_setting) {
-o-animation: #{$animation_setting};
-ms-animation: #{$animation_setting};
-moz-animation: #{$animation_setting};
-webkit-animation: #{$animation_setting};
}
@mixin keyframes($animation-name) {
@-webkit-keyframes $animation-name {@content;}
@-moz-keyframes $animation-name {@content;}
@keyframes $animation-name {@content;}
}
// usage
@import "compass/css3/transform";
.anim-symbol-scale {
@include anims(anim-scale 0.5s ease-out infinite);
}
.anim-symbol-rotate {
@include anims(anim-rotate 0.5s ease-out infinite);
}
@include keyframes(anim-scale) {
0% {@include transform(scale(0.4));}
40% {@include transform(scale(1.2));}
60% {@include transform(scale(1.0));}
80% {@include transform(scale(1.1));}
100% {@include transform(scale(1.0));}
}
@include keyframes(anim-rotate) {
0% {@include transform(rotate( 0deg));}
10% {@include transform(rotate(-6deg));}
20% {@include transform(rotate( 7deg));}
35% {@include transform(rotate(-3deg));}
50% {@include transform(rotate( 3deg));}
65% {@include transform(rotate(-1deg));}
80% {@include transform(rotate( 1deg));}
95% {@include transform(rotate( 0deg));}
100% {@include transform(rotate( 0deg));}
}
//design setting
$theme_color:#d35400;
body {background-color:$theme_color;}
section {
display:table;
margin:0 auto;
}
.circle {
display: inline-block;
background-color:transparent;
width:100px;
height:100px;
margin:80px 30px;
@include border-radius(60px, 60px);
border:solid 10px #ffffff;
border-right:double 10px;
border-left: double 10px;
line-height:100px;
font-size:30px;
font-weight:bold;
color:#ffffff;
text-align:center;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment