2020-10-27 15:28:02 +00:00
|
|
|
DarkWiiPlayer/JS
|
|
|
|
================================================================================
|
|
|
|
|
|
|
|
A collection of general-purpose Javascript snippets/modules that I end up
|
|
|
|
copy-pasting around more often than necessary.
|
2021-08-16 17:40:03 +00:00
|
|
|
|
|
|
|
---
|
|
|
|
|
|
|
|
So what does it all do?
|
|
|
|
|
2022-07-01 08:02:18 +00:00
|
|
|
## Skooma
|
2021-08-16 17:40:03 +00:00
|
|
|
|
2022-07-01 08:02:18 +00:00
|
|
|
Generate HTML and SVG DOM nodes more easily and do stuff with them. Feels like
|
|
|
|
an in-between of using a templating language and writing lisp code. Overall very
|
|
|
|
recommendable.
|
2021-08-16 17:40:03 +00:00
|
|
|
|
2022-03-10 04:59:59 +00:00
|
|
|
## Element
|
|
|
|
|
|
|
|
the second iteration of improved `HTMLElement` but this time in a function to
|
|
|
|
support inheriting from other classes for extending builtin elements.
|
|
|
|
|
2021-08-16 17:40:03 +00:00
|
|
|
## CSS
|
|
|
|
|
|
|
|
Generate CSS from JS objects. Yes, you can generate CSS from JSON now. Or from
|
|
|
|
YAML. Or from whatever you want, really.
|
|
|
|
|
|
|
|
## Listener
|
|
|
|
|
|
|
|
A proxy object that fires a callback when certain (or all) properties are
|
|
|
|
changed.
|
|
|
|
|
2021-09-13 17:51:57 +00:00
|
|
|
## Speaker
|
|
|
|
|
|
|
|
Simple messaging helper that uses microtasks by default.
|
|
|
|
|
2022-07-01 08:02:18 +00:00
|
|
|
## Debounce
|
2021-08-16 17:40:03 +00:00
|
|
|
|
2022-07-01 08:02:18 +00:00
|
|
|
Debouncing wrapper for functions to avoid repeated execution of expensive code.
|
2021-08-16 17:40:03 +00:00
|
|
|
|
|
|
|
## Template
|
|
|
|
|
|
|
|
Turns template literals directly into HTML templates. Just read the code, it's
|
|
|
|
like 5 lines or so.
|
2021-09-20 09:35:31 +00:00
|
|
|
|
|
|
|
## Storage
|
|
|
|
|
|
|
|
Currently a sngle class `ObjectStorage` implementing the API of the Storage
|
|
|
|
class using a plain JS Map as backend. This is mostly meant as a page-local
|
2022-07-01 08:02:18 +00:00
|
|
|
fallback to LocalStorage and SessionStorage.
|
|
|
|
|
|
|
|
## Use
|
|
|
|
|
|
|
|
Allows you to apply code to HTML elements by looking for a `use` attribute and
|
|
|
|
running it as code on the element.
|
|
|
|
|
|
|
|
## Pqueue
|
|
|
|
|
|
|
|
Ensures in-order promise resolution and optionally limits parallel execution.
|