No description
Find a file
2025-12-04 08:57:25 +01:00
.editorconfig Add project meta files 2024-08-26 15:56:47 +02:00
ColorSchemeSwitcher.js Further refactor color scheme switcher 2024-08-27 10:33:58 +02:00
ImageCarousel.js Add controls part to carousel 2023-03-01 09:43:25 +01:00
jsconfig.json Add project meta files 2024-08-26 15:56:47 +02:00
ParallaxTracker.js Add ParallaxTracker class to track scrolling 2023-07-10 15:43:09 +02:00
ProofOfWork.js Add proof of work component 2022-06-07 16:36:23 +02:00
readme.md Add jsdelivr badge to readme 2023-03-01 09:50:47 +01:00
svg-bubbles.js Add SVG-Bubbles component 2025-12-04 08:57:25 +01:00
TypeWriter.js Fix typing and erasing of multi-byte characters 2023-02-15 20:46:47 +01:00

DarkWiiPlayer/components

A collection of self-contained custom elements that do somewhat complex things inside a website.

TypeWriter

<type-writer wait=1 type=0.1 back=0.06>
    <span>Some text to type</span>
</type-writer>

Control attributes:

  • wait: Time in seconds to wait after typing out the text before erasing.
  • type: The time in seconds between typing each character.
  • back: The time in seconds between erasing each character.
<type-writer>
    <span>Markup is <b>supported</b></span>
</type-writer>

Contents aren't typed out as HTML but as text, with nested DOM-nodes being created as needed. In other words, you can put more complex HTML inside of the type-writer items and it'll "just work". This hasn't been tested with any super-crazy layouts though.

<type-writer>
    <span>Cool</span>,
    <span>Great</span> and
    <span>Awesome</span>
</type-writer>

top-level text tags inside the type-writer light DOM are ignored, so you can put some text in between as a fallback. In the example above, if the TypeWriter element fails somehow, the user will see a comma-separted list of items.

<type-writer>
    <span>Cool</span>
    <template>Great</template>
    <template>Awesome</template>
</type-writer>

You can also put your content into templates, so in case the component can't be loaded, the user will just see the first item as static text.

ImageCarousel

A simple image carousel that scrolls through a list of images, then scrolls back to the start.

<image-carousel interval="3000">
    <img src="https://picsum.photos/1920/1080?random&1">
    <img src="https://picsum.photos/1020/1080?random&2">
    <img src="https://picsum.photos/1220/680?random&3">
</image-carousel>