Skip to content

Commit

Permalink
Vanilla (#16)
Browse files Browse the repository at this point in the history
* Push

* Push

* Bikeshed

* Simplify!

* Fix up

* Add chabgeset

* Update documentation, scripts

* Add docs about await confetti.explopde

* Inline documentation

* Changes

* Version bump
  • Loading branch information
PuruVJ committed Dec 19, 2023
1 parent 06a99f2 commit 01a3b51
Show file tree
Hide file tree
Showing 21 changed files with 1,052 additions and 118 deletions.
7 changes: 7 additions & 0 deletions .changeset/slow-mirrors-rescue.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
---
'@neoconfetti/svelte': minor
'@neoconfetti/core': minor
'@neoconfetti/vue': minor
---

Fixes, setting any option to undefined reverts it to default value, more fine grained reactivity. If the particlesCount doesn't change, confetti isn't recreated.
11 changes: 8 additions & 3 deletions packages/core/demo/src/lib/Counter.svelte
Original file line number Diff line number Diff line change
@@ -1,8 +1,10 @@
<script lang="ts">
import { confetti } from '@neoconfetti/core';
import { confetti, type ConfettiParticleShape } from '@neoconfetti/core';
import { onMount } from 'svelte';
let colors: string[] | undefined = undefined;
let particleShape: ConfettiParticleShape = 'mix';
let force = 0.5;
let showConfetti = false;
Expand All @@ -13,13 +15,16 @@
setTimeout(() => {
// render = {};
colors = ['#eee', 'black'];
// colors = ['#eee', 'black'];
// particleShape = 'circles';
force = 1;
}, 2000);
});
</script>

{#if showConfetti}
<div use:confetti={{ destroyAfterDone: false, colors }} />
<div use:confetti={{ destroyAfterDone: false, colors, particleShape, force }} />
{/if}

<!-- <ConfettiExplosion destroyAfterDone={false} particleCount={4} /> -->
Expand Down

0 comments on commit 01a3b51

Please sign in to comment.