Skip to content

Commit

Permalink
Added forward and backward effects
Browse files Browse the repository at this point in the history
  • Loading branch information
IanLunn committed Oct 21, 2016
1 parent f7c0cf2 commit fb3b146
Show file tree
Hide file tree
Showing 10 changed files with 115 additions and 3 deletions.
2 changes: 1 addition & 1 deletion css/hover-min.css

Large diffs are not rendered by default.

34 changes: 34 additions & 0 deletions css/hover.css

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions css/hover.css.map

Large diffs are not rendered by default.

2 changes: 2 additions & 0 deletions index.html
Original file line number Diff line number Diff line change
Expand Up @@ -78,6 +78,8 @@ <h2>2D Transitions</h2>
<a href="#" class="hvr-wobble-skew">Wobble Skew</a>
<a href="#" class="hvr-buzz">Buzz</a>
<a href="#" class="hvr-buzz-out">Buzz Out</a>
<a href="#" class="hvr-forward">Forward</a>
<a href="#" class="hvr-backward">Backward</a>


<h2>Background Transitions</h2>
Expand Down
12 changes: 12 additions & 0 deletions less/effects/2d-transitions/_backward.less
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
/* Backward */
.backward() {
.hacks();
.prefixed(transition-duration, @mediumDuration);
.prefixed(transition-property, transform);

&:hover,
&:focus,
&:active {
.prefixed(transform, translateX(-8px));
}
}
12 changes: 12 additions & 0 deletions less/effects/2d-transitions/_forward.less
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
/* Forward */
.forward() {
.hacks();
.prefixed(transition-duration, @mediumDuration);
.prefixed(transition-property, transform);

&:hover,
&:focus,
&:active {
.prefixed(transform, translateX(8px));
}
}
14 changes: 14 additions & 0 deletions less/hover.less
Original file line number Diff line number Diff line change
Expand Up @@ -207,6 +207,20 @@
}
}

@import "effects/2d-transitions/_forward";
& when(@includeClasses = true) {
.@{nameSpace}-forward {
.forward();
}
}

@import "effects/2d-transitions/_backward";
& when(@includeClasses = true) {
.@{nameSpace}-backward {
.backward();
}
}

/* BACKGROUND TRANSITIONS */
@import "effects/background-transitions/_fade";
& when(@includeClasses = true) {
Expand Down
12 changes: 12 additions & 0 deletions scss/effects/2d-transitions/_backward.scss
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
/* Backward */
@mixin backward {
@include hacks();
@include prefixed(transition-duration, $mediumDuration);
@include prefixed(transition-property, transform);

&:hover,
&:focus,
&:active {
@include prefixed(transform, translateX(-8px));
}
}
12 changes: 12 additions & 0 deletions scss/effects/2d-transitions/_forward.scss
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
/* Forward */
@mixin forward {
@include hacks();
@include prefixed(transition-duration, $mediumDuration);
@include prefixed(transition-property, transform);

&:hover,
&:focus,
&:active {
@include prefixed(transform, translateX(8px));
}
}
14 changes: 14 additions & 0 deletions scss/hover.scss
Original file line number Diff line number Diff line change
Expand Up @@ -206,6 +206,20 @@
}
}

@import "effects/2d-transitions/forward";
@if $includeClasses {
.#{$nameSpace}-forward {
@include forward();
}
}

@import "effects/2d-transitions/backward";
@if $includeClasses {
.#{$nameSpace}-backward {
@include backward();
}
}

/* BACKGROUND TRANSITIONS */
@import "effects/background-transitions/fade";
@if $includeClasses {
Expand Down

0 comments on commit fb3b146

Please sign in to comment.