Design Start
This commit is contained in:
1 parent
b5a088cf9c
commit
dfe4ab50f3
57 files changed
+478
-141
No files matched your search
@@ -7,6 +7,8 @@ import { InputEvent, MouseEvent, MouseEventHandler, PointerEvent, useRef, useSta
|
||||
import Image from "next/image";
|
||||
import PermissionCheck from "../PermissionCheck";
|
||||
import { PermissionStateResult } from "@/utils/permissions";
|
||||
import StyledContainer from "../StyledContainer";
|
||||
import OldButton from "../OldButton";
|
||||
|
||||
export default function Intro() {
|
||||
const [ stepStr, setStep ] = useLocalStorage(PREF.step, "0");
|
||||
@@ -25,67 +27,73 @@ export default function Intro() {
|
||||
setGranted(gps === "granted" && cam === "granted");
|
||||
};
|
||||
|
||||
return (
|
||||
return (
|
||||
<div className="screen-container">
|
||||
{ !rewatchScreen ?
|
||||
<div>
|
||||
<p>CODE EINGELÖST</p>
|
||||
<p>TON AN</p>
|
||||
<PermissionCheck onRefresh={handlePermissions}></PermissionCheck>
|
||||
<br></br>
|
||||
<ChargedButton onAction={() => {
|
||||
setRewatchScreen(true);
|
||||
}} holdDuration={500} disabled={!granted}>
|
||||
Video ansehen
|
||||
</ChargedButton>
|
||||
<div className={styles["overlay-video"]}>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
:
|
||||
<div className={styles["intro-video-container"]}>
|
||||
<video
|
||||
ref={introVideoRef}
|
||||
disablePictureInPicture={true}
|
||||
autoPlay={true}
|
||||
loop={false}
|
||||
autoFocus={true}
|
||||
width={"100%"}
|
||||
onEnded={() => setVideoEnded(true)}
|
||||
onAbort={() => setVideoEnded(true)}
|
||||
onError={() => setVideoEnded(true)}
|
||||
onPause={() => setVideoPaused(true)}
|
||||
onPlay={() => setVideoPaused(false)}
|
||||
onClick={handleVideoClick}
|
||||
onContextMenu={(e) => {
|
||||
e.preventDefault();
|
||||
return false;
|
||||
}}
|
||||
>
|
||||
<source src="/res/intro/testvid.webm" type="video/webm"/>
|
||||
</video>
|
||||
{ !videoEnded && videoPaused ?
|
||||
<div className={styles["pause-screen"]}>
|
||||
<Image src="/icons/pause.svg" alt="Pause Icon" width={48} height={48}/>
|
||||
<img src={"/bg/Hintergrund_ohne_Verzierung.webp"} style={{
|
||||
position: "absolute",
|
||||
top: 0,
|
||||
left: 0,
|
||||
width: "100%",
|
||||
height: "100%",
|
||||
objectFit: "cover",
|
||||
zIndex: 1
|
||||
}} alt="Background" loading="eager"/>
|
||||
<StyledContainer innerClassName={styles["permission-container"]}>
|
||||
{ !rewatchScreen ?
|
||||
<div>
|
||||
<PermissionCheck onRefresh={handlePermissions}></PermissionCheck>
|
||||
<OldButton red={false} long={true} style={{margin: "auto", marginTop: "3rem"}}>WEITER</OldButton>
|
||||
{ false && <ChargedButton onAction={() => {
|
||||
setRewatchScreen(true);
|
||||
}} holdDuration={500} disabled={!granted}>
|
||||
Halten, um das Video ansehen
|
||||
</ChargedButton> }
|
||||
</div>
|
||||
:
|
||||
null
|
||||
<div className={styles["intro-video-container"]}>
|
||||
<video
|
||||
ref={introVideoRef}
|
||||
disablePictureInPicture={true}
|
||||
autoPlay={true}
|
||||
loop={false}
|
||||
autoFocus={true}
|
||||
width={"100%"}
|
||||
onEnded={() => setVideoEnded(true)}
|
||||
onAbort={() => setVideoEnded(true)}
|
||||
onError={() => setVideoEnded(true)}
|
||||
onPause={() => setVideoPaused(true)}
|
||||
onPlay={() => setVideoPaused(false)}
|
||||
onClick={handleVideoClick}
|
||||
onContextMenu={(e) => {
|
||||
e.preventDefault();
|
||||
return false;
|
||||
}}
|
||||
>
|
||||
<source src="/res/intro/testvid.webm" type="video/webm"/>
|
||||
</video>
|
||||
{ !videoEnded && videoPaused ?
|
||||
<div className={styles["pause-screen"]}>
|
||||
<Image src="/icons/pause.svg" alt="Pause Icon" width={48} height={48}/>
|
||||
</div>
|
||||
:
|
||||
null
|
||||
}
|
||||
{ videoEnded ? <div className={styles["rewatch-controls"]}>
|
||||
<ChargedButton holdDuration={500} onAction={() => {
|
||||
if (introVideoRef.current) {
|
||||
introVideoRef.current.pause();
|
||||
introVideoRef.current.currentTime = 0;
|
||||
introVideoRef.current.play();
|
||||
setVideoEnded(false);
|
||||
}
|
||||
}}>Video wiederholen?</ChargedButton>
|
||||
<ChargedButton holdDuration={500} onAction={() => {
|
||||
setStep("2");
|
||||
}}>Wir sind bereit!</ChargedButton>
|
||||
</div> : null }
|
||||
</div>
|
||||
}
|
||||
{ videoEnded ? <div className={styles["rewatch-controls"]}>
|
||||
<ChargedButton holdDuration={500} onAction={() => {
|
||||
if (introVideoRef.current) {
|
||||
introVideoRef.current.pause();
|
||||
introVideoRef.current.currentTime = 0;
|
||||
introVideoRef.current.play();
|
||||
setVideoEnded(false);
|
||||
}
|
||||
}}>Video wiederholen?</ChargedButton>
|
||||
<ChargedButton holdDuration={500} onAction={() => {
|
||||
setStep("2");
|
||||
}}>Wir sind bereit!</ChargedButton>
|
||||
</div> : null }
|
||||
</div>
|
||||
}
|
||||
</StyledContainer>
|
||||
</div>
|
||||
)
|
||||
}
|
||||
@@ -5,6 +5,10 @@ import styles from "../../css/WelcomeScreen.module.css";
|
||||
import ChargedButton from "../ChargedButton";
|
||||
import { useLocalStorage } from "@/hooks/useLocalStorage";
|
||||
import { PREF } from "@/utils/const";
|
||||
import StyledContainer from "../StyledContainer";
|
||||
import clsx from "clsx";
|
||||
import OldButton from "../OldButton";
|
||||
import OldTextInput from "../OldTextInput";
|
||||
|
||||
const CODE_LENGTH = 9;
|
||||
const COOLDOWN_MS = 3000;
|
||||
@@ -75,25 +79,44 @@ export default function WelcomeScreen() {
|
||||
|
||||
return (
|
||||
<div className="screen-container">
|
||||
<label className="screen__label">
|
||||
<input
|
||||
type="text"
|
||||
className="screen-input"
|
||||
<img src={"/bg/Startseite_ohne_Verzierung.webp"} style={{
|
||||
position: "absolute",
|
||||
top: 0,
|
||||
left: 0,
|
||||
width: "100%",
|
||||
height: "100%",
|
||||
objectFit: "cover",
|
||||
zIndex: 1
|
||||
}} alt="Background"/>
|
||||
<StyledContainer innerClassName={styles["content"]}>
|
||||
<p style={{fontSize: "1.25rem", color: "var(--dark-brown)"}}>SPIELCODE EINGEBEN:</p>
|
||||
<br></br>
|
||||
<OldTextInput
|
||||
value={tourCode}
|
||||
onChange={handleChange}
|
||||
aria-label="Tour Code"
|
||||
placeholder={`Code eingeben`}
|
||||
/>
|
||||
</label>
|
||||
<br></br>
|
||||
<ChargedButton
|
||||
holdDuration={500}
|
||||
onAction={submit}
|
||||
className="screen-submit"
|
||||
placeholder="XXX-XXX-XXX"
|
||||
style={{
|
||||
textAlign: "center",
|
||||
letterSpacing: "4px"
|
||||
}}/>
|
||||
<br></br>
|
||||
<OldButton
|
||||
red={false}
|
||||
disabled={buttonDisabled}
|
||||
>
|
||||
{(!buttonDisabled) ? "Halten zum Spielen!" : "Halten zum Spielen."}
|
||||
</ChargedButton>
|
||||
onAction={submit}
|
||||
>
|
||||
WEITER
|
||||
</OldButton>
|
||||
{ false ? <ChargedButton
|
||||
holdDuration={500}
|
||||
onAction={submit}
|
||||
className="screen-submit"
|
||||
disabled={buttonDisabled}
|
||||
>
|
||||
{(!buttonDisabled) ? "Halten zum Spielen!" : "Halten zum Spielen."}
|
||||
</ChargedButton> : null}
|
||||
</StyledContainer>
|
||||
</div>
|
||||
);
|
||||
}
|
||||
Reference in new issue
Block a user