├── .gitignore
├── LICENSE
├── MIT
├── MIT-0
├── README.md
├── docs
├── cal.png
├── chat.png
├── demos
│ ├── dialog
│ │ ├── always.html
│ │ ├── index.html
│ │ └── once.html
│ ├── edit
│ │ ├── field.html
│ │ └── index.html
│ ├── hello
│ │ ├── greeting.html
│ │ └── index.html
│ └── tabs
│ │ ├── cat.html
│ │ ├── dog.html
│ │ ├── horse.html
│ │ └── index.html
├── extensions
│ ├── index.html
│ ├── loader
│ │ ├── content.html
│ │ └── index.html
│ ├── multitarget
│ │ ├── content.html
│ │ └── index.html
│ ├── no-history
│ │ ├── cat.html
│ │ ├── dog.html
│ │ └── index.html
│ ├── repeat-gets
│ │ ├── content.html
│ │ └── index.html
│ ├── swap-template
│ │ ├── add.html
│ │ ├── delete.html
│ │ └── index.html
│ └── unwrap-template
│ │ ├── index.html
│ │ └── rows.html
├── favicon.png
├── footer.js
├── index.html
├── style.css
└── todo.png
├── examples
├── cf_clean_target_tabs
│ ├── cat.html
│ ├── dog.html
│ ├── horse.html
│ ├── index.html
│ ├── style.css
│ ├── worker.js
│ └── wrangler.toml
├── html_clean_target_tabs
│ ├── cat.html
│ ├── dog.html
│ ├── horse.html
│ ├── index.html
│ └── style.css
├── html_tabs
│ ├── cat.html
│ ├── dog.html
│ ├── horse.html
│ ├── iframe.html
│ ├── index.html
│ └── style.css
├── index.html
├── js_simple_error_handling
│ ├── cat1.jpg
│ ├── cat2.jpg
│ ├── cat3.jpg
│ ├── index.html
│ ├── slide1.html
│ ├── slide2.html
│ ├── slide3.html
│ └── style.css
├── node_chat
│ ├── index.html
│ ├── index.js
│ └── server.js
├── php_calendar
│ ├── create_event.php
│ ├── date.php
│ ├── delete_event.php
│ ├── event.php
│ ├── index.php
│ ├── month.php
│ ├── style.css
│ └── util
│ │ ├── color.php
│ │ ├── persist.php
│ │ └── props.php
├── php_dialog
│ ├── index.php
│ ├── picker.php
│ └── style.css
├── php_new_tab_detection
│ ├── content.php
│ ├── footer.php
│ ├── index.php
│ ├── prelude.php
│ └── style.css
├── php_todo
│ ├── clear.php
│ ├── create.php
│ ├── edit.php
│ ├── index.php
│ └── style.css
├── run_servers.sh
└── style.css
├── glitch.json
├── htmz.dev.html
├── htmz.html
└── npx
├── .gitignore
├── README.md
├── index.js
├── package-lock.json
└── package.json
/.gitignore:
--------------------------------------------------------------------------------
1 | node_modules
2 |
--------------------------------------------------------------------------------
/LICENSE:
--------------------------------------------------------------------------------
1 | - Files in this repo are MIT licensed (see `/MIT`), except:
2 | - The code in the files `/htmz.html` and `/htmz.dev.html` are licensed under MIT-0 (see `/MIT-0`). No attribution needed to copy these snippets.
3 |
--------------------------------------------------------------------------------
/MIT:
--------------------------------------------------------------------------------
1 | MIT License
2 |
3 | Copyright 2024 Lean Rada
4 |
5 | Permission is hereby granted, free of charge, to any person obtaining a copy
6 | of this software and associated documentation files (the "Software"), to deal
7 | in the Software without restriction, including without limitation the rights
8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9 | copies of the Software, and to permit persons to whom the Software is
10 | furnished to do so, subject to the following conditions:
11 |
12 | The above copyright notice and this permission notice shall be included in all
13 | copies or substantial portions of the Software.
14 |
15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21 | SOFTWARE.
22 |
--------------------------------------------------------------------------------
/MIT-0:
--------------------------------------------------------------------------------
1 | MIT No Attribution
2 |
3 | Copyright 2024 Lean Rada
4 |
5 | Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so.
6 |
7 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
--------------------------------------------------------------------------------
/README.md:
--------------------------------------------------------------------------------
1 | # htmz
2 |
3 | _a low power tool for html_
4 |
5 | htmz is a minimalist HTML microframework that gives you the power to create dynamic web user interfaces with the familiar simplicity of **plain HTML**.
6 |
7 | Zero dependencies. Zero JS bundles to load. Not even a backend is required. _Just an inline HTML snippet_.
8 |
9 | See the [documentation website](https://kalabasa.github.io/htmz) for more details, usage, examples, and more.
10 |
11 | ## Installing
12 |
13 | Simply copy the following snippet into your page.
14 |
15 |
16 | ```html
17 |
18 | ```
19 |
20 |
21 | ## What does it do?
22 |
23 | htmz does one thing and one thing only.
24 |
25 | - Enable you to load HTML resources within _any element_ in the page.
26 |
27 | Imagine clicking a link, but instead of reloading the whole page, it only updates a relevant portion of the page. Think tabbed UIs, dual-pane list-detail layouts, dialogs, in-place editors, and the like.
28 |
29 | **htmz is a generalisation of HTML frames.** — Load HTML resources within ~~any frame~~ _any element_ in the page.
30 |
--------------------------------------------------------------------------------
/docs/cal.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Kalabasa/htmz/eec36a7245d60b3514c74d274d59a0618c5e2141/docs/cal.png
--------------------------------------------------------------------------------
/docs/chat.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Kalabasa/htmz/eec36a7245d60b3514c74d274d59a0618c5e2141/docs/chat.png
--------------------------------------------------------------------------------
/docs/demos/dialog/always.html:
--------------------------------------------------------------------------------
1 |
3 | Felis est animalis elegantissimum et misteriosum. Felis est
4 | quadrupes, sed parvus et gracilis. Habent corpora flexilia et caudam longam.
5 | Oculi eorum sunt acuti et vigilantes, quae adiuvant eos in venatione. Felium
6 | natura est curiosa et independens, saepe explorans loca nova et exspectans
7 | tempus opportunitatis ad venandum. Multae sunt species felium, ab domesticis
8 | ad agrestes, et varietas colorum eorum est mirabilis. In multis culturis,
9 | felis est considerata animal domesticum, adfertque suavitatem et companiam
10 | in domum hominum.
11 |
3 | Canis est animalis fidelis et amicus hominis. Canes sunt
4 | quadrupedes et pertingunt in multas formas et magnitudines. Exemplum, lupus
5 | est genus canis, sed domesticus canis est proximus amicus hominis. Canis
6 | habet olfactum acutum et auditum bonum, quod facit eum aptum ad custodiendum
7 | et adiuvandum hominem. Multa genera canum existunt, ab parvis et mollibus
8 | usque ad magnos et fortes. In multis culturis, canis est consideratus non
9 | solum animal domesticum sed etiam amicum fidelissimum.
10 |
3 | Equus est animal nobilissimum et robustum. Equi sunt
4 | quadrupedes, magni et fortes. Habent crura longa et caudam fluam. Equi sunt
5 | celeres et agiles, idonei ad currum et vecturam. Oculi eorum sunt magni et
6 | vivaces, et auribus acutis auditum excellentem habent. Equi fuerunt auro
7 | pugnandi et trahendi plaustra ab antiquis temporibus, et usque ad hodiernum
8 | diem, sunt valde utiles in agris, in cursibus et in equestri exercitatione.
9 | Equi sunt etiam amici fideles hominum, qui saepe sunt asserunt sicut
10 | coniuncti socii in multis laboribus et gaudiis.
11 |
12 |
Hey! Try your browser back button! It works natively!
2 | Operation successful!
3 | Lorem ipsum dolor sit amet, consectetur adipiscing elit. Hoc est exemplum
4 | multitarget, vel "update extra ordinem" ut vocant.
5 |
2 | Felis est animalis elegantissimum et misteriosum. Felis est quadrupes, sed parvus et gracilis. Habent corpora flexilia et caudam longam. Oculi eorum sunt acuti et vigilantes, quae adiuvant eos in venatione. Felium natura est curiosa et independens, saepe explorans loca nova et exspectans tempus opportunitatis ad venandum. Multae sunt species felium, ab domesticis ad agrestes, et varietas colorum eorum est mirabilis. In multis culturis, felis est considerata animal domesticum, adfertque suavitatem et companiam in domum hominum.
3 |
2 | Canis est animalis fidelis et amicus hominis. Canes sunt quadrupedes et pertingunt in multas formas et magnitudines. Exemplum, lupus est genus canis, sed domesticus canis est proximus amicus hominis. Canis habet olfactum acutum et auditum bonum, quod facit eum aptum ad custodiendum et adiuvandum hominem. Multa genera canum existunt, ab parvis et mollibus usque ad magnos et fortes. In multis culturis, canis est consideratus non solum animal domesticum sed etiam amicum fidelissimum.
3 |
26 | Normally, browsers cache GET requests to the same URL in an iframe. This
27 | extension allows you to skip that behavior and make repeated GET requests to
28 | the same URL.
29 |
54 | Sometimes it would be nice to be able to preserve the target element
55 | or its children in the DOM tree. This extension allows you to do just that by using HTML
56 | fragments wrapped in
57 | <template>
62 | tags and
63 | <slot> elements within them.
68 |
69 |
<slot>
Represents the original element as is
70 |
<slot>...some new content</slot>
Represents the original element
71 | with its children replaced with some new content
72 |
<slot name="children">
Represents the original element child nodes
73 |
74 |
75 |
76 | The example below demonstrates a simple editable list implemented using this extension features.
77 |
28 | Certain HTML elements have restrictions on what type of parent element they
29 | can be in. For example, a <tr> requires a
30 | <table> parent [or a t(head|body|foot)]. Simply
31 | sending tr on its own is illegal.
32 |
33 |
34 | The native solution to represent HTML fragments is the
35 | <template>
40 | tag. Elements that would otherwise be illegal on their own can be parsed
41 | legally inside a template tag.
42 |
43 |
44 | This extension facilitates the above approach by unwrapping a top-level
45 | template element in the response.
46 |
23 | htmz is a minimalist HTML microframework for creating interactive
24 | and modular web user interfaces with the familiar simplicity of
25 | plain HTML.
26 | [GitHub]
27 |
28 |
29 |
30 |
31 |
32 |
plain🍦
33 |
34 | Use straight up HTML. No supersets. No hz- ng- hx- v- w- x-; no
35 | special attributes. No DSLs. No <custom-elements>.
36 | Just vanilla HTML.
37 |
38 |
39 |
40 |
lightweight🪶
41 |
42 | 166 bytes in total. Zero dependencies. Zero JS
43 | bundles to load. Not even a backend is required.
44 | Just an inline HTML snippet.
45 |
46 |
47 |
48 |
nofilter⚡
49 |
50 | No preventDefaults. No hidden layers. Real DOM, real interactions. No
51 | VDOM, no click listeners. No AJAX, no fetch.
52 | No reinventing browsers.
53 |
54 |
55 |
56 |
57 |
58 |
59 | In a nutshell, htmz lets you swap page fragments on request using
60 | vanilla HTML.
61 |
62 |
63 | Imagine clicking a link, but instead of reloading the whole page, it
64 | only updates the relevant portion of the page.
65 |
66 |
67 | htmz is an experiment inspired by
68 | htmx,
69 | Comet, ‘HTML As The Engine Of Application State’[1][2], and
78 | other similar web application architectures.
79 |
80 |
81 |
82 |
83 |
Demos
84 |
Check out these demos to get an idea of what htmz can do!
124 | For npm enjoyers, use the following npm commands to
125 | automate the simple process of copying the snippet. For maximum
126 | npm enjoyment, this npm package contains 25 bonus dependencies!
127 |
177 | While this looks like an abuse of the URL fragment (it is), there is no
178 | other use for the URL fragment in this context, so it was repurposed as
179 | the destination ID selector. And it already looks like a CSS ID
180 | selector.
181 |
182 |
183 | ⚠ Important note: The loaded content
184 | replaces the selected destination. It may not be
185 | intuitive at first, but htmz does not insert the content into
186 | the destination. The rationale is that replacement is a more powerful
187 | operation. With replacement, you can replace,
188 | delete (replace with nothing), and insert-into (replace
189 | with the same container as original).
190 |
191 |
192 |
193 |
194 |
What does it do exactly?
195 |
htmz does one thing and one thing only.
196 |
197 |
198 | Load HTML onto any element in the page on request.
199 |
200 |
201 |
202 | Think tabbed UIs, dual-pane list-detail layouts, dialogs, in-place
203 | editors, and the like.
204 |
205 |
206 | This idea is not new. Dividing web pages into independently
207 | reloading parts has been a thing since mid-1990s. They were called
208 | frames, namely, <iframe>s, <frame>s, and <frameset>s.
213 |
214 |
215 | htmz is a generalisation of HTML frames. — Load
216 | HTML resources within any frame any element in the
217 | page.
218 |
219 |
220 | Read more on how it works in a section
221 | below.
222 |
223 |
224 |
225 |
226 |
Examples
227 |
228 |
229 |
230 |
231 |
232 |
233 | More example applications, componentization approaches, and code in
234 | different languages can be found in the
235 | /examples directory. To start the example server:
236 |
237 |
cd examples
239 | ./run_servers.sh
241 |
Then load http://localhost:3000/.
242 |
243 |
244 |
245 |
Advanced usage
246 |
247 | Naturally, only <a> and <form> elements
248 | can target and invoke htmz (as of current HTML5). This is fine; it’s
249 | semantic, after all. However, HTML offers a couple more features that
250 | work well with htmz.
251 |
252 |
253 |
254 |
Per-button action & target
255 |
256 | If you want to override the form’s action on a per-button basis, use
257 | the
258 | <button>’s
259 | formaction
264 | attribute.
265 |
338 | What if the user opens an htmz link in a new tab? Well, they would be
339 | loading your page fragment, carefully designed to be injected into an
340 | exsting page, on its own!
341 |
342 |
343 | Using the
344 | Sec-Fetch-Dest
349 | header, you can
350 | fall back to a full page
355 | in these cases. This header lets the server know the request’s
356 | destination and render either a fragment or a full page
357 | appropriately.
358 |
359 |
360 |
361 |
362 |
Scripting / interactivity
363 |
364 | If you need something more interactive than the request-response
365 | model, you may try the htmz companion scripting language:
366 | javazcript. Sorry, I meant JavaScript, a scripting language
367 | designed to make HTML interactive.
368 |
369 |
370 | htmz does not preclude you writing JS or using UI libraries to enhance
371 | interaction. You could, say, enhance a single form control with
372 | vanillaJS, but
373 | the form
374 | values
375 | could still be submitted as a regular HTTP form with htmz.
376 |
377 |
That said, htmz is extensible!
378 |
379 |
380 |
381 |
382 |
Extensibility
383 |
384 | Need advanced selectors? Need error handling? Multiple targets? Fear
385 | not; the hero is here to save the day. The hero is you.
386 |
387 |
388 | Here’s
389 | the development version of the snippet. Feel free to hack and extend according to your needs. You’re a
394 | programmer, right?
395 |
396 |
<script>
398 | function htmz(frame) {
399 | // Write your extensions here
400 |
401 | // Remove setTimeout to let the browser autoscroll content changes into view
402 | setTimeout(() =>
403 | document
404 | .querySelector(frame.contentWindow.location.hash || null)
405 | ?.replaceWith(...frame.contentDocument.body.childNodes)
406 | );
407 | }
408 | </script>
409 | <iframe hidden name=htmzonload="htmz(this)"></iframe>
411 |
412 |
413 | Pre-written extensions are now available in the
414 | Extensions 🍱 page.
415 |
416 |
417 |
418 |
419 |
420 |
FAQ
421 |
422 |
423 |
How does it work?
424 |
425 | htmz is an iframe named "htmz". You invoke htmz by loading a
426 | URL into the iframe via target=htmz. By using an iframe, we lean on
427 | the browser’s native capability to fetch the URL and parse the HTML.
428 | After loading the HTML resource, we take the resulting DOM via an
429 | onload handler.
430 |
431 |
htmz is essentially a proxy target.
432 |
433 | Like how a proxy server forwards requests to some specified server,
434 | proxy target htmz forwards responses into some specified target.
435 |
446 | When you load a URL into the htmz iframe, the onload handler kicks in.
447 | It extracts your destination ID selector from the URL hash fragment
448 | and transplants the iframe’s contents (now containing the loaded HTML
449 | resource) into your specified destination.
450 |
451 |
452 | htmz only runs when you invoke it. It does not continually parse your
453 | DOM and scan it for special attributes or syntax, nor does it attach
454 | listeners in your DOM. It’s a proxy not a VPN.
455 |
456 |
457 |
458 |
459 |
So it’s just another JavaScript framework?
460 |
Oh my! Not the f-word!!!
461 |
462 | On a more serious note, I would say that rather than a JS one, it’s
463 | more of an HTML micro-f*******k. It does use JS, but only the minimum
464 | necessary.
465 |
466 |
467 |
468 |
469 |
Is htmz a library or a framework?
470 |
htmz is a snippet. ✂️
471 |
472 |
473 |
474 |
What does htmz mean?
475 |
476 | HTMZ stands for
477 |
478 | Html with Targeted Manipulation Zones.
479 |
480 |
481 |
482 |
483 |
484 |
Is this a joke?
485 |
486 | This started as a
487 |
488 | “Do I really need htmx? Can’t I do the load-link-into-target thing
489 | with current web? Sounds a lot like frames.”
490 |
491 | and ended up with this.
492 |
493 |
494 | So, it isn’t quite a joke, but a response to htmx. I wanted to try
495 | htmx. The premise sounded great (Why should you only be able to replace the entire screen?), then I saw that it was 16kB of JavaScript. Huh. Then there’s
498 | special syntax everywhere. Huh. I don’t want to learn a whole new set
499 | of instructions and Turing-complete DSLs specific to those
500 | instructions.
501 |
502 |
503 | Regardless of joke status, htmz seems fine as a library. It feels
504 | kinda powerful for its tiny size. (But really it’s the browser that’s
505 | doing the heavy lifting!) Nonetheless, there are limitations.
506 |
507 |
508 |
509 |
510 |
What are the limitations?
511 |
512 | The main direct limitation is having only one destination per
513 | response. However, this can be fixed by writing an extension. ;)
514 |
515 |
516 | A more general but classic limitation is the request-response model.
517 | The Web 1.0 model, and the baggage that comes with it. Like a
518 | roundtrip delay on every interaction, a browser history entry on every
519 | click, etc.
520 |
521 |
522 | The Web 1.0 model might also mean putting more UI logic in the web
523 | server. This can be a good thing or a bad thing, as it could lead to
524 | either consolidation or fragmentation of UI logic, which respectively
525 | decreases or increases complexity. It really depends on your goal and
526 | style.
527 |
528 |
529 | Lastly, this is not a templating library! No HTML imports or
530 | client-side includes.
531 |
3 | Felis est animalis elegantissimum et misteriosum. Felis est quadrupes, sed parvus et gracilis. Habent corpora flexilia et caudam longam. Oculi eorum sunt acuti et vigilantes, quae adiuvant eos in venatione. Felium natura est curiosa et independens, saepe explorans loca nova et exspectans tempus opportunitatis ad venandum. Multae sunt species felium, ab domesticis ad agrestes, et varietas colorum eorum est mirabilis. In multis culturis, felis est considerata animal domesticum, adfertque suavitatem et companiam in domum hominum.
4 |
3 | Canis est animalis fidelis et amicus hominis. Canes sunt quadrupedes et pertingunt in multas formas et magnitudines. Exemplum, lupus est genus canis, sed domesticus canis est proximus amicus hominis. Canis habet olfactum acutum et auditum bonum, quod facit eum aptum ad custodiendum et adiuvandum hominem. Multa genera canum existunt, ab parvis et mollibus usque ad magnos et fortes. In multis culturis, canis est consideratus non solum animal domesticum sed etiam amicum fidelissimum.
4 |
3 | Equus est animal nobilissimum et robustum. Equi sunt quadrupedes, magni et fortes. Habent crura longa et caudam fluam. Equi sunt celeres et agiles, idonei ad currum et vecturam. Oculi eorum sunt magni et vivaces, et auribus acutis auditum excellentem habent. Equi fuerunt auro pugnandi et trahendi plaustra ab antiquis temporibus, et usque ad hodiernum diem, sunt valde utiles in agris, in cursibus et in equestri exercitatione. Equi sunt etiam amici fideles hominum, qui saepe sunt asserunt sicut coniuncti socii in multis laboribus et gaudiis.
4 |
2 | Felis est animalis elegantissimum et misteriosum. Felis est quadrupes, sed parvus et gracilis. Habent corpora flexilia et caudam longam. Oculi eorum sunt acuti et vigilantes, quae adiuvant eos in venatione. Felium natura est curiosa et independens, saepe explorans loca nova et exspectans tempus opportunitatis ad venandum. Multae sunt species felium, ab domesticis ad agrestes, et varietas colorum eorum est mirabilis. In multis culturis, felis est considerata animal domesticum, adfertque suavitatem et companiam in domum hominum.
3 |
2 | Canis est animalis fidelis et amicus hominis. Canes sunt quadrupedes et pertingunt in multas formas et magnitudines. Exemplum, lupus est genus canis, sed domesticus canis est proximus amicus hominis. Canis habet olfactum acutum et auditum bonum, quod facit eum aptum ad custodiendum et adiuvandum hominem. Multa genera canum existunt, ab parvis et mollibus usque ad magnos et fortes. In multis culturis, canis est consideratus non solum animal domesticum sed etiam amicum fidelissimum.
3 |
2 | Equus est animal nobilissimum et robustum. Equi sunt quadrupedes, magni et fortes. Habent crura longa et caudam fluam. Equi sunt celeres et agiles, idonei ad currum et vecturam. Oculi eorum sunt magni et vivaces, et auribus acutis auditum excellentem habent. Equi fuerunt auro pugnandi et trahendi plaustra ab antiquis temporibus, et usque ad hodiernum diem, sunt valde utiles in agris, in cursibus et in equestri exercitatione. Equi sunt etiam amici fideles hominum, qui saepe sunt asserunt sicut coniuncti socii in multis laboribus et gaudiis.
3 |
2 | Felis est animalis elegantissimum et misteriosum. Felis est quadrupes, sed parvus et gracilis. Habent corpora flexilia et caudam longam. Oculi eorum sunt acuti et vigilantes, quae adiuvant eos in venatione. Felium natura est curiosa et independens, saepe explorans loca nova et exspectans tempus opportunitatis ad venandum. Multae sunt species felium, ab domesticis ad agrestes, et varietas colorum eorum est mirabilis. In multis culturis, felis est considerata animal domesticum, adfertque suavitatem et companiam in domum hominum.
3 |
2 | Canis est animalis fidelis et amicus hominis. Canes sunt quadrupedes et pertingunt in multas formas et magnitudines. Exemplum, lupus est genus canis, sed domesticus canis est proximus amicus hominis. Canis habet olfactum acutum et auditum bonum, quod facit eum aptum ad custodiendum et adiuvandum hominem. Multa genera canum existunt, ab parvis et mollibus usque ad magnos et fortes. In multis culturis, canis est consideratus non solum animal domesticum sed etiam amicum fidelissimum.
3 |
2 | Equus est animal nobilissimum et robustum. Equi sunt quadrupedes, magni et fortes. Habent crura longa et caudam fluam. Equi sunt celeres et agiles, idonei ad currum et vecturam. Oculi eorum sunt magni et vivaces, et auribus acutis auditum excellentem habent. Equi fuerunt auro pugnandi et trahendi plaustra ab antiquis temporibus, et usque ad hodiernum diem, sunt valde utiles in agris, in cursibus et in equestri exercitatione. Equi sunt etiam amici fideles hominum, qui saepe sunt asserunt sicut coniuncti socii in multis laboribus et gaudiis.
3 |
This is a simple tabbed UI example. Click on any of the tabs below.
7 |
8 |
The structure is very similar to an iframe implementation, except now the container can have a dynamic size and the content uses the same context and styles as the main page.
9 |
10 |
Back navigation & history works. Because these are native HTML links (<a>) that work normally. No listeners, no JS, no hijacking of normal web browser web browsing.
Because switching months would replace the current month’s HTML with the new month’s HTML, there was a need to store application state beyond the confines of HTML. Thus, application data is persisted in cookies.
13 |
14 |
This application was implemented using a componentized approach. See util/props.php for the API.
See picker.php. It represents a stateful UI component, but no state is stored server-side! The HTML is the state.
9 |
10 |
One limitation of dialogs is that you can’t have a modal dialog in pure HTML. You would have to do it the normal way (that is, client-side scripting for highly-interactive elements).
11 |
12 |
Back navigation & history works, surprisingly. You can ‘time travel’ through application state natively using your browser’s history. But for real, I feel like this would only work for simple UIs (like a single target).