Created
September 28, 2015 18:10
-
-
Save vwochnik/1479adbecb0583e37cd5 to your computer and use it in GitHub Desktop.
Scss overlay mixin
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <html> | |
| <head> | |
| <title>Test</title> | |
| <!-- include stylesheet --> | |
| </head> | |
| <body> | |
| <div class="overlay"></div> | |
| </body> | |
| <!-- include jQyery --> | |
| <!-- include javascript --> | |
| </html> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| /* | |
| * Overlay mixin with fade animation | |
| */ | |
| @mixin overlay($position, $z-index, $duration) { | |
| position: $position; | |
| left: 0; top: 0; | |
| width: 100%; height: 0; | |
| z-index: $z-index; | |
| @include transition(opacity $duration ease-in-out, height 0s linear, visibility 0s linear); | |
| visibility: hidden; | |
| overflow: hidden; | |
| @include opacity(0.0); | |
| &.fade-out { | |
| @include transition(opacity $duration ease-in-out, height 0s linear $duration, visibility 0s linear $duration); | |
| } | |
| &.visible { | |
| height: 100%; | |
| visibility: visible; | |
| @include opacity(1.0); | |
| } | |
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| (function($) { | |
| })(jQyery); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| .overlay { | |
| @include overlay(fixed, 99, 1s); | |
| background-color: rgba(0, 0, 96, 0.4); | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment