An open API service indexing awesome lists of open source software.

https://github.com/Kamide/marquee-element


https://github.com/Kamide/marquee-element

javascript web-components

Last synced: over 1 year ago
JSON representation

Awesome Lists containing this project

README

          

# marquee-element

MarqueeElement is a vanilla web component implementation of the now deprecated HTMLMarqueeElement using shadow DOM, templates, slots, constructable style sheets, CSS animations, and ResizeObserver.

## Attributes and Properties

| Attribute | Property | Type | Reflected | Description |
| ----------- | ----------- | --------- | --------- | --------------------------------------------------------------------------------------------------------------- |
| `disabled` | `disabled` | `Boolean` | Yes | Disables animations when attribute is present or property is `true`. |
| `multiline` | `multiline` | `Boolean` | Yes | Enables word wrapping when attribute is present or property is `true`. |
| `pausable` | `pausable` | `Boolean` | Yes | Pauses animation on hover when attribute is present or property is `true`. |
| `threshold` | `threshold` | `Number` | Yes | When a positive number is given, slotted elements will animate if and only if they overflow the host container. |

## CSS Variables

| Variable | Type | Default | Read | Write |
| ----------------------------------- | ---------------------------------------------------------------------------------------------------------- | ---------------- | ---- | ----- |
| `--marquee-element-animation` | `scroll-left \| scroll-right \| scroll-top \| scroll-bottom \| alternate-horizontal \| alternate-vertical` | `scroll-left` | Yes | Yes |
| `--marquee-element-duration` | `

Overriding `--marquee-element-width` or `--marquee-element-height` is not recommended.

## Parts

| Identifier | Description |
| ---------- | ----------------------------------------------- |
| `frame` | Overflow container for the animation container. |
| `marquee` | Animation container for slotted elements. |

## Demo

https://kamide.github.io/marquee-element/