-
Notifications
You must be signed in to change notification settings - Fork 0
/
index.html
166 lines (146 loc) · 3.54 KB
/
index.html
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
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport"
content="width=device-width, initial-scale=1.0">
<meta http-equiv="X-UA-Compatible"
content="ie=edge">
<link rel="stylesheet" href="">
<title>My first PWA</title>
<script>
if ('serviceWorker' in navigator) {
window.addEventListener('load', function () {
/*navigator.serviceWorker
.register('/service-worker.js', {
scope: '/',
})
.then(function () { console.log("Service Worker Registered"); });*/
});
} else {
console.log('Service worker not supporttd use another cache method');
}
</script>
<!-- <link rel="stylesheet" href="./styles/main.css"> -->
<style>
* {
box-sizing: border-box;
}
/* Inline your critical styles */
html,
body {
/* Define app variables */
--app-bg-color: #fafafa;
--app-text-color: #313131;
--app-card-color: #ffffff;
--app-grey-color: #E2E2E2;
--app-header-shadow: 0 0 4px rgba(0, 0, 0, .14), 0 4px 8px rgba(0, 0, 0, .28);
min-height: 100%;
margin: 0;
padding: 0;
background-color: var(--app-bg-color);
font-size: 16px;
font-family: sans-serif;
color: var(--app-text-color);
}
a {
color: inherit;
text-decoration: none;
}
#app {
height: 100%;
}
#app>header {
position: relative;
background-color: var(--app-card-color);
padding: 0 16px;
box-shadow: var(--app-header-shadow);
z-index: 1;
}
#app>header nav {
position: relative;
display: flex;
justify-content: space-between;
align-items: center;
height: 48px;
font-size: 1.25rem;
}
#app>main>[active] {
display: block;
}
#app>main>* {
display: none;
}
/* Skeleton */
.skeleton {
position: relative;
margin: 1rem;
}
.skeleton .hero {
min-height: 30vh;
background: var(--app-grey-color);
margin-bottom: 1rem;
border-radius: 5px;
}
.skeleton .title {
min-height: 20px;
background: var(--app-grey-color);
margin-bottom: 1rem;
}
.skeleton .text {
min-height: 20px;
max-width: 60%;
background: var(--app-grey-color);
margin-bottom: 1rem;
}
.skeleton::after {
display: block;
content: '';
position: absolute;
top: 0;
width: 100%;
height: 100%;
transform: translateX(-100%);
background: linear-gradient(90deg, transparent, rgba(255, 255, 255, .2), transparent);
animation: loading 1.5s infinite;
}
@keyframes loading {
100% {
transform: translateX(100%);
}
}
</style>
</head>
<body>
<section id="app">
<header>
<nav>
<span class="title"><a href="/">Super app</a></span>
</nav>
</header>
<main>
<div class="skeleton"
active>
<div class="hero"></div>
<div class="title"></div>
<div class="text"></div>
</div>
<section page="list">
<div class="ctn">
<h1>Loaded !</h1>
</div>
</section>
<section page="view"></section>
</main>
</section>
<script type="module"
src="./js/app.js"></script>
<script async nomodule="">
// Load CardElement CSS
const cardStyle = document.createElement('link');
cardStyle.href = 'js/components/card/card.css';
cardStyle.rel = "stylesheet";
document.head.appendChild(cardStyle);
</script>
</body>
</html>