Browse Source

Added elements and mixins for creating a 'cover' that hides the page until all elemets are ready.

dev
Bryan Miller 5 years ago
parent
commit
3dd8a85dfd
4 changed files with 49 additions and 8 deletions
  1. +22
    -0
      sass/core.scss
  2. +25
    -0
      sass/mixins.scss
  3. +1
    -8
      sass/modal.scss
  4. +1
    -0
      sass/style.scss

+ 22
- 0
sass/core.scss View File

@@ -32,3 +32,25 @@ body{
flex-flow: row;
}

// Used to hide the ENTIRE page until the system has finished readying
// everything.
.cover {
@include cover();
}


.coverFadeout {
-webkit-animation: coverFadeout 1s linear 1 forwards;
animation: coverFadeout 1s linear 1 forwards;
}

@-webkit-keyframes coverFadeout {
0% {@include opacity(1);}
100% {@include opacity(0);}
}


@keyframes coverFadeout {
0% {@include opacity(1);}
100% {@include opacity(0);}
}

+ 25
- 0
sass/mixins.scss View File

@@ -0,0 +1,25 @@

@mixin opacity($value){
-webkit-opacity: $value;
-moz-opacity: $value;
opacity: $value;
}

@mixin transition($properties){
-webkit-transition: $properties;
-moz-transition: $properties;
-ms-transition: $properties;
-o-transition: $properties;
transition: $properties;
}

@mixin cover(){
position: fixed; /* Stay in place */
z-index: 1; /* Sit on top */
left: 0;
top: 0;
width: 100%; /* Full width */
height: 100%; /* Full height */
overflow: hidden;
background-color: rgb(0,0,0); /* Fallback color */
}

+ 1
- 8
sass/modal.scss View File

@@ -5,14 +5,7 @@
/* The Modal (background) */
.modal {
display: none; /* Hidden by default */
position: fixed; /* Stay in place */
z-index: 1; /* Sit on top */
left: 0;
top: 0;
width: 100%; /* Full width */
height: 100%; /* Full height */
overflow: hidden;
background-color: rgb(0,0,0); /* Fallback color */
@include cover();
background-color: rgba(0,0,0,0.4); /* Black w/ opacity */
}


+ 1
- 0
sass/style.scss View File

@@ -1,6 +1,7 @@

// Variables and Mixins
@import 'variables';
@import 'mixins';

// NES Specific colors
@import 'nescolors';

Loading…
Cancel
Save