-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathmy-loader.js
92 lines (80 loc) · 2.05 KB
/
my-loader.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
import {html,css,LitElement} from 'lit'
export class myLoader extends LitElement{
static styles=//css
css`
:root{
--loader--dimension:170px;
--half-fullSize:50%;
--one-hundred-percent:100%;
--transition-hamburguer:3s;
}
.container_loader{
width:var(--one-hundred-percent);
height:var(--one-hundred-percent);
position:absolute;
display: flex;
place-content: center;
}
#loader {
position: absolute;
left: var(--half-fullSize);
top: var(--half-fullSize);
z-index: 1;
width: var(--loader--dimension);
height: var(--loader--dimension);
margin: -76px 0 0 -76px;
background-image: url('./images/cute-anime-emoji.jpg');
background-repeat: no-repeat;
background-position: center;
background-size: cover;
border: 16px solid #f3f3f3;
border-radius: var(--half-fullSize);
border-top: 16px solid #912aec;
-webkit-animation: spin 2s linear infinite;
animation: 2s infinite alternate spinAnimation;
}
@-webkit-keyframes spinAnimation {
0% {
transform: translate(0);
opacity: 0.1;
--webkit-transformation:
}
100% {
transform: translateY(-50px);
}
}
/* Add animation to "page content" */
.animate-bottom {
position: relative;
-webkit-animation-name: animatebottom;
-webkit-animation-duration: 1s;
animation-name: animatebottom;
animation-duration: 1s
}
@-webkit-keyframes animatebottom {
from { bottom:-100px; opacity:0 }
to { bottom:0px; opacity:1 }
}
@keyframes animatebottom {
from{ bottom:-100px; opacity:0 }
to{ bottom:0; opacity:1 }
}
`;
constructor(){
super();
this.myVar;
this.myFunction=()=> {
myVar = setTimeout(showPage, 2000);
}
}
render(){
return html`
<div class="container_loader">
<!-- LOADER#1 START -->
<div id="loader"></div>
<!-- LOADER#1 END -->
</div>
`
}
}
customElements.define('my-loader',myLoader);