more stuff!

This commit is contained in:
LionTion committed 2026-09-10 20:04:51 +02:00
1 parent a1ab487084
commit 9d69d13aa5
6 files changed
+79 -9

No files matched your search

+53 -1
View File
@@ -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<HTMLInputElement>): 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 (
<div style={{ marginBottom: "1rem" }}>
<ChargedButton holdDuration={duration} onAction={() => {
setClicked(true);
setTimeout(() => {
setClicked(false);
}, 1000);
}
}>
{`${duration}ms`}
</ChargedButton>
<p>{clicked ? "Click!" : ""}</p>
</div>
);
};*/
const content = [
/*(<div key={999} style={{
display: "flex",
flexDirection: "row",
columnGap: "2rem",
alignItems: "center"
}}>
<div style={{textAlign: "center"}}>
<input type="number" placeholder="Dauer" value={test.toString()} onChange={handleChange} style={{marginBottom: "1rem"}}/>
<br></br>
<ExampleButton duration={test}></ExampleButton>
</div>
<div>
<div style={{
marginBottom: "1rem"
}}><ChargedButton disabled={true}>Disabled</ChargedButton></div>
{[200, 250, 300, 400, 500, 1000, 2000, 3000].flatMap((v) => {
return <ExampleButton duration={v} key={v}></ExampleButton>
})}
</div>
</div>),*/
(<WelcomeScreen key={0}/>),
(<Intro key={1} />),
(<Tour key={2} />)
+8 -3
View File
@@ -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 (
<div className="screen-container">
Intro or smth
<p>CODE EINGELÖST</p>
<p>TON AN</p>
<p>Für diese Tour werden extra Berechtigungen gebraucht.</p>
<br></br>
<button onClick={() => {
<ChargedButton onAction={() => {
setStep("2");
}}>Ok</button>
}} holdDuration={1200}>
Video ansehen
</ChargedButton>
</div>
)
}
+14 -2
View File
@@ -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 (
<div className="screen-container">
<div>
{"Points: " + points}
{"Players: " + playersStr}
<p>{"Points: " + points}</p>
<p>{"Players: " + playersStr}</p>
<br></br>
<ChargedButton onAction={() => {
setTourCode("");
setCompletedRiddles("");
setPlayers("");
setPoints("");
setStep("0");
}} holdDuration={500}>
Zurücksetzen
</ChargedButton>
</div>
<div>
Contains both
+2 -1
View File
@@ -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`}
/>
</label>
<br></br>
<ChargedButton
holdDuration={1000}
onAction={submit}
+1 -1
View File
@@ -43,7 +43,7 @@
pointer-events: none;
position: absolute;
inset: 0;
border-radius: inherit;
border-radius: 0px;
opacity: 0.7;
background: linear-gradient(120deg, #1ea, #2af, #e1f);
transition: opacity 120ms ease;