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>
|
||||
)
|
||||
}
|
||||
Reference in new issue
Block a user