Voiceovers, Hints
This commit is contained in:
1 parent
83888a21e1
commit
43e02d5e08
63 files changed
+103
-23
No files matched your search
@@ -23,6 +23,8 @@ export interface RiddleScreenControls {
|
||||
page: number;
|
||||
setPage: (pageIndex: number) => void;
|
||||
voiceOverMode: VoiceOverMode;
|
||||
requestingHint: boolean;
|
||||
dismissHint: () => void;
|
||||
};
|
||||
|
||||
interface RiddleScreenProps {
|
||||
@@ -32,6 +34,7 @@ interface RiddleScreenProps {
|
||||
|
||||
export default function RiddleScreen({ riddle, onDismiss }: RiddleScreenProps) {
|
||||
const [page, setPage ] = useState(0);
|
||||
const [ showHintPage, setShowHintPage ] = useState(false);
|
||||
const [ voiceOverState, setVoiceOverState ] = useLocalStorage(PREF.voiceover, "off");
|
||||
const [ showBanner, setShowBanner ] = useState(true);
|
||||
const contentRef = useRef<HTMLDivElement | null>(null);
|
||||
@@ -55,6 +58,10 @@ export default function RiddleScreen({ riddle, onDismiss }: RiddleScreenProps) {
|
||||
"showBanner": setShowBanner,
|
||||
"exitFunction": exitFunction,
|
||||
"voiceOverMode": voiceOverState as VoiceOverMode,
|
||||
"requestingHint": showHintPage,
|
||||
"dismissHint": () => {
|
||||
setShowHintPage(false);
|
||||
}
|
||||
};
|
||||
|
||||
const riddleComponents: Record<string, ComponentType<RiddleScreenControls>> = {
|
||||
@@ -84,12 +91,12 @@ export default function RiddleScreen({ riddle, onDismiss }: RiddleScreenProps) {
|
||||
}} alt="Background" loading="eager"/>
|
||||
<StyledContainer riddleDesign={true}>
|
||||
<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={() => alert("Error: Hinweis-Daten nicht geladen")} />
|
||||
<img src={"/icons/hinweis.svg"} className={styles["bookmark-icon"]} style={{width: "20px", 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={() => {
|
||||
setVoiceOverState(voiceOverState === "off" ? "on" : "off");
|
||||
}} />
|
||||
</div>
|
||||
<img src="/icons/kreuz.svg" className={styles["close"]} onClick={onDismiss}/>
|
||||
<img src="/icons/kreuz.svg" className={styles["close"]} onClick={exitFunction}/>
|
||||
<div className={styles["content-container"]} ref={contentRef}>
|
||||
{ showBanner ? <div className={styles["title"]}>
|
||||
<p className="eisenkraft-regular" style={{fontSize: "1.25rem", color: "var(--blue)"}}>{riddle["station_name"]}</p>
|
||||
|
||||
Reference in new issue
Block a user