-
Notifications
You must be signed in to change notification settings - Fork 0
/
tw.html
297 lines (266 loc) · 11 KB
/
tw.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
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
<!-- prevent quirks mode -->
<!DOCTYPE html>
<!--
- `inter` sets Inter font
- `theme-light` enables theme-inverted class
- `hidden` so we prevent load-time jankiness: we show the page on window load.
-->
<html class="inter theme-light" hidden style="--fs-normal: 16px">
<base href="../../www/">
<head>
<title>TW UI DEMO</title>
<meta charset="utf-8">
<!-- always preload your fonts or face extreme load-time jankiness -->
<link rel="preload" as="font" href="inter-roman.var.woff2" >
<link rel="preload" as="font" href="material-icons-round.woff2">
<link rel="preload" as="font" href="material-icons-outlined.woff2">
<link rel="stylesheet" type="text/css" href="fontawesome.css">
<script src="glue.js"></script>
<script src="dom.js"></script>
<script src="css.js"></script>
<script src="purify.js"></script>
<script src="widgets.js"></script>
<script src="nav.js"></script>
<script src="input.js"></script>
<script src="list.js"></script>
<script src="grid.js"></script>
<script src="chart.js"></script>
<script src="xmodule.js"></script>
<style>
:root {
--fg : rgb(15 23 42);
--sky : rgb(14 165 233);
--slate : #94a3b8;
--indigo : rgb(79 70 229);
--indigo-hover : rgb(79 70 229 / 80%);
}
.huge { font-size: 4.5rem; }
.w-10 { width : 2.5rem; }
.h-10 { height: 2.5rem; }
.p-y-2rem { padding-top: 2rem; padding-bottom: 2rem; }
.m-l-2rem { margin-left: 2rem; }
.p-l-2rem { padding-left: 2rem; }
.fg-sky { color: var(--sky); }
.bg-sky { background: var(--sky); }
.bg-indigo { background: var(--indigo); }
.fg-indigo { color: var(--indigo); }
.bg-indigo-hover { background: var(--indigo-hover); }
.b-indigo { border-color: var(--indigo); }
.fg-slate { color: var(--slate); }
.p-y-1_25 { padding-top: .625rem; padding-bottom: .625rem; }
::placeholder { color: var(--fg); opacity: .3; font-weight: 600; }
input { font-family: inherit; font-size: inherit; }
input:focus { outline: none; }
</style>
<script>
// button styling
css('.btn' , 'semibold nowrap noselect ro ring p-x-4 p-y-1_25 h-c h-m hand')
css('.btn-sm' , 'btn littlebold ro-075 p-x-2 p-y bg')
css('.btn-pri' , 'btn white bg-fg')
css('.btn-indigo' , 'btn-sm white bg-indigo')
css_state('.btn-indigo:hover' , 'bg-indigo-hover')
css_state('.btn-sm:hover' , 'bg-hover')
css('.arrow-right::after', 'mi m-l small', `content: 'arrow_forward';`)
css_state('.ro-group-h:hover > .btn', 'bg-hover')
// menu styling
css('.menu-section', 'v p-2 ro bg ring')
css('.menu-section-label', 'p-y bold dim xsmall bg')
css('.menu-item', 'ro-075 p-y bg')
css_state('.menu-item:hover', '', `
background: var(--indigo);
color: var(--fg-white);
`)
css('.menu-item-icon', 'mi-outlined p-x fg-slate')
css_state('.menu-item:hover .menu-item-icon', 'white')
// toggle component
css('my-toggle', 't-m p-05 round b bg1 h-m ease hand', `
min-width : 3em;
max-width : 3em;
min-height : 1.75em;
max-height : 1.75em;
`)
css('.my-toggle-thumb', 'round bg ease shadow-thumb', `
min-width : 1.2em;
min-height : 1.2em;
`)
css_state('my-toggle[checked]', 'bg-indigo')
css_state('my-toggle[checked] .my-toggle-thumb', 'ease', `
transform: translateX(100%);
`)
component('my-toggle', function(e) {
e.thumb = div({class: 'my-toggle-thumb'})
e.set(e.thumb)
e.make_focusable()
e.prop('checked', {type: 'bool', attr: true})
e.toggle = function() {
e.checked = !e.checked
}
e.on('keydown', function(key) {
if (key == ' ')
e.toggle()
})
e.on('click', function() {
e.toggle()
})
})
// init
on_dom_load(function() {
init_components()
})
on('load', function() {
root.show()
})
</script>
<svg hidden version="2.0">
<defs>
<symbol id="back-15s">
<path d="M6.22 11.03a.75.75 0 1 0 1.06-1.06l-1.06 1.06ZM3 6.75l-.53-.53a.75.75 0 0 0 0 1.06L3 6.75Zm4.28-3.22a.75.75 0 0 0-1.06-1.06l1.06 1.06ZM13.5 18a.75.75 0 0 0 0 1.5V18ZM7.28 9.97 3.53 6.22 2.47 7.28l3.75 3.75 1.06-1.06ZM3.53 7.28l3.75-3.75-1.06-1.06-3.75 3.75 1.06 1.06Zm16.72 5.47c0 2.9-2.35 5.25-5.25 5.25v1.5a6.75 6.75 0 0 0 6.75-6.75h-1.5ZM15 7.5c2.9 0 5.25 2.35 5.25 5.25h1.5A6.75 6.75 0 0 0 15 6v1.5ZM15 6H3v1.5h12V6Zm0 12h-1.5v1.5H15V18Z" fill="#64748B"></path><path d="M3 15.75h.75V21" stroke="#64748B" stroke-width="1.5" stroke-linecap="round" stroke-linejoin="round"></path><path d="M9 16.5A.75.75 0 0 0 9 15v1.5Zm-2.25-.75V15a.75.75 0 0 0-.75.75h.75Zm0 2.25H6c0 .414.336.75.75.75V18Zm0 2.25a.75.75 0 0 0 0 1.5v-1.5ZM9 15H6.75v1.5H9V15Zm-3 .75V18h1.5v-2.25H6Zm.75 3h1.5v-1.5h-1.5v1.5Zm1.5 1.5h-1.5v1.5h1.5v-1.5ZM9 19.5a.75.75 0 0 1-.75.75v1.5a2.25 2.25 0 0 0 2.25-2.25H9Zm-.75-.75a.75.75 0 0 1 .75.75h1.5a2.25 2.25 0 0 0-2.25-2.25v1.5Z" fill="#64748B"></path>
</symbol>
<symbol id="fw-15s">
<path d="M16.72 9.97a.75.75 0 1 0 1.06 1.06l-1.06-1.06ZM21 6.75l.53.53a.75.75 0 0 0 0-1.06l-.53.53Zm-3.22-4.28a.75.75 0 1 0-1.06 1.06l1.06-1.06ZM10.5 19.5a.75.75 0 0 0 0-1.5v1.5Zm3.75-4.5a.75.75 0 0 0 0 1.5V15Zm.75.75h.75A.75.75 0 0 0 15 15v.75ZM14.25 21a.75.75 0 0 0 1.5 0h-1.5Zm6-4.5a.75.75 0 0 0 0-1.5v1.5ZM18 15.75V15a.75.75 0 0 0-.75.75H18ZM18 18h-.75c0 .414.336.75.75.75V18Zm0 2.25a.75.75 0 0 0 0 1.5v-1.5Zm-.22-9.22 3.75-3.75-1.06-1.06-3.75 3.75 1.06 1.06Zm3.75-4.81-3.75-3.75-1.06 1.06 3.75 3.75 1.06-1.06ZM2.25 12.75A6.75 6.75 0 0 0 9 19.5V18a5.25 5.25 0 0 1-5.25-5.25h-1.5ZM9 6a6.75 6.75 0 0 0-6.75 6.75h1.5C3.75 9.85 6.1 7.5 9 7.5V6Zm0 1.5h12V6H9v1.5Zm0 12h1.5V18H9v1.5Zm5.25-3H15V15h-.75v1.5Zm0-.75V21h1.5v-5.25h-1.5Zm6-.75H18v1.5h2.25V15Zm-3 .75V18h1.5v-2.25h-1.5Zm.75 3h1.5v-1.5H18v1.5Zm1.5 1.5H18v1.5h1.5v-1.5Zm.75-.75a.75.75 0 0 1-.75.75v1.5a2.25 2.25 0 0 0 2.25-2.25h-1.5Zm-.75-.75a.75.75 0 0 1 .75.75h1.5a2.25 2.25 0 0 0-2.25-2.25v1.5Z" fill="#64748B"></path>
</symbol>
</defs>
</svg>
</head>
<body class="v-c rel bg-no-repeat" style="background-image: url(../tests/www/tw-bg.jpg); background-size: 150rem; background-position-x: -10rem">
<d class="v" style="width: 1296px">
<d class="h-m smaller p-y-2rem">
<d class="S xlarge bold h-m">allegory sdk<d class="b2 m-05 m-x b-fg ro-075 p-x-025 small tight">UI</d></d>
<d class="m-l-2rem semibold">Components</d>
<d class="m-l-2rem semibold">Templates <d class="m p-x-05 p-y-025 round xsmall bg-sky white">New</d></d>
<d class="m-l-2rem semibold">Documentation</d>
<d class="m-l-2rem mi" style="font-size: 2rem">search</d>
<d class="m-l-2rem b-l p-l-2rem semibold">Sign in</d>
<d class="m-l-2rem btn-pri arrow-right">Get all-access</d>
</d>
<d class="rel">
<!-- left side -->
<d class="overlay grid-t" style="margin-top: 5rem; grid-template-columns: 4fr 1fr 2fr 3fr">
<!-- headline -->
<d class="xx">
<d class="semibold fg-sky">By the makers of Allegory SDK</d>
<h1 class="m-t-4 m-b-0 extrabold huge lh1">Build your next idea even faster.</h1>
</d>
<!-- sub-headline -->
<d class="y2">
<p class="large">
Beautifully designed, expertly crafted components and templates,
built by the makers of Allegory SDK. The perfect starting point
for your next project.
</p>
<d class="h">
<d class="btn-pri arrow-right">Browse components</d>
<d class="btn m-l-2 arrow-right">Explore templates</d>
</d>
</d>
</d>
<!-- right side -->
<d class="overlay grid-t" style="margin-top: 5rem; grid-template-columns: 4fr 1fr 2fr 3fr">
<!-- buttons -->
<d class="x3 h-r h-b">
<d class="p-4 v-r small gap-4">
<my-toggle class="m-b-4" checked></my-toggle>
<d>
<my-toggle></my-toggle>
<d class="m-l-4 btn-indigo">Button A</d>
</d>
<d class="h ro-group-h">
<d class="btn btn-sm"><d class="mi m-r dim">bookmark</d>Bookmark</d>
<d class="btn btn-sm">12k</d>
</d>
</d>
</d>
<!-- person list -->
<d class="x4 p-4 v">
<d class="v ring ro clip bg small" style="">
<d class="h p-4">
<img class="round w-10 h-10 " src="../tests/www/avatar-1.jpg"></img>
<d class="S v-sb m-l-4">
<d class=littlebold>Leonard Krasner</d>
<d>@leonardkrasner</d>
</d>
<d class="self-h-m btn btn-sm">View</d>
</d>
<d class="h p-4 b-t">
<img class="round w-10 h-10" src="../tests/www/avatar-2.jpg"></img>
<d class="S v-sb m-l-4">
<d class=littlebold>Floyd Miles</d>
<d>@floydmiles</d>
</d>
<d class="self-h-m btn btn-sm">View</d>
</d>
<d class="h p-4 b-t">
<img class="round w-10 h-10" src="../tests/www/avatar-3.jpg"></img>
<d class="S v-sb m-l-4">
<d class=littlebold>Emily Selman</d>
<d>@emilyselman</d>
</d>
<d class="self-h-m btn btn-sm">View</d>
</d>
<d class="p-4 b-t h">
<d class="S btn btn-sm">View all</d>
</d>
</d>
</d>
<!-- player bar -->
<d class="x3 xxx m-4 h ro-group-h">
<d class="btn bg gap">
<svg style="width: 22px; height: 22px" version="2.0"><use href="#back-15s"></use></svg>
<d class="mi" style="font-size: 3.1em">play_circle</d>
<svg style="width: 22px; height: 22px" version="2.0"><use href="#fw-15s"></use></svg>
</d>
<d class="S smaller btn bg no-bold gap-4">
0:51
<d class="S h-m">
<d class="S bg-indigo round ro-r-0" style="height: 8px"></d>
<d class="bg-indigo round" style="margin-left: 2px; width: 4px; height: 20px"></d>
<d class="S2 bg1 round ro-l-0" style="height: 8px"></d>
</d>
55:43
<d class="mi label xlarge">volume_down</d>
<d class="mi label smaller">more_vert</d>
</d>
</d>
<!-- message boxes -->
<d class="x2 xx v m-4 gap-4">
<d class="ring ro b2 b-indigo p-4 bg small v" style="height: 8rem">
<d class="h">
<d class="S p-b littlebold">Newsletter</d>
<d class="mi fg-indigo">check_circle</d>
</d>
<d>Last message sent an hour ago</d>
<d class="S h-b littlebold">621 users</d>
</d>
<d class="ring ro b2 b-invisible p-4 bg small v" style="height: 8rem">
<d class="h">
<d class="S p-b littlebold">Existing customers</d>
</d>
<d>Last message sent an hour ago</d>
<d class="S h-b littlebold">1200 users</d>
</d>
</d>
<!-- search projects dropdown -->
<d class="x4 m-4 ro-group-v v-t small">
<d class="menu-section">
<d class="h-m">
<d class="menu-item-icon dim xlarge lh1">search</d>
<input class="S p-05 b0 littlebold" placeholder="Search projects..."></input>
</d>
</d>
<d class="menu-section">
<d class="menu-section-label">Recent searches</d>
<d class="menu-item"><d class="menu-item-icon">folder</d>Allegory Labs / Website Redesign</d>
<d class="menu-item"><d class="menu-item-icon">folder</d>Larasmell LLC / Conference Branding</d>
</d>
<d class="menu-section">
<d class="menu-item"><d class="menu-item-icon">note_add</d>Add new file...</d>
<d class="menu-item"><d class="menu-item-icon">create_new_folder</d>Add new folder...</d>
<d class="menu-item"><d class="menu-item-icon">tag</d>Add hashtag...</d>
<d class="menu-item"><d class="menu-item-icon">label</d>Add label...</d>
</d>
</d>
</d>
</d>
</d>
</body>
</html>