Skip to content

Commit

Permalink
Add an animation to the profile image
Browse files Browse the repository at this point in the history
  • Loading branch information
roperzh committed Aug 9, 2014
1 parent 6a60a67 commit 757d9cf
Show file tree
Hide file tree
Showing 3 changed files with 28 additions and 0 deletions.
22 changes: 22 additions & 0 deletions source/sass/_animations.scss
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
// -------------------------------------------
// CSS animations
// -------------------------------------------

.animated {
-webkit-animation-duration: .3s;
animation-duration: .3s;
-webkit-animation-fill-mode: both;
animation-fill-mode: both;
}

/* Shake animation */
@-webkit-keyframes shake {
0%, 100% {-webkit-transform: translateX(0);}
10%, 30%, 50%, 70%, 90% {-webkit-transform: translateX(-1px);}
20%, 40%, 60%, 80% {-webkit-transform: translateX(1px);}
}
@keyframes shake {
0%, 100% {transform: translateX(0);}
10%, 30%, 50%, 70%, 90% {transform: translateX(-1px);}
20%, 40%, 60%, 80% {transform: translateX(1px);}
}
5 changes: 5 additions & 0 deletions source/sass/_modules.scss
Original file line number Diff line number Diff line change
Expand Up @@ -88,4 +88,9 @@
border-radius: 50%;
width: 80px;
height: auto;

&:hover {
-webkit-animation-name: shake;
animation-name: shake;
}
}
1 change: 1 addition & 0 deletions source/sass/application.scss
Original file line number Diff line number Diff line change
Expand Up @@ -9,3 +9,4 @@
@import "mixins";
@import "layouts";
@import "modules";
@import "animations";

0 comments on commit 757d9cf

Please sign in to comment.