diff --git a/public/Startseite_Hintergrund.webp b/public/Startseite_Hintergrund.webp deleted file mode 100644 index fc71e19..0000000 Binary files a/public/Startseite_Hintergrund.webp and /dev/null differ diff --git a/public/bg/Eingabefeld.webp b/public/bg/Eingabefeld.webp new file mode 100644 index 0000000..73abd6e Binary files /dev/null and b/public/bg/Eingabefeld.webp differ diff --git a/public/bg/Eingabefeld_Umrandung.webp b/public/bg/Eingabefeld_Umrandung.webp new file mode 100644 index 0000000..823921b Binary files /dev/null and b/public/bg/Eingabefeld_Umrandung.webp differ diff --git a/public/bg/Hintergrund_ohne_Verzierung.webp b/public/bg/Hintergrund_ohne_Verzierung.webp new file mode 100644 index 0000000..2de0789 Binary files /dev/null and b/public/bg/Hintergrund_ohne_Verzierung.webp differ diff --git a/public/bg/Pop-Up.webp b/public/bg/Pop-Up.webp new file mode 100644 index 0000000..d062f56 Binary files /dev/null and b/public/bg/Pop-Up.webp differ diff --git a/public/bg/Startseite_ohne_Verzierung.webp b/public/bg/Startseite_ohne_Verzierung.webp new file mode 100644 index 0000000..36cb918 Binary files /dev/null and b/public/bg/Startseite_ohne_Verzierung.webp differ diff --git a/public/buttons/Button_blau_kurz.webp b/public/buttons/Button_blau_kurz.webp new file mode 100644 index 0000000..69fa6d6 Binary files /dev/null and b/public/buttons/Button_blau_kurz.webp differ diff --git a/public/buttons/Button_blau_lang.webp b/public/buttons/Button_blau_lang.webp new file mode 100644 index 0000000..58aa6e6 Binary files /dev/null and b/public/buttons/Button_blau_lang.webp differ diff --git a/public/buttons/Button_m.webp b/public/buttons/Button_m.webp new file mode 100644 index 0000000..cd42259 Binary files /dev/null and b/public/buttons/Button_m.webp differ diff --git a/public/buttons/Button_rot_kurz.webp b/public/buttons/Button_rot_kurz.webp new file mode 100644 index 0000000..ac609d0 Binary files /dev/null and b/public/buttons/Button_rot_kurz.webp differ diff --git a/public/buttons/Button_rot_lang.webp b/public/buttons/Button_rot_lang.webp new file mode 100644 index 0000000..fd566a6 Binary files /dev/null and b/public/buttons/Button_rot_lang.webp differ diff --git a/public/buttons/Button_w.webp b/public/buttons/Button_w.webp new file mode 100644 index 0000000..79cc7fd Binary files /dev/null and b/public/buttons/Button_w.webp differ diff --git a/public/buttons/lesezeichen-ohne icons.webp b/public/buttons/lesezeichen-ohne icons.webp new file mode 100644 index 0000000..d758c92 Binary files /dev/null and b/public/buttons/lesezeichen-ohne icons.webp differ diff --git a/public/container/Ecke_Verzierung.webp b/public/container/Ecke_Verzierung.webp new file mode 100644 index 0000000..814f1f0 Binary files /dev/null and b/public/container/Ecke_Verzierung.webp differ diff --git a/public/container/Rand_Verzierung.webp b/public/container/Rand_Verzierung.webp new file mode 100644 index 0000000..4ca313c Binary files /dev/null and b/public/container/Rand_Verzierung.webp differ diff --git a/public/container/Rand_oben.webp b/public/container/Rand_oben.webp new file mode 100644 index 0000000..4460b7f Binary files /dev/null and b/public/container/Rand_oben.webp differ diff --git a/public/container/corner-bottom-left.webp b/public/container/corner-bottom-left.webp deleted file mode 100644 index b615747..0000000 Binary files a/public/container/corner-bottom-left.webp and /dev/null differ diff --git a/public/container/corner-bottom-right.webp b/public/container/corner-bottom-right.webp deleted file mode 100644 index b372817..0000000 Binary files a/public/container/corner-bottom-right.webp and /dev/null differ diff --git a/public/container/corner-top-left.webp b/public/container/corner-top-left.webp deleted file mode 100644 index f62fab1..0000000 Binary files a/public/container/corner-top-left.webp and /dev/null differ diff --git a/public/container/corner-top-right.webp b/public/container/corner-top-right.webp deleted file mode 100644 index 593c05a..0000000 Binary files a/public/container/corner-top-right.webp and /dev/null differ diff --git a/public/container/line-bottom-left.webp b/public/container/line-bottom-left.webp deleted file mode 100644 index e332f8c..0000000 Binary files a/public/container/line-bottom-left.webp and /dev/null differ diff --git a/public/container/line-bottom-right.webp b/public/container/line-bottom-right.webp deleted file mode 100644 index 6f40c23..0000000 Binary files a/public/container/line-bottom-right.webp and /dev/null differ diff --git a/public/container/line-top-left.webp b/public/container/line-top-left.webp deleted file mode 100644 index d757779..0000000 Binary files a/public/container/line-top-left.webp and /dev/null differ diff --git a/public/container/line-top-right.webp b/public/container/line-top-right.webp deleted file mode 100644 index 36afe40..0000000 Binary files a/public/container/line-top-right.webp and /dev/null differ diff --git a/public/container/symbol-left.webp b/public/container/symbol-left.webp deleted file mode 100644 index 3c5527d..0000000 Binary files a/public/container/symbol-left.webp and /dev/null differ diff --git a/public/container/symbol-right.webp b/public/container/symbol-right.webp deleted file mode 100644 index bae0d97..0000000 Binary files a/public/container/symbol-right.webp and /dev/null differ diff --git a/public/icons/Schwert-gps.svg b/public/icons/Schwert-gps.svg new file mode 100644 index 0000000..d0bd7ec --- /dev/null +++ b/public/icons/Schwert-gps.svg @@ -0,0 +1,40 @@ + + + + + + diff --git a/public/icons/haken.svg b/public/icons/haken.svg new file mode 100644 index 0000000..2800c18 --- /dev/null +++ b/public/icons/haken.svg @@ -0,0 +1,13 @@ + + + + + + + + + \ No newline at end of file diff --git a/public/icons/hinweis.svg b/public/icons/hinweis.svg new file mode 100644 index 0000000..e3e0701 --- /dev/null +++ b/public/icons/hinweis.svg @@ -0,0 +1,17 @@ + + + + + + + + + + + + + \ No newline at end of file diff --git a/public/icons/icon-192x192.png b/public/icons/icon-192x192.png deleted file mode 100644 index 15a43a1..0000000 Binary files a/public/icons/icon-192x192.png and /dev/null differ diff --git a/public/icons/icon-512x512.png b/public/icons/icon-512x512.png deleted file mode 100644 index 79d5a80..0000000 Binary files a/public/icons/icon-512x512.png and /dev/null differ diff --git a/public/icons/king.svg b/public/icons/king.svg new file mode 100644 index 0000000..0d622a7 --- /dev/null +++ b/public/icons/king.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/public/icons/kreuz.svg b/public/icons/kreuz.svg new file mode 100644 index 0000000..0df5bbd --- /dev/null +++ b/public/icons/kreuz.svg @@ -0,0 +1,13 @@ + + + + + + + + + \ No newline at end of file diff --git a/public/icons/krone.svg b/public/icons/krone.svg new file mode 100644 index 0000000..b46b342 --- /dev/null +++ b/public/icons/krone.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/public/icons/person.svg b/public/icons/person.svg new file mode 100644 index 0000000..da3f0b9 --- /dev/null +++ b/public/icons/person.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/public/icons/pfeil.svg b/public/icons/pfeil.svg new file mode 100644 index 0000000..3e3e267 --- /dev/null +++ b/public/icons/pfeil.svg @@ -0,0 +1,13 @@ + + + + + + + + + \ No newline at end of file diff --git a/public/icons/queen.svg b/public/icons/queen.svg new file mode 100644 index 0000000..8bc7e54 --- /dev/null +++ b/public/icons/queen.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/public/icons/sprechblase.svg b/public/icons/sprechblase.svg new file mode 100644 index 0000000..04f5bc4 --- /dev/null +++ b/public/icons/sprechblase.svg @@ -0,0 +1,13 @@ + + + + + + + + + \ No newline at end of file diff --git a/src/app/globals.css b/src/app/globals.css index 2e1e63e..e041843 100644 --- a/src/app/globals.css +++ b/src/app/globals.css @@ -16,10 +16,6 @@ font-family: 'Lancelot'; } -.test { - color: red; -} - .lancelot-italic { font-family: 'Lancelot'; font-style: oblique 15deg; @@ -37,6 +33,12 @@ :root { --background: #ffffff; --foreground: #171717; + + --blue: #294a97; + --dark-brown: #38241b; + --light-blue: #3f8fca; + --light-brown: #bfb2a1; + --green: #008539; } @media (prefers-color-scheme: dark) { @@ -66,7 +68,8 @@ body { min-height: 100%; display: flex; flex-direction: column; - color: var(--foreground); + /*color: var(--foreground);*/ + color: var(--dark-brown); background: var(--background); font-family: Arial, Helvetica, sans-serif; -webkit-font-smoothing: antialiased; diff --git a/src/app/layout.tsx b/src/app/layout.tsx index b70e560..691ec77 100644 --- a/src/app/layout.tsx +++ b/src/app/layout.tsx @@ -1,17 +1,7 @@ import { SerwistProvider } from "@serwist/turbopack/react"; import type { Metadata, Viewport } from "next"; -import { Geist, Geist_Mono } from "next/font/google"; import "./globals.css"; - -const geistSans = Geist({ - variable: "--font-geist-sans", - subsets: ["latin"], -}); - -const geistMono = Geist_Mono({ - variable: "--font-geist-mono", - subsets: ["latin"], -}); +import clsx from "clsx"; export const metadata: Metadata = { title: "Excalibur Outdoor Tour", @@ -20,8 +10,9 @@ export const metadata: Metadata = { export default function RootLayout({ children }: LayoutProps<"/">) { return ( - + + {children} diff --git a/src/app/manifest.ts b/src/app/manifest.ts index a4c3c59..c9b9a86 100644 --- a/src/app/manifest.ts +++ b/src/app/manifest.ts @@ -13,7 +13,7 @@ export default function manifest(): MetadataRoute.Manifest { background_color: '#000000', theme_color: '#ffffff', icons: [ - { + /*{ src: '/icons/icon-192x192.png', sizes: '192x192', type: 'image/png', @@ -22,7 +22,7 @@ export default function manifest(): MetadataRoute.Manifest { src: '/icons/icon-512x512.png', sizes: '512x512', type: 'image/png', - }, + },*/ ], } } \ No newline at end of file diff --git a/src/app/page.module.css b/src/app/page.module.css index 61cf2f1..3261798 100644 --- a/src/app/page.module.css +++ b/src/app/page.module.css @@ -14,7 +14,6 @@ flex-direction: column; align-items: center; justify-content: center; - font-family: var(--font-geist-sans); background-color: var(--background); &.pad { diff --git a/src/app/page.tsx b/src/app/page.tsx index 98157a2..875d414 100644 --- a/src/app/page.tsx +++ b/src/app/page.tsx @@ -27,24 +27,14 @@ export default function Main() { console.log("TourCode", tourCode); const content = [ - (

Test!

), (), (), () ]; return ( -
+
- {content[step]}
diff --git a/src/components/MapView.tsx b/src/components/MapView.tsx index 7584a4a..917c200 100644 --- a/src/components/MapView.tsx +++ b/src/components/MapView.tsx @@ -141,7 +141,7 @@ export default function MapView({ }` ); - const newMarker = new maplibregl.Marker({ color: '#e11d48' }) + const newMarker = new maplibregl.Marker({ color: '#e11d48', }) .setLngLat([markerData.lng, markerData.lat]) .setPopup(popup) .addTo(map); diff --git a/src/components/OldButton.tsx b/src/components/OldButton.tsx new file mode 100644 index 0000000..a9dacc1 --- /dev/null +++ b/src/components/OldButton.tsx @@ -0,0 +1,40 @@ +"use client"; + +import React, { CSSProperties } from 'react'; +import styles from "@/css/OldButton.module.css"; +import clsx from 'clsx'; + +interface OldButtonProps { + children?: string; + long?: boolean; + red?: boolean; + disabled?: boolean; + className?: string; + style?: CSSProperties; + onAction?: () => void; +}; + +export default function OldButton({children, long=true, red=true, disabled=false, className, style, onAction}: OldButtonProps) { + return ( + + ); +} \ No newline at end of file diff --git a/src/components/OldTextInput.tsx b/src/components/OldTextInput.tsx new file mode 100644 index 0000000..cd5058c --- /dev/null +++ b/src/components/OldTextInput.tsx @@ -0,0 +1,37 @@ +import clsx from "clsx"; +import { ChangeEventHandler, CSSProperties } from "react"; +import styles from "@/css/OldTextInput.module.css"; + +interface OldTextInput { + value?: string; + onChange?: ChangeEventHandler; + ariaLabel?: string; + placeholder?: string; + style?: CSSProperties; + className?: string; + disabled?: boolean; +}; + +export default function OldTextInput({ + value, + onChange, + ariaLabel, + placeholder, + style, + className, + disabled = false, +}: OldTextInput) { + return ( + + ); +} \ No newline at end of file diff --git a/src/components/PermissionCheck.tsx b/src/components/PermissionCheck.tsx index 33dd739..bf6cb36 100644 --- a/src/components/PermissionCheck.tsx +++ b/src/components/PermissionCheck.tsx @@ -2,7 +2,9 @@ import { usePermissions } from "@/hooks/usePermission"; import { PermissionStateResult } from "@/utils/permissions"; -import { useEffect } from "react"; +import { useEffect, useState } from "react"; +import styles from "@/css/PermissionCheck.module.css"; +import OldButton from "./OldButton"; export interface PermissionCheckProps { onRefresh?: (gps: PermissionStateResult, camera: PermissionStateResult) => void; @@ -12,6 +14,8 @@ export default function PermissionCheck({ onRefresh }: PermissionCheckProps) { const { gpsStatus, cameraStatus, refresh } = usePermissions(); + const [ isCamPermissionLoading, setIsCamPermissionLoading ] = useState(false); + const [ isGPSPermissionLoading, setIsGPSPermissionLoading ] = useState(false); useEffect(() => { if (onRefresh) { @@ -20,29 +24,61 @@ export default function PermissionCheck({ }, [onRefresh, gpsStatus, cameraStatus]); const requestGPSPermission = () => { - navigator.geolocation.getCurrentPosition(() => refresh, () => refresh); + setIsGPSPermissionLoading(true); + navigator.geolocation.getCurrentPosition((pos) => { + setIsGPSPermissionLoading(false); + refresh(); + }, (e) => { + setIsGPSPermissionLoading(false); + refresh(); + }, { + enableHighAccuracy: true, + timeout: 3000 + }); } const requestCamPermission = () => { + setIsCamPermissionLoading(true); navigator.mediaDevices.getUserMedia({ "video": { facingMode: { ideal: "environment" } }, "audio": false, }).then((stream) => { + setIsCamPermissionLoading(false); refresh(); stream.getTracks().forEach(track => track.stop()); - alert("Keine Sorge! Die Kamera ist wieder ausgeschalten. Der Gerät zeigt Ihnen nur, dass darauf kurz zugegriffen wurde."); - }).catch((e) => refresh); + alert("Keine Sorge! Die Kamera wurde wieder ausgeschalten. Das Gerät zeigt Ihnen nur, dass darauf kurz zugegriffen wurde."); + }).catch((e) => { + setIsCamPermissionLoading(false); + refresh(); + }); } + /**/ + return ( -
-

Für diese Tour werden extra Berechtigungen gebraucht.

-

Kamera: {cameraStatus}

-

GPS: {gpsStatus}

+
+

Berechtigungen



- - - +

Für diese Rätseltour werden Berechtigungen gebraucht.

+

+

Ohne diese Berechtigungen ist das Spiel nicht spielbar.

+

+
+ + Kamera-Berechtigung + {`Status +
+

+
+ GPS-Berechtigung + {`Status +
) } \ No newline at end of file diff --git a/src/components/StyledContainer.tsx b/src/components/StyledContainer.tsx index 394239d..c836111 100644 --- a/src/components/StyledContainer.tsx +++ b/src/components/StyledContainer.tsx @@ -18,28 +18,20 @@ export default function StyledContainer({children, outerStyles, innerStyles, out return (
-
- - +
+ +
-
-
- - - -
+
+
{children}
-
- - - -
+
-
- - +
+ +
); diff --git a/src/components/screens/Intro.tsx b/src/components/screens/Intro.tsx index aeb6829..e5a8804 100644 --- a/src/components/screens/Intro.tsx +++ b/src/components/screens/Intro.tsx @@ -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 (
- { !rewatchScreen ? -
-

CODE EINGELÖST

-

TON AN

- -

- { - setRewatchScreen(true); - }} holdDuration={500} disabled={!granted}> - Video ansehen - -
- -
-
- : -
- - { !videoEnded && videoPaused ? -
- Pause Icon + Background + + { !rewatchScreen ? +
+ + WEITER + { false && { + setRewatchScreen(true); + }} holdDuration={500} disabled={!granted}> + Halten, um das Video ansehen + }
: - null +
+ + { !videoEnded && videoPaused ? +
+ Pause Icon +
+ : + null + } + { videoEnded ?
+ { + if (introVideoRef.current) { + introVideoRef.current.pause(); + introVideoRef.current.currentTime = 0; + introVideoRef.current.play(); + setVideoEnded(false); + } + }}>Video wiederholen? + { + setStep("2"); + }}>Wir sind bereit! +
: null } +
} - { videoEnded ?
- { - if (introVideoRef.current) { - introVideoRef.current.pause(); - introVideoRef.current.currentTime = 0; - introVideoRef.current.play(); - setVideoEnded(false); - } - }}>Video wiederholen? - { - setStep("2"); - }}>Wir sind bereit! -
: null } -
- } +
) } \ No newline at end of file diff --git a/src/components/screens/WelcomeScreen.tsx b/src/components/screens/WelcomeScreen.tsx index 41d3d07..c8ce863 100644 --- a/src/components/screens/WelcomeScreen.tsx +++ b/src/components/screens/WelcomeScreen.tsx @@ -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 (
- -

- +

+ - {(!buttonDisabled) ? "Halten zum Spielen!" : "Halten zum Spielen."} -
+ onAction={submit} + > + WEITER + + { false ? + {(!buttonDisabled) ? "Halten zum Spielen!" : "Halten zum Spielen."} + : null} +
); } diff --git a/src/css/Intro.module.css b/src/css/Intro.module.css index adde40d..16b4b9e 100644 --- a/src/css/Intro.module.css +++ b/src/css/Intro.module.css @@ -1,3 +1,9 @@ +.permission-container { + text-align: center; + align-items: center; + justify-content: center; +} + .intro-video-container { position: relative; } diff --git a/src/css/OldButton.module.css b/src/css/OldButton.module.css new file mode 100644 index 0000000..5f90b13 --- /dev/null +++ b/src/css/OldButton.module.css @@ -0,0 +1,28 @@ +.button { + position: relative; + background: none; + border: none; + display: flex; + align-items: center; + justify-content: center; + transition: 150ms ease-out filter; +} + +.image { + position: relative; + width: 250px; +} + +.label { + position: absolute; + font-size: 1.25rem; + transition: 150ms ease-out color; +} + +.button-disabled { + filter: grayscale(0.75); +} + +.label-disabled { + color: black; +} \ No newline at end of file diff --git a/src/css/OldTextInput.module.css b/src/css/OldTextInput.module.css new file mode 100644 index 0000000..4f99ddc --- /dev/null +++ b/src/css/OldTextInput.module.css @@ -0,0 +1,30 @@ +.input { + position: relative; + border: none; + width: 280px; + height: auto; + display: flex; + align-items: center; + justify-content: center; + transition: 150ms ease-out filter; + background-image: url("/bg/Eingabefeld.webp"); + background-position: center; + background-size: contain; + background-repeat: no-repeat; + background-color: transparent; + padding: 1rem 2rem; + font-size: 1.5rem; + --color: #afb2a3; + color: white; + &::placeholder { + color: var(--color); + } + &:focus { + outline: none; + } +} + +.input-disabled { + filter: grayscale(0.75); + color: black; +} \ No newline at end of file diff --git a/src/css/PermissionCheck.module.css b/src/css/PermissionCheck.module.css new file mode 100644 index 0000000..edfe730 --- /dev/null +++ b/src/css/PermissionCheck.module.css @@ -0,0 +1,24 @@ +.modal { + text-align: center; + display: flex; + flex-direction: column; + align-items: center; + + p { + max-width: 75%; + font-size: 1.25rem; + } +} + +.status-row { + display: flex; + flex-direction: row; + flex-wrap: nowrap; + align-items: center; + justify-content: center; +} + +.status-icon { + width: 32px; + margin-left: 8px; +} diff --git a/src/css/PermissionModal.module.css b/src/css/PermissionModal.module.css deleted file mode 100644 index e69de29..0000000 diff --git a/src/css/StyledContainer.module.css b/src/css/StyledContainer.module.css index 04a00ab..be5ee5d 100644 --- a/src/css/StyledContainer.module.css +++ b/src/css/StyledContainer.module.css @@ -2,18 +2,33 @@ display: flex; flex-direction: column; width: 100%; - z-index: 10; + height: 100dvh; + justify-content: space-between; + position: relative; + z-index: 2; } .bar { + width: 100%; + position: absolute; display: flex; flex-direction: row; justify-content: space-between; - padding-left: 5.5%; - padding-right: 5.5%; + padding-left: 6dvw; + padding-right: 6dvw; +} + +.content-bar { + width: 100%; + display: flex; + flex-direction: row; + justify-content: space-between; + padding-left: 6dvw; + padding-right: 6dvw; } .content { + padding: 0px 3dvw; display: flex; flex-direction: column; flex: 1; @@ -28,12 +43,10 @@ .corner { width: 21%; + max-width: 200px; } -.line { - -} - -.symbol { - padding: 14% 0px; +.side { + padding: 15% 0px; + max-height: 80dvh; } \ No newline at end of file diff --git a/src/css/WelcomeScreen.module.css b/src/css/WelcomeScreen.module.css index e69de29..d9fe2db 100644 --- a/src/css/WelcomeScreen.module.css +++ b/src/css/WelcomeScreen.module.css @@ -0,0 +1,4 @@ +.content { + justify-content: flex-end; + align-items: center; +} \ No newline at end of file