Skip to content

Commit

Permalink
Fix css spinner
Browse files Browse the repository at this point in the history
  • Loading branch information
crabbly committed Sep 24, 2020
1 parent 61face0 commit 1cc599c
Show file tree
Hide file tree
Showing 4 changed files with 47 additions and 39 deletions.
4 changes: 3 additions & 1 deletion src/sass/modules/_colors.scss
Original file line number Diff line number Diff line change
@@ -1,8 +1,10 @@
$blue: hsl(209, 96%, 36%);
$white: hsl(0, 0%, 100%);

/*
|--------------------------------------------------------------------------
| Aliases
|--------------------------------------------------------------------------
*/
$primary: $blue;
$primary: $blue;
$bg-color: rgba($white, .9);
4 changes: 2 additions & 2 deletions src/sass/partials/_modal.scss
Original file line number Diff line number Diff line change
Expand Up @@ -7,10 +7,10 @@
left:0;
top:0;
position:absolute;
color: #0460B5;
color: $primary;
width: 100%;
height: 100%;
background-color:rgba(255, 255, 255, 0.91);
background-color: $bg-color;
}

/*
Expand Down
77 changes: 41 additions & 36 deletions src/sass/partials/_spinner.scss
Original file line number Diff line number Diff line change
@@ -1,41 +1,46 @@
.printModal {
font-family:sans-serif;
display:flex;
text-align:center;
font-weight:300;
font-size:30px;
left:0;
top:0;
position:absolute;
color: #0460B5;
width: 100%;
height: 100%;
background-color:rgba(255, 255, 255, 0.91);
.printSpinner {
margin-top: 3px;
margin-left: -40px;
position: absolute;
display: inline-block;
width: 25px;
height: 25px;
border: 2px solid $primary;
border-radius: 50%;
animation: spin 0.75s infinite linear;
}

/*
|--------------------------------------------------------------------------
| Print Modal Close Button
|--------------------------------------------------------------------------
*/
.printClose {
position:absolute;
right:10px;
top:10px;
.printSpinner::before, .printSpinner::after {
left: -2px;
top: -2px;
display: none;
position: absolute;
content: '';
width: inherit;
height: inherit;
border: inherit;
border-radius: inherit;
}

.printClose:before {
content: "\00D7";
font-family: "Helvetica Neue", sans-serif;
font-weight: 100;
line-height: 1px;
padding-top: 0.5em;
display: block;
font-size: 2em;
text-indent: 1px;
overflow: hidden;
height: 1.25em;
width: 1.25em;
text-align: center;
cursor: pointer;
.printSpinner, .printSpinner::before, .printSpinner::after {
display: inline-block;
border-color: transparent;
border-top-color: $primary;
animation-duration: 1.2s;
}
.printSpinner::before {
transform: rotate(120deg);
}
.printSpinner::after {
transform: rotate(240deg);
}

/* Keyframes for the animation */
@keyframes spin {
from {
transform: rotate(0deg);
}
to {
transform: rotate(360deg);
}
}
1 change: 1 addition & 0 deletions test/manual/index.html
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
<html>
<link rel="stylesheet" href="../../dist/print.css" type="text/css">
<script src='../../dist/print.js'></script>
<script type="text/javascript">
function printPdf() {
Expand Down

0 comments on commit 1cc599c

Please sign in to comment.