-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathplayground.html
More file actions
452 lines (254 loc) Β· 14.1 KB
/
playground.html
File metadata and controls
452 lines (254 loc) Β· 14.1 KB
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
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
<!DOCTYPE html><html><head><meta charset="utf8"><meta name="charset" charset="utf8" id="include_xxm0qoac"><meta name="content-type" http-equiv="Content-Type" content="text/html; charset=utf-8" id="include_xxnd8o0e"><meta name="viewport" content="width=device-width, initial-scale=1" id="include_x13l7u56"><meta name="robots" content="index, follow" id="include_xxriq75n"><meta name="revisit-after" content="30 days" id="include_x1m4jm9p"><link rel="stylesheet" href="build-xxnc164u.css">
<script defer="" src="build-x1c2a27s.js"></script>
</head><body><meta charset="utf8">
<meta charset="utf8">
<title>Playground</title>
<nav class="page-nav x_Page">
<ul class="x_Page">
<li class="x_Page"><a class="nav-link--modulo x_Page" href="index.html" title=" Modulo"> α΅Β°dα΅βo</a></li>
<li class="x_Page"><a href="docs/index.html" class="x_Page"> Docs</a></li>
<li class="x_Page"><a href="playground.html" class="x_Page"> Playground</a></li>
<li class="x_Page"><a href="about.html" class="x_Page"> About</a></li>
<li class="x_Page"><a style="border:none" href="https://codeberg.org/modulo/modulo/" class="x_Page">Source (Git)</a></li>
<li class="x_Page"><a style="border:none" href="https://www.npmjs.com/package/create-modulo" class="x_Page">create-modulo (npmjs)</a></li>
<li style="margin-left: auto" class="x_Page">
<a style="padding:3px;" href="https://modu.lol/Modulo.html" download="Modulo.html" class="x_Page">β Modulo.html</a>
<textarea title="Run this command in a terminal to start a new Modulo project" style="background:var(--bg);color:var(--fg);border:none;width:200px;resize:none;font-size:18px;height: 25px" readonly="">npm init modulo</textarea>
</li>
<li class="x_Page">
<x-pagecontrols modulo-mount-html=""><div style="text-align: right; margin-top: 15px">
<input id="theme_id_slider" style="width: 80px" type="range" min="1" max="3" step="1" value="1" name="themenum">
</div>
<div class="page-toolbar" style="display: flex">
<label for="theme_id_slider"><span style="font-size:20px;font-family:monospace"><span title="Default">β </span><span title="Invert"> β </span><span title="Custom"> β±</span></span></label>
</div></x-pagecontrols>
</li>
</ul>
</nav>
<a class="a-hamburger x_Page" href="#">β°</a>
<div class="page-container page--normal x_Page">
<h1>Playground</h1>
<h4></h4>
<div class="markdown-page">
<h2 h="#" class="x_Page">Playground</h2><p class="x_Page"><strong>To see and edit the source code, select "CODE" or "EDIT" from the drop down
in the upper right of each example.</strong></p><hr class="x_Page"><p class="x_Page"></p><h2 h="##" class="x_Page">Component Examples</h2><p class="x_Page">In this section you will find a several component examples. The content of
these code samples can be put into any <code class="x_Page"><Component></code> definition.
</p><p class="x_Page"></p><h2 h="#####" class="x_Page">Example 1 - ToDo MVC</h2><p class="x_Page"><x-demo show="ui" ui="demo" mode="js" demo="component" value="<Template>
<ol>
{% for item in state.list %}
<li>{{ item }}
{% endfor %}
<li><input state.bind name=text><button on.click=script.add>Add</button>
</ol>
</Template>
<State
text="Coffee"
list:=[]
list.0="Butter"
list.1="Bread"
></State>
<Script>
function add() {
state.list.push(state.text)
state.text = ''
}
</Script>" modulo-mount-html="">
<select style="" name="ui">
<option value="demo">π DEMO</option>
<option value="code">π CODE</option>
<option value="edit">π EDIT</option>
</select>
<iframe srcdoc=" "></iframe>
</x-demo></p><p class="x_Page"></p><h2 h="#####" class="x_Page">Example 2 - Accordion Widget</h2><p class="x_Page"><x-demo show="ui" ui="demo" mode="html" demo="component" value="<Template>
<select state.bind name="val">
<option value="top">View Top</option>
<option value="bottom">View Bottom</option>
</select>
<article class="{% if state.val is 'top' %}active{% endif %}">
<h1>Top</h1> {% include top %}
</article>
<article class="{% if state.val is 'bottom' %}active{% endif %}">
<h1>Bottom</h1> {% include bottom %}
</article>
</Template>
<Template -name="bottom"><p>Bottom content</p></Template>
<Template -name="top"><p>Top content</p></Template>
<State
val="top"
></State>
<Style>
article {
overflow: hidden;
transition: height 0.5s;
padding: 5px;
height: 0;
border: groove 4px #88888888;
}
article.active { height: 120px; }
</Style>" modulo-mount-html="">
<select style="" name="ui">
<option value="demo">π DEMO</option>
<option value="code">π CODE</option>
<option value="edit">π EDIT</option>
</select>
<iframe srcdoc=" "></iframe>
</x-demo></p><p class="x_Page"></p><h2 h="####" class="x_Page">Example 3: Search API</h2><p class="x_Page"><x-demo show="ui" ui="demo" mode="js" demo="component" value="<Template>
<form on.submit=script.doSearch>
<input state.bind name=search>
<button on.click=script.doSearch>Submit</button>
</form>
{% if state.results is null %}<strong>Loading</strong>{% endif %}
<ol>{% for item in state.results %}<li>{{ item.title }}</li>{% endfor %}</ol>
</Template>
<State
search="MacBeth"
results:=[]
></State>
<Script>
const API = 'https://openlibrary.org/search.json?q='
const OPTS = '&limit=20&fields=title'
async function doSearch() {
state.results = null
state.results = (await (await fetch(API + state.search + OPTS)).json()).docs
element.rerender()
}
</Script>
<Style>* { font-size: 110%; padding: 30px; box-shadow: 0 0 10px #88888888; }</Style>" modulo-mount-html="">
<select style="" name="ui">
<option value="demo">π DEMO</option>
<option value="code">π CODE</option>
<option value="edit">π EDIT</option>
</select>
<iframe srcdoc=" "></iframe>
</x-demo></p><p class="x_Page"></p><h2 h="###" class="x_Page">Example 4: Sortable CSV Table</h2><p class="x_Page"><x-demo show="ui" ui="demo" mode="js" demo="component" value="<Template>
<section style="grid-template-columns:{% for header in staticdata|first %}
{% if header is 'Supply Chain' %}5fr{% else %}1fr{% endif %}
{% endfor %}">
{% for i, header in staticdata|first %}
<button on.click=script.sort payload={{i}}>
{% if state.sort is i %}&darr;{% endif %}{{ header|trimfile }}
</button>
{% endfor %}
{% for row in staticdata|skipfirst|sorted:state.sort %}
{% for col in row %}<div>{{ col }}</div> {% endfor %}
{% endfor %}
</section>
</Template>
<State
sort="0"
></State>
<StaticData
-data-type=csv
-src="static/demos/co2.csv.htm"
></StaticData>
<Script>
function sort(index) {
state.sort = index
}
</Script>
<Style>
div { border-bottom: 1px dotted black; padding: 2px; }
section { display: grid; width: 100%; }
</Style>" modulo-mount-html="">
<select style="" name="ui">
<option value="demo">π DEMO</option>
<option value="code">π CODE</option>
<option value="edit">π EDIT</option>
</select>
<iframe srcdoc=" "></iframe>
</x-demo></p><hr class="x_Page"><p class="x_Page"></p><h2 h="##" class="x_Page">Page Examples</h2><p class="x_Page">In this section you will find a several full page examples.
</p><p class="x_Page"><strong>The content of these code samples represent the entirity of an HTML file, and
can be put directly into an HTML file.</strong> Note that for HTML Pages, they <em>can
be</em> either embedded in a larger HTML file, or be the entirity of the file. For
Markdown Pages, however, they <em>must be</em> the entirity of the file (that is,
Modulo will not automatically render the Markdown page if there is other HTML
content or Modulo definitions -- you will have to manually do this).
</p><p class="x_Page"></p><h2 h="#####" class="x_Page">Page Example 1 - HTML Page</h2><p class="x_Page"><x-demo show="ui" ui="demo" mode="html" demo="embed" value="<script Modulo src=Modulo.html>
<Component name=Page>
<Style>:host { display: block; background: Pink; }</Style>
</Component>
</script>
<x-Page>
<h1>Lorem ipsum dolor set modulo lorem ipsum moduloum dolor set modulo</h1>
</x-Page>" modulo-mount-html="">
<select style="" name="ui">
<option value="demo">π DEMO</option>
<option value="code">π CODE</option>
<option value="edit">π EDIT</option>
</select>
<iframe srcdoc=" "></iframe>
</x-demo></p><p class="x_Page"></p><h2 h="#####" class="x_Page">Page Example 2 - HTML Page (Static Auto-Import)</h2><p class="x_Page"><x-demo show="ui" ui="demo" mode="html" demo="embed" value="<script src=static/Modulo.html></script>
<x-Page>
<h1>Lorem ipsum dolor set modulo lorem ipsum moduloum dolor set modulo</h1>
</x-Page>" modulo-mount-html="">
<select style="" name="ui">
<option value="demo">π DEMO</option>
<option value="code">π CODE</option>
<option value="edit">π EDIT</option>
</select>
<iframe srcdoc=" "></iframe>
</x-demo></p><p class="x_Page"></p><h2 h="#####" class="x_Page">Page Example 3 - Markdown-HTML Page</h2><p class="x_Page"><x-demo show="ui" ui="demo" mode="html" demo="embed" value="<script src=Modulo.html></script><script type=md>---
NOTE: Modulo will render this with a plain default theme.
example: meta-data
example-multiline:
123
abc
do re mi
example2: More meta data
---
Lorem ipsum dolor set modulo lorem ipsum moduloum dolor set modulo" modulo-mount-html="">
<select style="" name="ui">
<option value="demo">π DEMO</option>
<option value="code">π CODE</option>
<option value="edit">π EDIT</option>
</select>
<iframe srcdoc=" "></iframe>
</x-demo></p><p class="x_Page"></p><h2 h="#####" class="x_Page">Page Example 4 - Markdown-HTML Page (Static Auto-Import)</h2><p class="x_Page"><x-demo show="ui" ui="demo" mode="html" demo="embed" value="<script src=static/Modulo.html></script><script type=md>---
NOTE: The difference is the "static/Modulo.html" above!
example: meta-data
example-multiline:
123
abc
do re mi
example2: More meta data
---
Lorem ipsum dolor set modulo lorem ipsum moduloum dolor set modulo" modulo-mount-html="">
<select style="" name="ui">
<option value="demo">π DEMO</option>
<option value="code">π CODE</option>
<option value="edit">π EDIT</option>
</select>
<iframe srcdoc=" "></iframe>
</x-demo></p><p class="x_Page"></p><h2 h="#####" class="x_Page">Page Example 5 - Markdown-HTML Page (Remote Static Auto-Import)</h2><p class="x_Page"><x-demo show="ui" ui="demo" mode="html" demo="embed" value="<script src=https://modulohtml.org/static/Modulo.html></script><script type=md>---
example: ABC
---
Lorem ipsum dolor set modulo lorem ipsum moduloum dolor set modulo" modulo-mount-html="">
<select style="" name="ui">
<option value="demo">π DEMO</option>
<option value="code">π CODE</option>
<option value="edit">π EDIT</option>
</select>
<iframe srcdoc=" "></iframe>
</x-demo>
</p></div>
</div>
<footer class="page-container x_Page" style="display: flex;">
<div>
<h2>α΅Β°dα΅βo</h2>
</div>
<ul style="display:grid; grid-template-columns: 1fr 1fr; font-size: 1.1rem">
<li><a href="index.html"> Modulo</a></li>
<li><a href="docs/index.html"> Docs</a></li>
<li><a href="playground.html"> Playground</a></li>
<li><a href="about.html"> About</a></li>
<li><a href="https://codeberg.org/modulo/modulo/">Source (Git)</a></li>
<li><a href="https://www.npmjs.com/package/create-modulo">create-modulo (npmjs)</a></li>
</ul>
<div style="margin: auto 10px 10px auto; text-align: right; opacity:0.5">
<p class="x_Page">Sat Apr 18 2026 12:23:22 GMT-0700 (Pacific Daylight Time)</p>
<p class="x_Page">α΅Β°dα΅βo <em>The Modulo Framework</em> Β© <tt title="Michael Bethencourt" class="x_Page">michaelb</tt></p>
<pre title="It is acceptable to link ('bundle') and distribute the Modulo Framework with other code as long as the LICENSE and NOTICE remains intact.">NO WARRANTEE OR IMPLIED UTILITY;
ANY MODIFICATIONS OR DERIVATIVES OF
THE MODULO FRAMEWORK MUST BE LGPLv3+</pre>
</div>
</footer></body></html>