diff --git a/apps/www/package.json b/apps/www/package.json index b4d9828..5ffec96 100644 --- a/apps/www/package.json +++ b/apps/www/package.json @@ -41,6 +41,7 @@ "@nestri/typescript-config": "*", "@nestri/ui": "*", "@types/eslint": "8.56.10", + "@types/howler": "^2.2.12", "@types/node": "^22.5.1", "@types/react": "^18.2.28", "@types/react-dom": "^18.2.13", @@ -48,6 +49,7 @@ "@typescript-eslint/parser": "7.16.1", "eslint": "8.57.0", "eslint-plugin-qwik": "^1.8.0", + "howler": "^2.2.4", "prettier": "3.3.3", "react": "18.2.0", "react-dom": "18.2.0", diff --git a/apps/www/src/routes/pricing/index.tsx b/apps/www/src/routes/pricing/index.tsx index 250fd61..76c6a1f 100644 --- a/apps/www/src/routes/pricing/index.tsx +++ b/apps/www/src/routes/pricing/index.tsx @@ -1,7 +1,9 @@ -import { component$, useSignal, useVisibleTask$ } from "@builder.io/qwik"; +import { $, component$, noSerialize, NoSerialize, useSignal, useVisibleTask$ } from "@builder.io/qwik"; import { TitleSection, MotionComponent, transition } from "@nestri/ui/react"; import { NavBar, Footer, Book } from "@nestri/ui" import { cn } from "@nestri/ui/design"; +import { Howl, Howler } from 'howler'; + //FIXME: Add a FAQ section // FIXME: Takes too long for the price input radio input to become responsive const w = 280 @@ -62,13 +64,14 @@ const convertToTitle = (value: any) => { export default component$(() => { const priceValue = useSignal(3) - const audioUrl = new URL('./cash.mp3', import.meta.url).href - const audio = useSignal() - const buttonRef = useSignal() const bookRef = useSignal() + const audio = useSignal | undefined>() useVisibleTask$(() => { + audio.value = noSerialize(new Howl({ src: ["/audio/cash.mp3"] })) + audio.value?.volume(0.5) + buttonRef.value?.addEventListener("mouseenter", () => { bookRef.value?.classList.add('flip') }) @@ -85,6 +88,11 @@ export default component$(() => { } }) + const onClick = $((v: any) => { + priceValue.value = Number(v.target?.value) as number; + audio.value?.play() + }) + return ( <> @@ -306,11 +314,10 @@ export default component$(() => { class="absolute transition-all duration-200 pointer-events-none w-full -top-1 z-20 right-0 left-[--left] "> -