Mostly improvements from Linda
This commit is contained in:
1 parent
714d3464bd
commit
e36bec6b36
17 files changed
+197
-73
No files matched your search
@@ -18,7 +18,7 @@ export default function ChargedButton({
|
|||||||
children,
|
children,
|
||||||
style,
|
style,
|
||||||
className,
|
className,
|
||||||
holdDuration = 500,
|
holdDuration = 600,
|
||||||
onAction,
|
onAction,
|
||||||
disabled = false,
|
disabled = false,
|
||||||
red = false,
|
red = false,
|
||||||
@@ -119,6 +119,17 @@ export default function ChargedButton({
|
|||||||
/>
|
/>
|
||||||
|
|
||||||
<span className={clsx(styles["charged-button-label"], "lancelot-regular")}>{children}</span>
|
<span className={clsx(styles["charged-button-label"], "lancelot-regular")}>{children}</span>
|
||||||
|
|
||||||
|
<span
|
||||||
|
className={clsx(styles["charged-button-label-clipped"], "lancelot-regular")}
|
||||||
|
aria-hidden="true"
|
||||||
|
style={{
|
||||||
|
clipPath: `inset(0 ${clipPercent}% 0 0)`,
|
||||||
|
WebkitClipPath: `inset(0 ${clipPercent}% 0 0)`,
|
||||||
|
}}
|
||||||
|
>
|
||||||
|
{children}
|
||||||
|
</span>
|
||||||
</button>
|
</button>
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
@@ -27,6 +27,7 @@ export default function PermissionCheck({
|
|||||||
}, [onRefresh, gpsStatus, cameraStatus]);
|
}, [onRefresh, gpsStatus, cameraStatus]);
|
||||||
|
|
||||||
const requestGPSPermission = () => {
|
const requestGPSPermission = () => {
|
||||||
|
if (gpsStatus === "granted") return;
|
||||||
setIsGPSPermissionLoading(true);
|
setIsGPSPermissionLoading(true);
|
||||||
navigator.geolocation.getCurrentPosition((pos) => {
|
navigator.geolocation.getCurrentPosition((pos) => {
|
||||||
setIsGPSPermissionLoading(false);
|
setIsGPSPermissionLoading(false);
|
||||||
@@ -41,6 +42,7 @@ export default function PermissionCheck({
|
|||||||
}
|
}
|
||||||
|
|
||||||
const requestCamPermission = () => {
|
const requestCamPermission = () => {
|
||||||
|
if (cameraStatus === "granted") return;
|
||||||
setIsCamPermissionLoading(true);
|
setIsCamPermissionLoading(true);
|
||||||
navigator.mediaDevices.getUserMedia({
|
navigator.mediaDevices.getUserMedia({
|
||||||
"video": { facingMode: { ideal: "environment" } },
|
"video": { facingMode: { ideal: "environment" } },
|
||||||
@@ -68,12 +70,12 @@ export default function PermissionCheck({
|
|||||||
<br></br>
|
<br></br>
|
||||||
<div className={styles["status-row"]}>
|
<div className={styles["status-row"]}>
|
||||||
<OldButton
|
<OldButton
|
||||||
disabled={isCamPermissionLoading || cameraStatus === "granted"}
|
disabled={isCamPermissionLoading}
|
||||||
onAction={requestCamPermission}
|
onAction={requestCamPermission}
|
||||||
>
|
>
|
||||||
<div className="center-flex" style={{flexDirection: "row"}}>
|
<div className="center-flex" style={{flexDirection: "row"}}>
|
||||||
<img className={styles["status-icon"]} src={cameraStatus === "granted" ? "/icons/haken.svg" : "/icons/kreuz.svg"} alt={`Status Symbol: ${cameraStatus === "granted" ? "Haken" : "Kreuz"}`}/>
|
<img className={styles["status-icon"]} src={cameraStatus === "granted" ? "/icons/haken.svg" : "/icons/kreuz.svg"} alt={`Status Symbol: ${cameraStatus === "granted" ? "Haken" : "Kreuz"}`}/>
|
||||||
<p>Kamera-Berechtigung</p>
|
<p style={{fontSize: "1rem"}}>Kamera-Berechtigung</p>
|
||||||
</div>
|
</div>
|
||||||
</OldButton>
|
</OldButton>
|
||||||
|
|
||||||
@@ -81,12 +83,12 @@ export default function PermissionCheck({
|
|||||||
<br></br>
|
<br></br>
|
||||||
<div className={styles["status-row"]}>
|
<div className={styles["status-row"]}>
|
||||||
<OldButton
|
<OldButton
|
||||||
disabled={isGPSPermissionLoading || gpsStatus === "granted"}
|
disabled={isGPSPermissionLoading}
|
||||||
onAction={requestGPSPermission}
|
onAction={requestGPSPermission}
|
||||||
>
|
>
|
||||||
<div className="center-flex" style={{flexDirection: "row"}}>
|
<div className="center-flex" style={{flexDirection: "row"}}>
|
||||||
<img className={styles["status-icon"]} src={gpsStatus === "granted" ? "/icons/haken.svg" : "/icons/kreuz.svg"} alt={`Status Symbol: ${gpsStatus === "granted" ? "Haken" : "Kreuz"}`}/>
|
<img className={styles["status-icon"]} src={gpsStatus === "granted" ? "/icons/haken.svg" : "/icons/kreuz.svg"} alt={`Status Symbol: ${gpsStatus === "granted" ? "Haken" : "Kreuz"}`}/>
|
||||||
<p>GPS-Berechtigung</p>
|
<p style={{fontSize: "1rem"}}>GPS-Berechtigung</p>
|
||||||
</div>
|
</div>
|
||||||
</OldButton>
|
</OldButton>
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
@@ -62,7 +62,7 @@ export default function RiddleHintPage({
|
|||||||
{ riddle.skipPenaltyPoints > 0 && <p>Überspringt ihr das Rätsel, bekommt ihr {riddle.skipPenaltyPoints} Rufpunkte abgezogen.</p> }
|
{ riddle.skipPenaltyPoints > 0 && <p>Überspringt ihr das Rätsel, bekommt ihr {riddle.skipPenaltyPoints} Rufpunkte abgezogen.</p> }
|
||||||
{ riddle.skipPenaltyPoints < 0 && <p>Das Rätsel kann nicht übersprungen werden!</p> }
|
{ riddle.skipPenaltyPoints < 0 && <p>Das Rätsel kann nicht übersprungen werden!</p> }
|
||||||
<div className="center-flex">
|
<div className="center-flex">
|
||||||
{ nextHintToBuy && <OldButton red={false} onAction={() => setShowBuyHint(true)} style={{marginBottom: "1rem"}}>HINWEIS KAUFEN</OldButton> }
|
<OldButton red={false} onAction={() => setShowBuyHint(true)} disabled={nextHintToBuy === undefined} style={{marginBottom: "1rem"}}>HINWEIS KAUFEN</OldButton>
|
||||||
</div>
|
</div>
|
||||||
{boughtHintObjects.map((hint, index) => (
|
{boughtHintObjects.map((hint, index) => (
|
||||||
<div key={hint.id}>
|
<div key={hint.id}>
|
||||||
@@ -70,7 +70,7 @@ export default function RiddleHintPage({
|
|||||||
</div>
|
</div>
|
||||||
))}
|
))}
|
||||||
<div className="center-flex">
|
<div className="center-flex">
|
||||||
{ riddle.skipPenaltyPoints > -1 && <OldButton red={true} onAction={() => setShowSkipRiddle(true)} style={{marginTop: "1rem"}}>RÄTSEL ÜBERSPRINGEN</OldButton> }
|
<OldButton red={true} onAction={() => setShowSkipRiddle(true)} disabled={riddle.skipPenaltyPoints < 0} style={{marginTop: "1rem"}}>RÄTSEL ÜBERSPRINGEN</OldButton>
|
||||||
</div>
|
</div>
|
||||||
{ (showBuyHint || showSkipRiddle) && <div className={clsx(styles["popup"])}>
|
{ (showBuyHint || showSkipRiddle) && <div className={clsx(styles["popup"])}>
|
||||||
{ showBuyHint && nextHintToBuy &&
|
{ showBuyHint && nextHintToBuy &&
|
||||||
|
|||||||
@@ -93,8 +93,8 @@ export default function RiddleScreen({ riddle, onDismiss }: RiddleScreenProps) {
|
|||||||
}} alt="Background" loading="eager"/>
|
}} alt="Background" loading="eager"/>
|
||||||
<StyledContainer riddleDesign={true}>
|
<StyledContainer riddleDesign={true}>
|
||||||
<div className={styles["actions-bookmark"]}>
|
<div className={styles["actions-bookmark"]}>
|
||||||
<img src={"/icons/hinweis.svg"} className={styles["bookmark-icon"]} style={{width: "20px", height: "auto", margin: "12px 24px", marginTop: "12px"}} onClick={() => setShowHintPage(true)} />
|
<img src={"/icons/hinweis.svg"} className={styles["bookmark-icon"]} style={{width: "24px", height: "auto", margin: "12px 24px", marginTop: "12px"}} onClick={() => setShowHintPage(true)} />
|
||||||
<img src={voiceOverState === "off" ? "/icons/Vorlese-Icon.svg" : "/icons/Vorlese-Icon-leise.svg"} className={styles["bookmark-icon"]} style={{width: "28px", height: "24px", margin: "0px 20px 24px"}} onClick={() => {
|
<img src={voiceOverState === "off" ? "/icons/Vorlese-Icon.svg" : "/icons/Vorlese-Icon-leise.svg"} className={styles["bookmark-icon"]} style={{width: "32px", height: "24px", margin: "10px 20px 24px"}} onClick={() => {
|
||||||
setVoiceOverState(voiceOverState === "off" ? "on" : "off");
|
setVoiceOverState(voiceOverState === "off" ? "on" : "off");
|
||||||
}} />
|
}} />
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
@@ -52,3 +52,33 @@
|
|||||||
.genderButton-disabled {
|
.genderButton-disabled {
|
||||||
opacity: 0.5;
|
opacity: 0.5;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@keyframes flashRed {
|
||||||
|
0% { background-color: transparent; outline: 2px solid transparent; }
|
||||||
|
0.1% { background-color: rgba(255, 0, 0, 0.4); outline: 2px solid red; }
|
||||||
|
100% { background-color: transparent; outline: 2px solid transparent; }
|
||||||
|
}
|
||||||
|
|
||||||
|
.blinkError {
|
||||||
|
animation-name: flashRed;
|
||||||
|
animation-timing-function: ease;
|
||||||
|
animation-duration: 0.5s;
|
||||||
|
animation-iteration-count: 1;
|
||||||
|
animation-delay: 0s;
|
||||||
|
animation-fill-mode: forwards;
|
||||||
|
animation-direction: normal;
|
||||||
|
animation-play-state: paused;
|
||||||
|
border-radius: 6px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.blinkErrorInput {
|
||||||
|
animation-name: flashRed;
|
||||||
|
animation-timing-function: ease;
|
||||||
|
animation-duration: 0.5s;
|
||||||
|
animation-iteration-count: 1;
|
||||||
|
animation-delay: 0s;
|
||||||
|
animation-fill-mode: forwards;
|
||||||
|
animation-direction: normal;
|
||||||
|
animation-play-state: paused;
|
||||||
|
border-radius: 6px;
|
||||||
|
}
|
||||||
@@ -16,6 +16,7 @@ import { setPlayers } from "@/utils/players";
|
|||||||
import { setPlayerAnswers } from "@/utils/player_answers";
|
import { setPlayerAnswers } from "@/utils/player_answers";
|
||||||
import VoiceOver from "../VoiceOver";
|
import VoiceOver from "../VoiceOver";
|
||||||
import RiddleHintPage from "../RiddleHintPage";
|
import RiddleHintPage from "../RiddleHintPage";
|
||||||
|
import ChargedButton from "../ChargedButton";
|
||||||
|
|
||||||
export default function Riddle_1({
|
export default function Riddle_1({
|
||||||
page,
|
page,
|
||||||
@@ -50,7 +51,8 @@ export default function Riddle_1({
|
|||||||
"Achtes Abenteuermitglied"
|
"Achtes Abenteuermitglied"
|
||||||
];
|
];
|
||||||
|
|
||||||
const canGoNext = didPlayerEnterAnswer && didPlayerEnterName && didPlayerPickGender && nameScreen < playerCount-1;
|
const hasNextPlayer = nameScreen < playerCount-1;
|
||||||
|
const canGoNext = didPlayerEnterAnswer && didPlayerEnterName && didPlayerPickGender && hasNextPlayer;
|
||||||
const complete = (() => {
|
const complete = (() => {
|
||||||
let allSet = true;
|
let allSet = true;
|
||||||
for (let i = 0; i < playerCount; ++i) {
|
for (let i = 0; i < playerCount; ++i) {
|
||||||
@@ -66,6 +68,25 @@ export default function Riddle_1({
|
|||||||
return allSet;
|
return allSet;
|
||||||
})();
|
})();
|
||||||
|
|
||||||
|
const blinkMissing = () => {
|
||||||
|
const genderContainer = document.querySelector(`.${extraStyles["genderButtons"]}`);
|
||||||
|
const maleButton = genderContainer?.querySelector("button:first-child");
|
||||||
|
const femaleButton = genderContainer?.querySelector("button:last-child");
|
||||||
|
const inputs = document.querySelectorAll(`.${extraStyles["blinkErrorInput"]}`);
|
||||||
|
|
||||||
|
const triggerBlink = (el: Element | null) => {
|
||||||
|
el?.getAnimations()[0].play();
|
||||||
|
};
|
||||||
|
|
||||||
|
if (!didPlayerPickGender && maleButton && femaleButton) {
|
||||||
|
triggerBlink(maleButton);
|
||||||
|
triggerBlink(femaleButton);
|
||||||
|
}
|
||||||
|
inputs.forEach((input, idx) => {
|
||||||
|
if ((input as HTMLInputElement).value.trim().length < 1) triggerBlink(input);
|
||||||
|
});
|
||||||
|
};
|
||||||
|
|
||||||
const pages = [
|
const pages = [
|
||||||
(
|
(
|
||||||
<div key={0}>
|
<div key={0}>
|
||||||
@@ -98,11 +119,11 @@ export default function Riddle_1({
|
|||||||
}
|
}
|
||||||
]}/>
|
]}/>
|
||||||
<div className={styles["content"]}>
|
<div className={styles["content"]}>
|
||||||
<p style={{fontWeight: "bold", textAlign: "center", fontSize: "1rem"}}>Was schuldet ein Herr seinem Gesinde am allermeisten?</p>
|
<p style={{fontWeight: "bold", textAlign: "center"}}>Was schuldet ein Herr seinem Gesinde am allermeisten?</p>
|
||||||
<p style={{fontWeight: "bold", textAlign: "center", fontSize: "1.1rem"}}>{counterStrings[nameScreen]}</p>
|
<p style={{fontWeight: "bold", textAlign: "center"}}>{counterStrings[nameScreen]}</p>
|
||||||
<div className={extraStyles["genderButtons"]}>
|
<div className={clsx(extraStyles["genderButtons"])}>
|
||||||
<button
|
<button
|
||||||
className={clsx(extraStyles["genderButton"], didPlayerPickGender && enteredPlayers[nameScreen].gender === "female" ? extraStyles["genderButton-disabled"] : null)}
|
className={clsx(extraStyles["genderButton"], !didPlayerPickGender || enteredPlayers[nameScreen].gender === "female" ? extraStyles["genderButton-disabled"] : null, extraStyles["blinkError"])}
|
||||||
onClick={() => {
|
onClick={() => {
|
||||||
const a = [...enteredPlayers];
|
const a = [...enteredPlayers];
|
||||||
a[nameScreen] = {
|
a[nameScreen] = {
|
||||||
@@ -116,7 +137,7 @@ export default function Riddle_1({
|
|||||||
<img src={"/buttons/Button_m.webp"} width={70} />
|
<img src={"/buttons/Button_m.webp"} width={70} />
|
||||||
</button>
|
</button>
|
||||||
<button
|
<button
|
||||||
className={clsx(extraStyles["genderButton"], didPlayerPickGender && enteredPlayers[nameScreen].gender === "male" ? extraStyles["genderButton-disabled"] : null)}
|
className={clsx(extraStyles["genderButton"], !didPlayerPickGender || enteredPlayers[nameScreen].gender === "male" ? extraStyles["genderButton-disabled"] : null, extraStyles["blinkError"])}
|
||||||
onClick={() => {
|
onClick={() => {
|
||||||
const a = [...enteredPlayers];
|
const a = [...enteredPlayers];
|
||||||
a[nameScreen] = {
|
a[nameScreen] = {
|
||||||
@@ -145,6 +166,7 @@ export default function Riddle_1({
|
|||||||
setEnteredPlayers(a);
|
setEnteredPlayers(a);
|
||||||
}}
|
}}
|
||||||
style={{marginBottom: "1.5rem"}}
|
style={{marginBottom: "1.5rem"}}
|
||||||
|
className={extraStyles["blinkErrorInput"]}
|
||||||
></OldTextInput>
|
></OldTextInput>
|
||||||
<p className={extraStyles["label"]}>DEINE ANTWORT:</p>
|
<p className={extraStyles["label"]}>DEINE ANTWORT:</p>
|
||||||
<OldTextInput
|
<OldTextInput
|
||||||
@@ -156,6 +178,7 @@ export default function Riddle_1({
|
|||||||
setEnteredAnswers(a);
|
setEnteredAnswers(a);
|
||||||
}}
|
}}
|
||||||
style={{marginBottom: "1.5rem"}}
|
style={{marginBottom: "1.5rem"}}
|
||||||
|
className={extraStyles["blinkErrorInput"]}
|
||||||
></OldTextInput>
|
></OldTextInput>
|
||||||
</div>
|
</div>
|
||||||
<div className={extraStyles["arrows"]}>
|
<div className={extraStyles["arrows"]}>
|
||||||
@@ -170,29 +193,40 @@ export default function Riddle_1({
|
|||||||
</button>
|
</button>
|
||||||
<button
|
<button
|
||||||
className={clsx(extraStyles["arrow"])}
|
className={clsx(extraStyles["arrow"])}
|
||||||
disabled={!canGoNext}
|
disabled={!hasNextPlayer}
|
||||||
onClick={() => {
|
onClick={() => {
|
||||||
setNameScreen(nameScreen+1);
|
if (canGoNext) {
|
||||||
|
setNameScreen(nameScreen+1);
|
||||||
|
} else {
|
||||||
|
blinkMissing();
|
||||||
|
}
|
||||||
|
|
||||||
}}
|
}}
|
||||||
>
|
>
|
||||||
<img src={"/icons/pfeil_blau.svg"} width={70} style={{rotate: "180deg"}} />
|
<img src={"/icons/pfeil_blau.svg"} width={70} style={{rotate: "180deg"}} />
|
||||||
</button>
|
</button>
|
||||||
</div>
|
</div>
|
||||||
<div className="center-flex">
|
<div className="center-flex">
|
||||||
<OldButton red={false} onAction={() => {
|
<ChargedButton red={false} onAction={() => {
|
||||||
|
if (!complete) {
|
||||||
|
blinkMissing();
|
||||||
|
return;
|
||||||
|
}
|
||||||
addPoints(riddle.points);
|
addPoints(riddle.points);
|
||||||
showBanner(false);
|
showBanner(false);
|
||||||
setPlayers(enteredPlayers);
|
setPlayers(enteredPlayers);
|
||||||
setPlayerAnswers(enteredAnswers);
|
setPlayerAnswers(enteredAnswers);
|
||||||
setPage(2);
|
setPage(2);
|
||||||
}} disabled={!complete}>EINREICHEN!</OldButton>
|
}} disabled={hasNextPlayer}>EINREICHEN!</ChargedButton>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div className={styles["buttons"]}>
|
<div className={styles["buttons"]}>
|
||||||
<OldButton red={true} onAction={() => {
|
<OldButton red={true} onAction={() => {
|
||||||
setPage(0);
|
setPage(0);
|
||||||
showBanner(true);
|
showBanner(true);
|
||||||
}}>ZURÜCK</OldButton>
|
}}
|
||||||
|
className={styles["backButton"]}
|
||||||
|
>ZURÜCK</OldButton>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
),
|
),
|
||||||
@@ -218,5 +252,5 @@ export default function Riddle_1({
|
|||||||
)
|
)
|
||||||
];
|
];
|
||||||
|
|
||||||
return requestingHint ? <RiddleHintPage riddle={riddle} dismissHintPage={dismissHint} onSkip={() => setPage(2)}/> : pages[page];
|
return requestingHint ? <RiddleHintPage riddle={riddle} dismissHintPage={dismissHint} onSkip={null}/> : pages[page];
|
||||||
}
|
}
|
||||||
@@ -11,6 +11,7 @@ import RiddleCompleteBanner from "../RiddleCompleteBanner";
|
|||||||
import { getPlayers } from "@/utils/players";
|
import { getPlayers } from "@/utils/players";
|
||||||
import VoiceOver from "../VoiceOver";
|
import VoiceOver from "../VoiceOver";
|
||||||
import RiddleHintPage from "../RiddleHintPage";
|
import RiddleHintPage from "../RiddleHintPage";
|
||||||
|
import { Player } from "@/types/player";
|
||||||
|
|
||||||
export default function Riddle_2({
|
export default function Riddle_2({
|
||||||
page,
|
page,
|
||||||
@@ -26,6 +27,22 @@ export default function Riddle_2({
|
|||||||
|
|
||||||
const [ playerIndex, setPlayerIndex ] = useState(0);
|
const [ playerIndex, setPlayerIndex ] = useState(0);
|
||||||
const players = useMemo(() => getPlayers(), [playersStr]);
|
const players = useMemo(() => getPlayers(), [playersStr]);
|
||||||
|
const playerOrder = useMemo(() => {
|
||||||
|
if (!players || players.length === 0) return [];
|
||||||
|
|
||||||
|
const indices = Array.from({ length: players.length - 1 }, (_, i) => i + 1);
|
||||||
|
|
||||||
|
for (let i = indices.length - 1; i > 0; i--) {
|
||||||
|
const j = Math.floor(Math.random() * (i + 1));
|
||||||
|
[indices[i], indices[j]] = [indices[j], indices[i]];
|
||||||
|
}
|
||||||
|
|
||||||
|
indices.push(0);
|
||||||
|
|
||||||
|
return indices;
|
||||||
|
}, [players]);
|
||||||
|
|
||||||
|
const currentPlayer: Player = players[playerOrder[playerIndex]];
|
||||||
|
|
||||||
const pages = [
|
const pages = [
|
||||||
(
|
(
|
||||||
@@ -50,8 +67,8 @@ export default function Riddle_2({
|
|||||||
<div key={1}>
|
<div key={1}>
|
||||||
<div className={styles["content"]}>
|
<div className={styles["content"]}>
|
||||||
<div className="center-flex">
|
<div className="center-flex">
|
||||||
<p style={{fontWeight: "bold", fontSize: "3rem", marginTop: "2rem", marginBottom: "0"}}>Zieh mal {players[playerIndex].name},</p>
|
<p style={{fontWeight: "bold", fontSize: "3rem", marginTop: "2rem", marginBottom: "0"}}>{currentPlayer.name},</p>
|
||||||
<p style={{textAlign: "center"}}>zieh nun am Schwert und finde heraus, ob du Excaliburs {players[playerIndex].gender === "female" ? "Erbin" : "Erbe"} bist!</p>
|
<p style={{textAlign: "center"}}>zieh nun am Schwert und finde heraus, ob du Excaliburs {currentPlayer.gender === "female" ? "Erbin" : "Erbe"} bist!</p>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div className={styles["buttons"]}>
|
<div className={styles["buttons"]}>
|
||||||
@@ -63,7 +80,7 @@ export default function Riddle_2({
|
|||||||
setPlayerIndex(playerIndex+1);
|
setPlayerIndex(playerIndex+1);
|
||||||
}
|
}
|
||||||
}} disabled={false}>WEITER</OldButton>
|
}} disabled={false}>WEITER</OldButton>
|
||||||
{playerIndex < 1 ? <OldButton red={true} onAction={() => setPage(0)}>ZURÜCK</OldButton> : null}
|
{playerIndex < 1 ? <OldButton red={true} onAction={() => setPage(0)} className={styles["backButton"]}>ZURÜCK</OldButton> : null}
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
),
|
),
|
||||||
|
|||||||
@@ -63,7 +63,7 @@ export default function Riddle_3({
|
|||||||
<p>Das gemeine Volk versammelt sich währenddessen unterhalb des Turms. Sobald der Auserwählte oben angekommen ist, das Banner herabgelassen wurde und sich das Volk unten versammelt hat, kann die Ansprache beginnen.</p>
|
<p>Das gemeine Volk versammelt sich währenddessen unterhalb des Turms. Sobald der Auserwählte oben angekommen ist, das Banner herabgelassen wurde und sich das Volk unten versammelt hat, kann die Ansprache beginnen.</p>
|
||||||
</div>
|
</div>
|
||||||
<div className={styles["buttons"]}>
|
<div className={styles["buttons"]}>
|
||||||
<ChargedButton red={false} disabled={false} onAction={() => setPage(1)} holdDuration={300}>WIR SIND BEREIT</ChargedButton>
|
<ChargedButton red={false} disabled={false} onAction={() => setPage(1)}>WIR SIND BEREIT</ChargedButton>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
),
|
),
|
||||||
@@ -86,12 +86,12 @@ export default function Riddle_3({
|
|||||||
<div className={extraStyles["range"]}>
|
<div className={extraStyles["range"]}>
|
||||||
<input type="range" min={1} max={10} value={scaleValue} onChange={(e) => setScaleValue(Number.parseInt(e.target.value))}></input>
|
<input type="range" min={1} max={10} value={scaleValue} onChange={(e) => setScaleValue(Number.parseInt(e.target.value))}></input>
|
||||||
<div className="">
|
<div className="">
|
||||||
<p>Zweifel</p>
|
<p>Zweifelhaft</p>
|
||||||
<p>Würde</p>
|
<p>Würdig</p>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div className="center-flex">
|
<div className="center-flex">
|
||||||
<OldButton red={false} onAction={() => {
|
<ChargedButton red={false} onAction={() => {
|
||||||
if (scaleValue < 4) {
|
if (scaleValue < 4) {
|
||||||
takePoints(riddle.failPenaltyPoints);
|
takePoints(riddle.failPenaltyPoints);
|
||||||
} else if (scaleValue < 8) {
|
} else if (scaleValue < 8) {
|
||||||
@@ -100,11 +100,11 @@ export default function Riddle_3({
|
|||||||
addPoints(riddle.points);
|
addPoints(riddle.points);
|
||||||
}
|
}
|
||||||
setPage(2);
|
setPage(2);
|
||||||
}} disabled={buttonDebounce}>EINREICHEN!</OldButton>
|
}} disabled={buttonDebounce}>EINREICHEN!</ChargedButton>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div className={styles["buttons"]}>
|
<div className={styles["buttons"]}>
|
||||||
<OldButton red={true} disabled={buttonDebounce} onAction={() => setPage(0)}>ZURÜCK</OldButton>
|
<OldButton red={true} disabled={buttonDebounce} onAction={() => setPage(0)} className={styles["backButton"]}>ZURÜCK</OldButton>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
),
|
),
|
||||||
@@ -157,16 +157,11 @@ export default function Riddle_3({
|
|||||||
<OldButton red={false} disabled={false} onAction={() => exitFunction()}>ZURÜCK ZUR KARTE</OldButton>
|
<OldButton red={false} disabled={false} onAction={() => exitFunction()}>ZURÜCK ZUR KARTE</OldButton>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
),
|
|
||||||
(
|
|
||||||
<div key={3}>
|
|
||||||
<p>Übersprungen?</p>
|
|
||||||
<div className={styles["buttons"]}>
|
|
||||||
<OldButton red={false} disabled={false} onAction={() => exitFunction()}>ZURÜCK ZUR KARTE</OldButton>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
)
|
)
|
||||||
];
|
];
|
||||||
|
|
||||||
return requestingHint ? <RiddleHintPage riddle={riddle} dismissHintPage={dismissHint} onSkip={() => setPage(3)}/> : pages[page];
|
return requestingHint ? <RiddleHintPage riddle={riddle} dismissHintPage={dismissHint} onSkip={() => {
|
||||||
|
setScaleValue(1);
|
||||||
|
setPage(2);
|
||||||
|
}}/> : pages[page];
|
||||||
}
|
}
|
||||||
@@ -78,11 +78,11 @@ export default function Riddle_4({
|
|||||||
takePoints(riddle.failPenaltyPoints);
|
takePoints(riddle.failPenaltyPoints);
|
||||||
}
|
}
|
||||||
setPage(2);
|
setPage(2);
|
||||||
}} disabled={selection === -1} holdDuration={300}>EINREICHEN!</ChargedButton>
|
}} disabled={selection === -1}>EINREICHEN!</ChargedButton>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div className={styles["buttons"]}>
|
<div className={styles["buttons"]}>
|
||||||
<OldButton red={true} onAction={() => setPage(0)}>ZURÜCK</OldButton>
|
<OldButton red={true} onAction={() => setPage(0)} className={styles["backButton"]}>ZURÜCK</OldButton>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
),
|
),
|
||||||
@@ -124,5 +124,8 @@ export default function Riddle_4({
|
|||||||
)
|
)
|
||||||
];
|
];
|
||||||
|
|
||||||
return requestingHint ? <RiddleHintPage riddle={riddle} dismissHintPage={dismissHint} onSkip={() => setPage(2)}/> : pages[page];
|
return requestingHint ? <RiddleHintPage riddle={riddle} dismissHintPage={dismissHint} onSkip={() => {
|
||||||
|
setSelection(-1);
|
||||||
|
setPage(2);
|
||||||
|
}}/> : pages[page];
|
||||||
}
|
}
|
||||||
@@ -163,7 +163,7 @@ export default function Riddle_6({
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!popupActive && (now - lastMovementTime >= 10000)) {
|
if (!popupActive && (now - lastMovementTime >= 30000)) {
|
||||||
winRiddle();
|
winRiddle();
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
@@ -235,11 +235,11 @@ export default function Riddle_6({
|
|||||||
<p>Legt das Spielhandy vorsichtig darauf.</p>
|
<p>Legt das Spielhandy vorsichtig darauf.</p>
|
||||||
<p>Nun versucht ihr gemeinsam, das Handy so ruhig wie möglich zu halten.</p>
|
<p>Nun versucht ihr gemeinsam, das Handy so ruhig wie möglich zu halten.</p>
|
||||||
<div className="center-flex">
|
<div className="center-flex">
|
||||||
<OldButton red={false} onAction={handleStartTracking} disabled={false}>STARTEN</OldButton>
|
<ChargedButton red={false} onAction={handleStartTracking} disabled={false}>PRÜFUNG STARTEN</ChargedButton>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div className={styles["buttons"]}>
|
<div className={styles["buttons"]}>
|
||||||
<OldButton red={true} onAction={() => setPage(0)}>ZURÜCK</OldButton>
|
<OldButton red={true} onAction={() => setPage(0)} className={styles["backButton"]}>ZURÜCK</OldButton>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
),
|
),
|
||||||
@@ -279,17 +279,7 @@ export default function Riddle_6({
|
|||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div className={styles["buttons"]}>
|
<div className={styles["buttons"]}>
|
||||||
<ChargedButton
|
|
||||||
holdDuration={300}
|
|
||||||
red={true}
|
|
||||||
onAction={() => {
|
|
||||||
addPoints(riddle.points);
|
|
||||||
setPage(3);
|
|
||||||
showBanner(true);
|
|
||||||
}}
|
|
||||||
>
|
|
||||||
Überspringen (Dev)
|
|
||||||
</ChargedButton>
|
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
),
|
),
|
||||||
|
|||||||
@@ -72,7 +72,7 @@ export default function Riddle_7({
|
|||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div className={styles["buttons"]}>
|
<div className={styles["buttons"]}>
|
||||||
<OldButton red={true} onAction={() => setPage(0)}>ZURÜCK</OldButton>
|
<OldButton red={true} onAction={() => setPage(0)} className={styles["backButton"]}>ZURÜCK</OldButton>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
),
|
),
|
||||||
@@ -118,7 +118,9 @@ export default function Riddle_7({
|
|||||||
<OldButton red={true} disabled={false} onAction={() => {
|
<OldButton red={true} disabled={false} onAction={() => {
|
||||||
setPage(1);
|
setPage(1);
|
||||||
showBanner(true);
|
showBanner(true);
|
||||||
}}>ZURÜCK</OldButton>
|
}}
|
||||||
|
className={styles["backButton"]}
|
||||||
|
>ZURÜCK</OldButton>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
),
|
),
|
||||||
|
|||||||
@@ -10,6 +10,7 @@ import clsx from "clsx";
|
|||||||
import { useState } from "react";
|
import { useState } from "react";
|
||||||
import VoiceOver from "../VoiceOver";
|
import VoiceOver from "../VoiceOver";
|
||||||
import RiddleHintPage from "../RiddleHintPage";
|
import RiddleHintPage from "../RiddleHintPage";
|
||||||
|
import ChargedButton from "../ChargedButton";
|
||||||
|
|
||||||
export default function Riddle_8({
|
export default function Riddle_8({
|
||||||
page,
|
page,
|
||||||
@@ -56,7 +57,7 @@ export default function Riddle_8({
|
|||||||
<p>Kippt ihn anschließend nur auf direkt benachbarte Felder. Die dicken Linien dürfen außerdem nicht überquert werden.</p>
|
<p>Kippt ihn anschließend nur auf direkt benachbarte Felder. Die dicken Linien dürfen außerdem nicht überquert werden.</p>
|
||||||
<p>Das Symbol, das oben auf dem Würfel liegt, bestimmt, auf welches Symbol ihr als Nächstes ziehen dürft.</p>
|
<p>Das Symbol, das oben auf dem Würfel liegt, bestimmt, auf welches Symbol ihr als Nächstes ziehen dürft.</p>
|
||||||
<p>Euer Ziel ist das Feld, dessen Symbol zusätzlich mit einem <b>Stern</b> gekennzeichnet ist.</p>
|
<p>Euer Ziel ist das Feld, dessen Symbol zusätzlich mit einem <b>Stern</b> gekennzeichnet ist.</p>
|
||||||
<p>Sobald der Würfel dort angekommen ist, hebt ihn an:</p>
|
<p>Sobald der Würfel dort angekommen ist, hebt ihn an. Das Symbol auf seiner Unterseite ist eure Lösung.</p>
|
||||||
<div className="center-flex">
|
<div className="center-flex">
|
||||||
<div className={extraStyles["image-buttons"]}>
|
<div className={extraStyles["image-buttons"]}>
|
||||||
<div>
|
<div>
|
||||||
@@ -108,7 +109,7 @@ export default function Riddle_8({
|
|||||||
</button>
|
</button>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<OldButton red={false} onAction={() => {
|
<ChargedButton red={false} onAction={() => {
|
||||||
if (selection === 1) {
|
if (selection === 1) {
|
||||||
addPoints(riddle.points);
|
addPoints(riddle.points);
|
||||||
setPage(2);
|
setPage(2);
|
||||||
@@ -117,7 +118,7 @@ export default function Riddle_8({
|
|||||||
setPage(3);
|
setPage(3);
|
||||||
}
|
}
|
||||||
|
|
||||||
}} disabled={selection === -1}>PRÜFEN LASSEN!</OldButton>
|
}} disabled={selection === -1}>PRÜFEN LASSEN!</ChargedButton>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div className={styles["buttons"]}>
|
<div className={styles["buttons"]}>
|
||||||
|
|||||||
@@ -9,6 +9,7 @@ import { useState } from "react";
|
|||||||
import VoiceOver from "../VoiceOver";
|
import VoiceOver from "../VoiceOver";
|
||||||
import { addPoints, takePoints } from "@/utils/points";
|
import { addPoints, takePoints } from "@/utils/points";
|
||||||
import RiddleHintPage from "../RiddleHintPage";
|
import RiddleHintPage from "../RiddleHintPage";
|
||||||
|
import ChargedButton from "../ChargedButton";
|
||||||
|
|
||||||
export default function Riddle_9({
|
export default function Riddle_9({
|
||||||
page,
|
page,
|
||||||
@@ -38,7 +39,10 @@ export default function Riddle_9({
|
|||||||
<p>Entschlüsselt es und gebt der neuen Tafelrunde damit, was der alten am Ende fehlte.</p>
|
<p>Entschlüsselt es und gebt der neuen Tafelrunde damit, was der alten am Ende fehlte.</p>
|
||||||
</div>
|
</div>
|
||||||
<div className={styles["buttons"]}>
|
<div className={styles["buttons"]}>
|
||||||
<OldButton red={false} onAction={() => setPage(1)}>WEITER</OldButton>
|
<OldButton red={false} onAction={() => {
|
||||||
|
showBanner(false);
|
||||||
|
setPage(1);
|
||||||
|
}}>WEITER</OldButton>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
),
|
),
|
||||||
@@ -52,16 +56,15 @@ export default function Riddle_9({
|
|||||||
]}/>
|
]}/>
|
||||||
<div className={styles["content"]}>
|
<div className={styles["content"]}>
|
||||||
<p>Auf Tisch, Stuhl, Bechern und Gedecken findet ihr verschiedene <b>Symbole</b>.</p>
|
<p>Auf Tisch, Stuhl, Bechern und Gedecken findet ihr verschiedene <b>Symbole</b>.</p>
|
||||||
<p style={{fontWeight: "bold"}}>[SYMBOL 1] – [SYMBOL 2] – [SYMBOL 3] – [SYMBOL 4] – [SYMBOL 5] – [SYMBOL 6] – [SYMBOL 7] – [SYMBOL 8] – [SYMBOL 9] – [SYMBOL 10] – [SYMBOL 11] – [SYMBOL 12]</p>
|
|
||||||
<p>Die Buchstaben ergeben das Wort, das Artus für die neue Tafelrunde hinterlassen hat.</p>
|
<p>Die Buchstaben ergeben das Wort, das Artus für die neue Tafelrunde hinterlassen hat.</p>
|
||||||
<p style={{fontWeight: "bold", textAlign: "center"}}>Unter welchem Motto steht die erneuerte Tafelrunde?</p>
|
<p style={{fontWeight: "bold", textAlign: "center"}}>Unter welchem Motto steht die erneuerte Tafelrunde?</p>
|
||||||
<div className="center-flex">
|
<div className="center-flex">
|
||||||
<OldTextInput
|
<OldTextInput
|
||||||
value={answer}
|
value={answer}
|
||||||
onChange={(e) => setAnswer(e.target.value)}
|
onChange={(e) => setAnswer(e.target.value)}
|
||||||
style={{textAlign: "center"}}
|
style={{textAlign: "center", marginBottom: "2rem"}}
|
||||||
/>
|
/>
|
||||||
<OldButton red={false} onAction={() => {
|
<ChargedButton red={false} onAction={() => {
|
||||||
const v = answer.toLowerCase().trim();
|
const v = answer.toLowerCase().trim();
|
||||||
if (v.length < 12) return;
|
if (v.length < 12) return;
|
||||||
if (v === "bruderschaft" || v === "bruder schaft") {
|
if (v === "bruderschaft" || v === "bruder schaft") {
|
||||||
@@ -71,11 +74,14 @@ export default function Riddle_9({
|
|||||||
takePoints(riddle.failPenaltyPoints);
|
takePoints(riddle.failPenaltyPoints);
|
||||||
setPage(3);
|
setPage(3);
|
||||||
}
|
}
|
||||||
}} disabled={answer.toLowerCase().trim().length < 12}>WEITER</OldButton>
|
}} disabled={answer.toLowerCase().trim().length < 12}>EINREICHEN!</ChargedButton>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div className={styles["buttons"]}>
|
<div className={styles["buttons"]}>
|
||||||
<OldButton red={true} onAction={() => setPage(0)}>ZURÜCK</OldButton>
|
<OldButton red={true} onAction={() => {
|
||||||
|
showBanner(true);
|
||||||
|
setPage(0);
|
||||||
|
}} className={styles["backButton"]}>ZURÜCK</OldButton>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
),
|
),
|
||||||
@@ -95,7 +101,7 @@ export default function Riddle_9({
|
|||||||
<p>Ein weiterer Schritt zur Krone ist getan.</p>
|
<p>Ein weiterer Schritt zur Krone ist getan.</p>
|
||||||
</div>
|
</div>
|
||||||
<div className={styles["buttons"]}>
|
<div className={styles["buttons"]}>
|
||||||
<OldButton red={false} disabled={false} onAction={() => exitFunction()}>ZURÜCK ZUR KARTE</OldButton>
|
<ChargedButton red={false} disabled={false} onAction={() => exitFunction()}>ERGEBNIS ANZEIGEN</ChargedButton>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
),
|
),
|
||||||
@@ -114,7 +120,7 @@ export default function Riddle_9({
|
|||||||
<p>Euer Fehler kostet euch Ansehen, doch die Bedeutung des Vermächtnisses ist nun klar.</p>
|
<p>Euer Fehler kostet euch Ansehen, doch die Bedeutung des Vermächtnisses ist nun klar.</p>
|
||||||
</div>
|
</div>
|
||||||
<div className={styles["buttons"]}>
|
<div className={styles["buttons"]}>
|
||||||
<OldButton red={false} disabled={false} onAction={() => exitFunction()}>ZURÜCK ZUR KARTE</OldButton>
|
<ChargedButton red={false} disabled={false} onAction={() => exitFunction()}>ERGEBNIS ANZEIGEN</ChargedButton>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
)
|
)
|
||||||
|
|||||||
@@ -12,7 +12,7 @@
|
|||||||
isolation: isolate;
|
isolation: isolate;
|
||||||
cursor: pointer;
|
cursor: pointer;
|
||||||
background: transparent;
|
background: transparent;
|
||||||
color: white;
|
color: black;
|
||||||
transition: box-shadow 120ms ease, transform 120ms ease, 150ms ease-out filter, 150ms ease-out color;
|
transition: box-shadow 120ms ease, transform 120ms ease, 150ms ease-out filter, 150ms ease-out color;
|
||||||
-webkit-tap-highlight-color: transparent;
|
-webkit-tap-highlight-color: transparent;
|
||||||
user-select: none;
|
user-select: none;
|
||||||
@@ -66,4 +66,26 @@
|
|||||||
user-select: none; /* Standard */
|
user-select: none; /* Standard */
|
||||||
|
|
||||||
/*text-shadow: 0px 1px 3px rgba(0, 0, 0, 0.7);*/
|
/*text-shadow: 0px 1px 3px rgba(0, 0, 0, 0.7);*/
|
||||||
|
}
|
||||||
|
|
||||||
|
.charged-button-label-clipped {
|
||||||
|
position: absolute;
|
||||||
|
top: 0;
|
||||||
|
left: 0;
|
||||||
|
width: 100%;
|
||||||
|
height: 100%;
|
||||||
|
display: flex;
|
||||||
|
align-items: center;
|
||||||
|
justify-content: center;
|
||||||
|
z-index: 3;
|
||||||
|
pointer-events: none;
|
||||||
|
font-size: 1.1rem;
|
||||||
|
color: white;
|
||||||
|
|
||||||
|
-webkit-user-select: none;
|
||||||
|
-moz-user-select: none;
|
||||||
|
-ms-user-select: none;
|
||||||
|
user-select: none;
|
||||||
|
|
||||||
|
will-change: clip-path;
|
||||||
}
|
}
|
||||||
@@ -25,6 +25,10 @@
|
|||||||
-moz-user-select: none; /* Firefox */
|
-moz-user-select: none; /* Firefox */
|
||||||
-ms-user-select: none; /* IE10+/Edge */
|
-ms-user-select: none; /* IE10+/Edge */
|
||||||
user-select: none; /* Standard */
|
user-select: none; /* Standard */
|
||||||
|
|
||||||
|
p {
|
||||||
|
max-width: 100% !important;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
.button-disabled {
|
.button-disabled {
|
||||||
|
|||||||
@@ -19,6 +19,6 @@
|
|||||||
}
|
}
|
||||||
|
|
||||||
.status-icon {
|
.status-icon {
|
||||||
width: 32px;
|
width: 24px;
|
||||||
margin-left: 8px;
|
margin-right: 8px;
|
||||||
}
|
}
|
||||||
@@ -8,13 +8,14 @@
|
|||||||
align-items: center;
|
align-items: center;
|
||||||
justify-content: center;
|
justify-content: center;
|
||||||
bottom: 5dvh;
|
bottom: 5dvh;
|
||||||
|
row-gap: 1rem;
|
||||||
}
|
}
|
||||||
|
|
||||||
.content {
|
.content {
|
||||||
height: 100%;
|
height: 100%;
|
||||||
max-height: 50dvh;
|
max-height: 50dvh;
|
||||||
p {
|
p {
|
||||||
font-size: 1.2rem;
|
font-size: 1.3rem;
|
||||||
margin-bottom: 1rem;
|
margin-bottom: 1rem;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -24,3 +25,9 @@
|
|||||||
max-height: 35dvh;
|
max-height: 35dvh;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.backButton {
|
||||||
|
img {
|
||||||
|
width: 180px;
|
||||||
|
}
|
||||||
|
}
|
||||||
Reference in new issue
Block a user