3.1.0 • Published 10 months ago

@288-toolkit/marquee v3.1.0

Weekly downloads
-
License
MIT
Repository
-
Last release
10 months ago

Marquee

pnpm i @288-toolkit/marquee

A css animated generic marquee component.

Props

--gap

Should be set as a css variable.

To make a seamless marquee effect, the component generates whatever is in the slot twice or more. The gap property represents the space between the copies. Default: 0.

--speed

Should be set as a css variable.

The marquee animation duration, which determines the speed of the marquee. The higher the number, the slower the marquee. Default: 12000ms.

direction

The direction of the marquee.

export let direction: 'natural' | 'inverted' = 'natural';

orientation

The orientation of the marquee. Default: horizontal.

export let orientation: 'vertical' | 'horizontal' = 'horizontal';

stopOnHover

Whether the marquee should pause when hovered. Default: false.

export let stopOnHover = false;

Slot props

  • copy (boolean): Wether the rendered slot is a copy of the original.

Example

<script lang="ts">
	import { Marquee } from '@288-toolkit/marquee';
</script>

<section>
	<Marquee direction="natural" stopOnHover>
		{#each ['200/300?1', '200/300?2', '200/300?3', '200/300?4', '200/300?5'] as image}
			<img src="http://placekitten.com/{image}" alt="" />
		{/each}
	</Marquee>
</section>

<style>
	section {
		--gap: 2rem;
		--speed: 40000ms;
	}

	@screen lg {
		section {
			--gap: 4rem;
			--speed: 20000ms;
		}
	}
</style>
3.1.0

10 months ago

3.0.1

1 year ago

3.0.0

1 year ago

2.0.1

1 year ago

2.0.0

1 year ago

1.0.1

1 year ago

1.0.0

1 year ago