We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 799558a commit e96a819Copy full SHA for e96a819
src/packlets/playground/playground.svelte
@@ -15,15 +15,16 @@
15
16
const addBalloon = (
17
x = Math.floor(Math.random() * window.innerWidth),
18
- y = 0
+ y = 0,
19
+ half = false
20
) => {
21
const size = Math.floor(Math.random() * 300) + 60
22
23
const item: Item = {
24
id: (Math.random() + 1).toString(36).substring(7),
25
size,
26
horizontal: x - size / 2,
- vertical: y + size,
27
+ vertical: y + (half ? size / 2 : size),
28
}
29
30
balloons = [...balloons, item]
@@ -34,7 +35,7 @@
34
35
36
37
const handleClick: MouseEventHandler<HTMLElement> = e => {
- addBalloon(e.pageX, -window.innerHeight + e.pageY)
38
+ addBalloon(e.pageX, -window.innerHeight + e.pageY, true)
39
40
41
onMount(() => {
0 commit comments