2.0.5 • Published 6 months ago

@theofficialurban/svelte-bicycle v2.0.5

Weekly downloads
-
License
-
Repository
-
Last release
6 months ago

Svelte Bicycle Cards 🃏

Basic Example

This is a work in progress, and my first package, thank you

I'm working on a card game project if you're interested in following along, I'm on a journey learning as much as possible. The card game project docs are here and the game should be up soon!

Static Badge

Static Badge

<script lang="ts">
	import * as Bicycle from "@theofficialurban/svelte-bicycle";
	import { SvelteComponent } from "svelte";
	export class App extends SvelteComponent<{}, {}, {}> {}
	const deck = Bicycle.DeckBuilder.newDeck();
	// or
	// const deck = new Bicycle.BicycleCardDeck();

	deck.createCards(2, { pair: true });
	const store = deck.getDeck();
</script>

<div>
	{#each $store as { flip, store, id } (id)}
	<Bicycle.Component
		store="{store}"
		on:click="{flip}"
	/>
	{/each}
</div>