R7, R2, Heartbeat, Sessions, Code, cleanup, Outro

This commit is contained in:
LionTion committed 2026-10-16 04:31:51 +02:00
1 parent b5e5cc502d
commit 5b9fe3ea21
25 files changed
+346 -116

No files matched your search

+8 -4
View File
@@ -10,9 +10,8 @@ import { PermissionStateResult } from "@/utils/permissions";
import StyledContainer from "../StyledContainer";
import OldButton from "../OldButton";
import OldTextInput from "../OldTextInput";
const MIN_PLAYERS = 2;
const MAX_PLAYERS = 8;
import clsx from "clsx";
import { MAX_PLAYERS, MIN_PLAYERS } from "@/utils/players";
export default function Intro() {
const [ stepStr, setStep ] = useLocalStorage(PREF.step, "0");
@@ -24,6 +23,8 @@ export default function Intro() {
const [ enterPlayerCount, setEnterPlayerCount ] = useState(false);
const [ videoEnded, setVideoEnded ] = useState(false);
const [ videoPaused, setVideoPaused ] = useState(false);
const [ voiceOverState, setVoiceOverState ] = useLocalStorage(PREF.voiceover, "off");
const [ boughtHintsStr, setBoughtHints ] = useLocalStorage(PREF.boughtHints, "");
const introVideoRef = useRef<HTMLVideoElement | null>(null);
const [ granted, setGranted ] = useState(false);
@@ -72,7 +73,7 @@ export default function Intro() {
objectFit: "fill",
zIndex: 1
}} alt="Background" loading="eager"/>
<StyledContainer innerClassName={styles["permission-container"]}>
<StyledContainer innerClassName={styles["container"]}>
{ !enterPlayerCount || !granted ?
<div>
<PermissionCheck onRefresh={handlePermissions}></PermissionCheck>
@@ -111,6 +112,7 @@ export default function Intro() {
}} holdDuration={500} disabled={!isPlayerCountValid}>
ABENTEUER BEGINNEN!
</ChargedButton>
<p className={clsx("lancelot-italic")} style={{marginTop: "1rem"}}>Auf dem Knopf halten, um ihn aufzuladen!</p>
</div>
:
<div className={styles["intro-video-container"]}>
@@ -154,8 +156,10 @@ export default function Intro() {
<ChargedButton holdDuration={500} onAction={() => {
setPoints("0");
setCompletedRiddles("");
setBoughtHints("");
setPlayers("");
setWorthyWords("");
setVoiceOverState("on");
setStep("2");
}}>Wir sind bereit!</ChargedButton>
</div> : null }