93 lines
2.1 KiB
HTML
93 lines
2.1 KiB
HTML
<link rel="stylesheet" href="page/style.css">
|
|
|
|
<script type="module" src="page/codeblock.js"></script>
|
|
|
|
<h1>DarkWiiPlayer/JS</h1>
|
|
<p>A JavaScript <em>micro-framework</em> to make front-end <em>easier</em></p>
|
|
|
|
<p>Note: <b>This website is still work in progress!</b></p>
|
|
|
|
<section>
|
|
<h2>Skooma.js</h2>
|
|
|
|
<p>
|
|
Skooma lets you <strong>generate DOM nodes in JavaScript</strong>.
|
|
</p>
|
|
|
|
<p>
|
|
<h3 class="all-unset"><b>Code Sample</b>:</h3>
|
|
<code-block>
|
|
import {html} from 'skooma.js'
|
|
|
|
let div = html.div([
|
|
html.h1('Hello, World!'),
|
|
html.p('Here is some text', {class: ["class_a", "class_b"]})
|
|
html.button("Click Me!", { click: event => console.log(event) })
|
|
])
|
|
</code-block>
|
|
</p>
|
|
|
|
<a class="button" href="page/skooma.html">Read more</a>
|
|
</section>
|
|
|
|
<section>
|
|
<h2>Element</h2>
|
|
<p>
|
|
A helper function that adds many convenient features to classes for custom elements.
|
|
</p>
|
|
|
|
<p>
|
|
<h3 class="all-unset"><b>Code Sample</b>:</h3>
|
|
<code-block>
|
|
import element from 'element.js'
|
|
|
|
element(class MyElement extends HTMLElement {
|
|
static attributes = { foo: true }
|
|
fooChanged(oldFoo, newFoo) {
|
|
console.log(`Foo changed from ${oldFoo} to ${newFoo}`)
|
|
render()
|
|
}
|
|
$render() { /* ... */ }
|
|
})
|
|
</code-block>
|
|
</p>
|
|
|
|
<a class="button" href="page/element.html">Read More</a>
|
|
</section>
|
|
|
|
<section>
|
|
<h2>Listener</h2>
|
|
<p>
|
|
Like a normal object, except you can register callbacks for property changes.
|
|
</p>
|
|
|
|
<p>
|
|
<h3 class="all-unset"><b>Code Sample</b>:</h3>
|
|
<code-block>
|
|
import listener from 'listener.js'
|
|
|
|
const user = listener({name: "John Doe"})
|
|
user.listen('name', value => console.warn(`User name has changed to ${value}`))
|
|
</code-block>
|
|
</p>
|
|
|
|
<a class="button" href="page/listener.html">Read More</a>
|
|
</section>
|
|
|
|
<section>
|
|
<h2>Debounce</h2>
|
|
<p>
|
|
Debounces data like user input or events that can occur in a burst.
|
|
</p>
|
|
|
|
<p>
|
|
<h3 class="all-unset"><b>Code Sample</b>:</h3>
|
|
<code-block>
|
|
import debounce from 'debounce.js'
|
|
|
|
input.addEventListener("change", debounce(event => update(input.value)))
|
|
</code-block>
|
|
</p>
|
|
|
|
<a class="button" href="page/debounce.html">Read More</a>
|
|
</section>
|