Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Added Hover Icon: icon-fade-away, transitions scale: 1x -> 2x #60

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
59 changes: 59 additions & 0 deletions css/hover.css
Original file line number Diff line number Diff line change
Expand Up @@ -3526,6 +3526,65 @@
color: #0F9E5E;
}

/* Icon Fade Away */
@-webkit-keyframes hvr-icon-fade-away {
0% {
opacity: 1;
}

100% {
opacity: 0;
-webkit-transform: scale(2);
transform: scale(2);
}
}

@keyframes hvr-icon-fade-away {
0% {
opacity: 1;
}

100% {
opacity: 0;
-webkit-transform: scale(2);
transform: scale(2);
}
}

/* Icon Fade Away */
.hvr-icon-fade-away {
display: inline-block;
vertical-align: middle;
-webkit-transform: translateZ(0);
transform: translateZ(0);
box-shadow: 0 0 1px rgba(0, 0, 0, 0);
-webkit-backface-visibility: hidden;
backface-visibility: hidden;
-moz-osx-font-smoothing: grayscale;
position: relative;
padding-right: 2.2em;
}
.hvr-icon-fade-away:before, .hvr-icon-fade-away:after {
content: "\f00c";
position: absolute;
right: 1em;
padding: 0 1px;
font-family: FontAwesome;
}
.hvr-icon-fade-away:after {
opacity: 0;
-webkit-animation-duration: 0.5s;
animation-duration: 0.5s;
-webkit-animation-fill-mode: forwards;
animation-fill-mode: forwards;
}
.hvr-icon-fade-away:hover:after, .hvr-icon-fade-away:focus:after, .hvr-icon-fade-away:active:after {
-webkit-animation-name: hvr-icon-fade-away;
animation-name: hvr-icon-fade-away;
-webkit-animation-timing-function: ease-out;
animation-timing-function: ease-out;
}

/* Icon Float Away */
@-webkit-keyframes hvr-icon-float-away {
0% {
Expand Down
1 change: 1 addition & 0 deletions index.html
Original file line number Diff line number Diff line change
Expand Up @@ -107,6 +107,7 @@ <h2>Icons</h2>
<a href="#" class="hvr-icon-spin">Icon Spin</a>
<a href="#" class="hvr-icon-drop">Icon Drop</a>
<a href="#" class="hvr-icon-fade">Icon Fade</a>
<a href="#" class="hvr-icon-fade-away">Icon Fade Away</a>
<a href="#" class="hvr-icon-float-away">Icon Float Away</a>
<a href="#" class="hvr-icon-sink-away">Icon Sink Away</a>
<a href="#" class="hvr-icon-grow">Icon Grow</a>
Expand Down
44 changes: 44 additions & 0 deletions less/effects/icons/_icon-fade-away.less
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
/* Icon Fade Away */
.keyframes(~"@{nameSpace}-icon-fade-away", {
0% {
opacity: 1;
}

100% {
opacity: 0;
.prefixed(transform, scale(2));
}
});

/* Icon Fade Away */
.icon-fade-away() {
.hacks();
position: relative;
padding-right: @spaceBetweenTextAndArrows;

&:before,
&:after {
content: "\f00c";
position: absolute;
right: 1em;
padding: 0 1px;
font-family: FontAwesome;
.prefixed(transform, scale(1));
}

&:after {
opacity: 0;
.prefixed(animation-duration, @slowDuration);
.prefixed(animation-fill-mode, forwards);
}

&:hover,
&:focus,
&:active {

&:after {
.prefixed(animation-name, ~"@{nameSpace}-icon-fade-away");
.prefixed(animation-timing-function, ease-out);
}
}
}
7 changes: 7 additions & 0 deletions less/hover.less
Original file line number Diff line number Diff line change
Expand Up @@ -613,6 +613,13 @@
}
}

@import "effects/icons/_icon-fade-away";
& when(@includeClasses = true) {
.@{nameSpace}-icon-fade-away {
.icon-fade-away();
}
}

@import "effects/icons/_icon-float-away";
& when(@includeClasses = true) {
.@{nameSpace}-icon-float-away {
Expand Down
44 changes: 44 additions & 0 deletions scss/effects/icons/_icon-fade-away.scss
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
/* Icon Fade Away */
@include keyframes(#{$nameSpace}-icon-fade-away) {
0% {
opacity: 1;
}

100% {
opacity: 0;
@include prefixed(transform, scale(2));
}
}

/* Icon Fade Away */
@mixin icon-fade-away {
@include hacks();
position: relative;
padding-right: #{$spaceBetweenTextAndArrows};

&:before,
&:after {
content: "\f00c";
position: absolute;
right: 1em;
padding: 0 1px;
font-family: FontAwesome;
@include prefixed(transform, scale(1));
}

&:after {
opacity: 0;
@include prefixed(animation-duration, #{$slowDuration});
@include prefixed(animation-fill-mode, forwards);
}

&:hover,
&:focus,
&:active {

&:after {
@include prefixed(animation-name, #{$nameSpace}-icon-fade-away);
@include prefixed(animation-timing-function, ease-out);
}
}
}
7 changes: 7 additions & 0 deletions scss/hover.scss
Original file line number Diff line number Diff line change
Expand Up @@ -612,6 +612,13 @@
}
}

@import "effects/icons/icon-fade-away";
@if $includeClasses {
.#{$nameSpace}-icon-fade-away {
@include icon-fade-away();
}
}

@import "effects/icons/icon-float-away";
@if $includeClasses {
.#{$nameSpace}-icon-float-away {
Expand Down