-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathindex.html
267 lines (267 loc) · 7.19 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
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
<!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" />
<title>QWC Demo</title>
<link rel="stylesheet" href="https://fonts.pycode.tk/open-sans.css" />
<link rel="stylesheet" href="./serve/app.css" />
</head>
<body>
<!-- Custom Elements Start -->
<template is="custom" custom-element="animated-link">
<style>
a.styled {
border: none;
background-color: #403d3d;
color: #fff;
box-shadow: var(--raised-shadow);
padding: 10px;
border-radius: 15px;
padding-left: 40px;
padding-right: 40px;
text-transform: uppercase;
font-weight: 700;
outline: 0;
}
div.styled {
padding: 10px;
margin: auto;
margin-top: 10px;
margin-bottom: 10px;
text-align: center;
}
div.unstyled {
display: inline;
}
</style>
<div class="styled">
<a class="styled" data-href="href" data-onclick="animate"
><slot></slot
></a>
</div>
</template>
<template is="custom" custom-element="app-header">
<style>
header {
top: 0;
z-index: 20;
left: 0;
right: 0;
margin-left: auto;
margin-right: auto;
padding: 8px;
overflow: hidden;
background: var(--primary-color);
text-align: center;
color: var(--header-text-color);
text-align: center;
}
span {
font-weight: bold;
}
</style>
<header><span>QWC - WebComponents Lib</span></header>
</template>
<template is="custom" custom-element="animate-text">
<style>
:host {
top: 0;
position: fixed;
height: 100%;
width: 100%;
color: #fff;
animation: reveal_banner 0.55s ease-in-out;
background-color: var(--primary-color);
z-index: 100;
margin: auto;
text-align: center;
font-weight: bold;
}
@keyframes reveal_banner {
from {
transform: scaleY(0.01);
}
to {
transform: scaleY(1);
}
}
::slotted(div) {
margin-top: 100px;
}
</style>
<slot></slot>
</template>
<template is="custom" custom-element="app-demos">
<style>
.d-title {
font-size: 1.5rem;
}
</style>
<animated-link href="https://github.com/Hydrophobefireman/qwc">
Github
</animated-link>
<div>
<div class="d-title">Demos:</div>
<slot></slot>
</div>
</template>
<template is="custom" custom-element="slotted-demo">
<style>
::slotted(div) {
color: green;
}
.demo-box {
margin: auto;
text-align: center;
border: 2px solid #e3e3e3;
width: 80%;
border-radius: 10px;
padding: 20px;
box-shadow: var(--raised-shadow);
margin-top: 10px;
margin-bottom: 10px;
}
</style>
<div class="demo-box">
<div><slots></div>
<div>Slotted Content Appears below</div>
<slot></slot>
</div>
</template>
<template is="custom" custom-element="app-description">
<style>
:host {
padding: 30px;
display: block;
text-align: center;
background: linear-gradient(
315deg,
rgba(255, 255, 255, 0.5) 0%,
rgba(255, 0, 0, 0) 100%
),
linear-gradient(315deg, #2a96f1 0%, #4ffff2 100%);
}
.x {
margin: auto;
text-align: center;
font-size: 5rem;
font-family: sans-serif;
color: #282c34;
}
.tx {
font-weight: bold;
font-size: 1.2rem;
}
</style>
<div class="x">QWC</div>
<div class="tx">
Write 0 javascript classes and create reusable custom elements
</div>
</template>
<template is="custom" custom-element="button-counter-demo"
><style>
.demo-box {
margin: auto;
text-align: center;
border: 2px solid #e3e3e3;
width: 80%;
border-radius: 10px;
padding: 20px;
box-shadow: var(--raised-shadow);
margin-top: 10px;
margin-bottom: 10px;
}
</style>
<div class="demo-box">
General event listeners and basic reactivity
<div data-text-content="currentDate"></div>
<button
updates-reactively
data-text-content="val"
data-onclick="handleClick"
></button>
</div>
</template>
<template is="custom" custom-element="app-disclaimer">
<style>
div {
width: 80%;
text-align: center;
margin: auto;
font-size: 0.85rem;
}
span {
color: red;
}
</style>
<div>
Note: Don't actually use this for massive components. This is NOT a
framework, this is just something I made (for myself, initially) for
small, reusable elements like a
<span data-text-content="spinner"></span> or a
<span data-text-content="video"></span>.
</div>
</template>
<template is="custom" custom-element="paper-input-demo">
<style>
.demo-box {
margin: auto;
text-align: center;
border: 2px solid #e3e3e3;
width: 80%;
border-radius: 10px;
padding: 20px;
box-shadow: var(--raised-shadow);
margin-top: 10px;
margin-bottom: 10px;
}
input:focus {
border-bottom: 2px solid var(--primary-color);
}
input {
transition: 0.3s ease-in-out;
padding: 8px;
width: 80%;
border: none;
outline: none;
border-bottom: 2px solid #846d6d;
}
</style>
<div class="demo-box">
<div>Styled Input</div>
<div>Value:<span data-text-content="value"></span></div>
<input
data-oninput="handleInput"
data-placeholder="placeholder"
updates-reactively
/>
</div>
</template>
<!-- Custom Elements End -->
<app-header></app-header>
<main>
<app-description></app-description>
<app-demos>
<slotted-demo><div>Slotted Text</div></slotted-demo>
<paper-input-demo placeholder="Type Something"></paper-input-demo>
<button-counter-demo></button-counter-demo>
</app-demos>
<div>
Check out this same example using<animated-link
unstyled
href="./html-import.html"
>
qwc.HTMLImport</animated-link
>
</div>
<app-disclaimer></app-disclaimer>
</main>
<script src="./serve/app.js"></script>
<script type="module">
import { init } from "./dist/index.modern.js";
init(mods, config);
</script>
</body>
</html>