From 9d69d13aa57afc8fb6edc919b554d907db52dd28 Mon Sep 17 00:00:00 2001 From: LionTion Date: Thu, 10 Sep 2026 20:04:51 +0200 Subject: [PATCH] more stuff! --- next.config.ts | 2 +- src/app/page.tsx | 54 +++++++++++++++++++++++- src/components/screens/Intro.tsx | 11 +++-- src/components/screens/Tour.tsx | 16 ++++++- src/components/screens/WelcomeScreen.tsx | 3 +- src/css/ChargedButton.module.css | 2 +- 6 files changed, 79 insertions(+), 9 deletions(-) diff --git a/next.config.ts b/next.config.ts index db265a6..6fa21aa 100644 --- a/next.config.ts +++ b/next.config.ts @@ -11,7 +11,7 @@ const nextConfig: NextConfig = { }; module.exports = { - allowedDevOrigins: ['192.168.0.110'], + allowedDevOrigins: ['192.168.0.110'] }; export default withSerwist(nextConfig); diff --git a/src/app/page.tsx b/src/app/page.tsx index dcb2cfc..22a394e 100644 --- a/src/app/page.tsx +++ b/src/app/page.tsx @@ -1,6 +1,6 @@ "use client"; -import { ReactElement, useEffect, useState } from "react"; +import { ChangeEvent, ReactElement, useEffect, useRef, useState } from "react"; import Image from "next/image"; import styles from "./page.module.css"; import ChargedButton from "@/components/ChargedButton"; @@ -35,7 +35,59 @@ export default function Main() { console.log("PLAYERS", players, parsePlayerData(players)); console.log("TourCode", tourCode); + /*const [test, setTest] = useState(100); + const handleChange = (event: ChangeEvent): boolean => { + const value = Number.parseInt(event.target.value); + if (event.target.value.length > 0) { + if (value < 0 || isNaN(value)) { + event.preventDefault(); + return false; + } + } + setTest(value); + return true; + }; + + const ExampleButton = ({ duration }: { duration: number}) => { + const [clicked, setClicked] = useState(false); + + return ( +
+ { + setClicked(true); + setTimeout(() => { + setClicked(false); + }, 1000); + } + }> + {`${duration}ms`} + +

{clicked ? "Click!" : ""}

+
+ ); + };*/ + const content = [ + /*(
+
+ +

+ +
+
+
Disabled
+ {[200, 250, 300, 400, 500, 1000, 2000, 3000].flatMap((v) => { + return + })} +
+
),*/ (), (), () diff --git a/src/components/screens/Intro.tsx b/src/components/screens/Intro.tsx index 3085f76..2dd8bdd 100644 --- a/src/components/screens/Intro.tsx +++ b/src/components/screens/Intro.tsx @@ -1,16 +1,21 @@ import { useLocalStorage } from "@/hooks/useLocalStorage" import { PREF } from "@/utils/const" +import ChargedButton from "../ChargedButton"; export default function Intro() { const [ stepStr, setStep ] = useLocalStorage(PREF.step, "0"); return (
- Intro or smth +

CODE EINGELÖST

+

TON AN

+

Für diese Tour werden extra Berechtigungen gebraucht.



- + }} holdDuration={1200}> + Video ansehen +
) } \ No newline at end of file diff --git a/src/components/screens/Tour.tsx b/src/components/screens/Tour.tsx index 6f80ec9..2fab7a5 100644 --- a/src/components/screens/Tour.tsx +++ b/src/components/screens/Tour.tsx @@ -1,6 +1,7 @@ import { useLocalStorage } from "@/hooks/useLocalStorage" import { PREF } from "@/utils/const" import { parsePlayerData } from "@/utils/dataparser"; +import ChargedButton from "../ChargedButton"; export default function Tour() { const [ stepStr, setStep ] = useLocalStorage(PREF.step, "0"); @@ -15,8 +16,19 @@ export default function Tour() { return (
- {"Points: " + points} - {"Players: " + playersStr} +

{"Points: " + points}

+

{"Players: " + playersStr}

+

+ { + + setTourCode(""); + setCompletedRiddles(""); + setPlayers(""); + setPoints(""); + setStep("0"); + }} holdDuration={500}> + Zurücksetzen +
Contains both diff --git a/src/components/screens/WelcomeScreen.tsx b/src/components/screens/WelcomeScreen.tsx index 59a8d8d..1f14061 100644 --- a/src/components/screens/WelcomeScreen.tsx +++ b/src/components/screens/WelcomeScreen.tsx @@ -78,9 +78,10 @@ export default function WelcomeScreen() { value={tourCode} onChange={handleChange} aria-label="Tour Code" - placeholder={`Enter a tour code (${CODE_LENGTH} characters max)`} + placeholder={`Code eingeben`} /> +