Fireworks
This commit is contained in:
parent
468d6ae72a
commit
8488f06405
|
@ -8,7 +8,7 @@ export function Button(
|
||||||
<button
|
<button
|
||||||
{...props}
|
{...props}
|
||||||
disabled={!IS_BROWSER || disabled}
|
disabled={!IS_BROWSER || disabled}
|
||||||
class={`px-2 py-1 bg-gray-500/20 rounded hover:bg-gray-500/25 cursor-pointer transition-colors ${className}`}
|
class={`flex items-center justify-center gap-1 px-2 py-1 bg-gray-500/20 rounded hover:bg-gray-500/25 cursor-pointer transition-colors ${className}`}
|
||||||
/>
|
/>
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
|
|
@ -93,6 +93,7 @@ export default function Dashboard(
|
||||||
}, [])
|
}, [])
|
||||||
|
|
||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
|
const fireworks = new Audio('/fireworks.mp3')
|
||||||
const count = 200,
|
const count = 200,
|
||||||
defaults = {
|
defaults = {
|
||||||
origin: { y: 0.7 },
|
origin: { y: 0.7 },
|
||||||
|
@ -104,6 +105,7 @@ export default function Dashboard(
|
||||||
decay?: number
|
decay?: number
|
||||||
scalar?: number
|
scalar?: number
|
||||||
}) {
|
}) {
|
||||||
|
fireworks.play()
|
||||||
confetti(
|
confetti(
|
||||||
Object.assign({}, defaults, opts, {
|
Object.assign({}, defaults, opts, {
|
||||||
particleCount: Math.floor(count * particleRatio),
|
particleCount: Math.floor(count * particleRatio),
|
||||||
|
|
|
@ -2,7 +2,14 @@ import { Todo, UserWithTodos } from '@homeman/models.ts'
|
||||||
import { JSX } from 'preact'
|
import { JSX } from 'preact'
|
||||||
import { Button } from '@homeman/components/Button.tsx'
|
import { Button } from '@homeman/components/Button.tsx'
|
||||||
import { Avatar } from '@homeman/components/Avatar.tsx'
|
import { Avatar } from '@homeman/components/Avatar.tsx'
|
||||||
import { ChevronDownMiniSolid, TrashSolid } from 'preact-heroicons'
|
import {
|
||||||
|
CheckBadgeSolid,
|
||||||
|
CheckCircleMiniSolid,
|
||||||
|
CheckCircleSolid,
|
||||||
|
CheckMiniSolid,
|
||||||
|
ChevronDownMiniSolid,
|
||||||
|
TrashSolid,
|
||||||
|
} from 'preact-heroicons'
|
||||||
|
|
||||||
export interface Props {
|
export interface Props {
|
||||||
user: UserWithTodos
|
user: UserWithTodos
|
||||||
|
@ -33,7 +40,7 @@ export function TodoList(
|
||||||
<footer class='flex gap-2'>
|
<footer class='flex gap-2'>
|
||||||
{(virtual || doneAt != null) ? '' : (
|
{(virtual || doneAt != null) ? '' : (
|
||||||
<Button
|
<Button
|
||||||
className='grow'
|
className='bg-emerald-500/50 grow'
|
||||||
onClick={async () => {
|
onClick={async () => {
|
||||||
await fetch('/api/todo/done', {
|
await fetch('/api/todo/done', {
|
||||||
method: 'PUT',
|
method: 'PUT',
|
||||||
|
@ -41,7 +48,7 @@ export function TodoList(
|
||||||
})
|
})
|
||||||
}}
|
}}
|
||||||
>
|
>
|
||||||
Done
|
<CheckMiniSolid class='w-5 h-5' /> Done
|
||||||
</Button>
|
</Button>
|
||||||
)}
|
)}
|
||||||
{(!virtual && doneAt != null)
|
{(!virtual && doneAt != null)
|
||||||
|
|
BIN
static/fireworks.mp3
Normal file
BIN
static/fireworks.mp3
Normal file
Binary file not shown.
Loading…
Reference in a new issue