1 parent
1e0d900376
commit
abf1c2990c
3 files changed
+45
-67
No files matched your search
@@ -1,28 +1,28 @@
|
||||
'use client';
|
||||
"use client";
|
||||
|
||||
import { useLocalStorage } from '@/hooks/useLocalStorage'
|
||||
import { PREF } from '@/utils/const'
|
||||
import { parsePlayerData } from '@/utils/dataparser';
|
||||
import ChargedButton from '../ChargedButton';
|
||||
import styles from '@/css/Tour.module.css';
|
||||
import MapView, { PlaceMarker } from '../MapView';
|
||||
import { useEffect, useState } from 'react';
|
||||
import { usePermissions } from '@/hooks/usePermission';
|
||||
import PermissionCheck from '../PermissionCheck';
|
||||
import { useLocalStorage } from "@/hooks/useLocalStorage"
|
||||
import { PREF } from "@/utils/const"
|
||||
import { parsePlayerData } from "@/utils/dataparser";
|
||||
import ChargedButton from "../ChargedButton";
|
||||
import styles from "@/css/Tour.module.css";
|
||||
import MapView, { PlaceMarker } from "../MapView";
|
||||
import { useEffect, useState } from "react";
|
||||
import { usePermissions } from "@/hooks/usePermission";
|
||||
import PermissionCheck from "../PermissionCheck";
|
||||
|
||||
export default function Tour() {
|
||||
const [ stepStr, setStep ] = useLocalStorage(PREF.step, '0');
|
||||
const [ tourCode, setTourCode ] = useLocalStorage(PREF.code, '');
|
||||
const [ completedRiddlesStr, setCompletedRiddles ] = useLocalStorage(PREF.completed_riddles, '');
|
||||
const [ playersStr, setPlayers ] = useLocalStorage(PREF.players, '');
|
||||
const [ pointsStr, setPoints ] = useLocalStorage(PREF.points, '0');
|
||||
const [ stepStr, setStep ] = useLocalStorage(PREF.step, "0");
|
||||
const [ tourCode, setTourCode ] = useLocalStorage(PREF.code, "");
|
||||
const [ completedRiddlesStr, setCompletedRiddles ] = useLocalStorage(PREF.completed_riddles, "");
|
||||
const [ playersStr, setPlayers ] = useLocalStorage(PREF.players, "");
|
||||
const [ pointsStr, setPoints ] = useLocalStorage(PREF.points, "0");
|
||||
const [ markers, setMarkers ] = useState<PlaceMarker[]>([]);
|
||||
const { gpsStatus, cameraStatus } = usePermissions();
|
||||
const step = Number.parseInt(stepStr) || 0;
|
||||
const points = Number.parseInt(pointsStr) || 0;
|
||||
const players = parsePlayerData(playersStr);
|
||||
|
||||
const permissionsGranted = gpsStatus === 'granted' && cameraStatus === 'granted';
|
||||
const permissionsGranted = gpsStatus === "granted" && cameraStatus === "granted";
|
||||
|
||||
const [ test, setTest ] = useState(false);
|
||||
|
||||
@@ -34,9 +34,9 @@ export default function Tour() {
|
||||
navigator.geolocation.getCurrentPosition(
|
||||
(position) => {
|
||||
setMarkers([{
|
||||
id: 'riddle_one',
|
||||
title: 'Erstes Rätsel',
|
||||
description: 'Test Punkt verschoben vom Standort',
|
||||
id: "riddle_one",
|
||||
title: "Erstes Rätsel",
|
||||
description: "Test Punkt verschoben vom Standort",
|
||||
lng: position.coords.longitude + 0.002,
|
||||
lat: position.coords.latitude,
|
||||
}]);
|
||||
@@ -54,31 +54,31 @@ export default function Tour() {
|
||||
}, []);
|
||||
|
||||
return (
|
||||
<div className={styles['screen-container']}>
|
||||
<div className={styles['top-bar']}>
|
||||
<div className={styles['top-bar-content']}>
|
||||
<div className={styles['points-outer-box']}>
|
||||
<div className={styles['points-inner-box']}>
|
||||
<div className={styles["screen-container"]}>
|
||||
<div className={styles["top-bar"]}>
|
||||
<div className={styles["top-bar-content"]}>
|
||||
<div className={styles["points-outer-box"]}>
|
||||
<div className={styles["points-inner-box"]}>
|
||||
Your content goes here
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div className={styles['main-content']}>
|
||||
<div className={styles['map']}>
|
||||
<div className={styles["main-content"]}>
|
||||
<div className={styles["map"]}>
|
||||
<MapView markers={markers} onMarkerClick={(marker) => {
|
||||
if (marker.id === 'riddle_one') {
|
||||
if (marker.id === "riddle_one") {
|
||||
setTest(true);
|
||||
}
|
||||
}}></MapView>
|
||||
</div>
|
||||
<div className={styles['riddle-overlay']} style={{display: test ? 'block' : 'none'}} onClick={() => setTest(false)}>
|
||||
<div className={styles["riddle-overlay"]} style={{display: test ? "block" : "none"}} onClick={() => setTest(false)}>
|
||||
<p>Riddle Overlay</p>
|
||||
<p>Idealer weise dann mit Popup Animation (Slide In oder Fade In)</p>
|
||||
<p>Klicken um zu schließen</p>
|
||||
</div>
|
||||
{ !permissionsGranted ?
|
||||
<div className={styles['permissions-overlay']}>
|
||||
<div className={styles["permissions-overlay"]}>
|
||||
<PermissionCheck></PermissionCheck>
|
||||
</div>
|
||||
: null
|
||||
@@ -86,4 +86,4 @@ export default function Tour() {
|
||||
</div>
|
||||
</div>
|
||||
)
|
||||
}
|
||||
}
|
||||
+14
-35
@@ -5,7 +5,6 @@
|
||||
width: 100%;
|
||||
overflow: hidden;
|
||||
}
|
||||
|
||||
.top-bar {
|
||||
position: absolute;
|
||||
top: 0;
|
||||
@@ -15,7 +14,7 @@
|
||||
height: 120px;
|
||||
z-index: 2;
|
||||
background-color: transparent;
|
||||
|
||||
|
||||
--corner-radius: 20px;
|
||||
--border-width: 2px;
|
||||
}
|
||||
@@ -26,15 +25,15 @@
|
||||
inset: 0;
|
||||
background-color: var(--dark-brown, #3d2b1f);
|
||||
z-index: -2;
|
||||
|
||||
|
||||
--r: var(--corner-radius);
|
||||
|
||||
|
||||
-webkit-mask:
|
||||
linear-gradient(black, black) top center / 100% calc(100% - var(--r) + 1px) no-repeat,
|
||||
linear-gradient(black, black) top center / calc(100% - 2 * var(--r) + 1px) 100% no-repeat,
|
||||
radial-gradient(circle at 0 100%, transparent var(--r), black calc(var(--r) + 0.5px)) bottom left / var(--r) var(--r) no-repeat,
|
||||
radial-gradient(circle at 100% 100%, transparent var(--r), black calc(var(--r) + 0.5px)) bottom right / var(--r) var(--r) no-repeat;
|
||||
|
||||
|
||||
mask:
|
||||
linear-gradient(black, black) top center / 100% calc(100% - var(--r) + 1px) no-repeat,
|
||||
linear-gradient(black, black) top center / calc(100% - 2 * var(--r) + 1px) 100% no-repeat,
|
||||
@@ -55,13 +54,13 @@
|
||||
|
||||
--b: var(--border-width);
|
||||
--r-inner: calc(var(--corner-radius) + var(--b));
|
||||
|
||||
|
||||
-webkit-mask:
|
||||
linear-gradient(black, black) top center / 100% calc(100% - var(--r-inner) + 1px) no-repeat,
|
||||
linear-gradient(black, black) top center / calc(100% - 2 * var(--r-inner) + 1px) calc(100% - var(--b)) no-repeat,
|
||||
radial-gradient(circle at 0 100%, transparent var(--r-inner), black calc(var(--r-inner) + 0.5px)) bottom left / var(--r-inner) var(--r-inner) no-repeat,
|
||||
radial-gradient(circle at 100% 100%, transparent var(--r-inner), black calc(var(--r-inner) + 0.5px)) bottom right / var(--r-inner) var(--r-inner) no-repeat;
|
||||
|
||||
|
||||
mask:
|
||||
linear-gradient(black, black) top center / 100% calc(100% - var(--r-inner) + 1px) no-repeat,
|
||||
linear-gradient(black, black) top center / calc(100% - 2 * var(--r-inner) + 1px) calc(100% - var(--b)) no-repeat,
|
||||
@@ -71,7 +70,7 @@
|
||||
|
||||
.top-bar-content {
|
||||
padding: 8px;
|
||||
position: relative;
|
||||
position: relative;
|
||||
z-index: 1;
|
||||
}
|
||||
|
||||
@@ -80,7 +79,7 @@
|
||||
flex: 1;
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
min-height: 0;
|
||||
min-height: 0;
|
||||
}
|
||||
|
||||
.map {
|
||||
@@ -95,9 +94,10 @@
|
||||
top: 0;
|
||||
left: 0;
|
||||
width: 100%;
|
||||
/*height: 100%; TODO: fullsize when doing this*/
|
||||
padding: 1rem;
|
||||
background-color: #000000AA;
|
||||
z-index: 10;
|
||||
z-index: 10;
|
||||
}
|
||||
|
||||
.permissions-overlay {
|
||||
@@ -108,41 +108,20 @@
|
||||
height: 100%;
|
||||
padding: 1rem;
|
||||
background-color: #000000AA;
|
||||
z-index: 10;
|
||||
z-index: 10;
|
||||
}
|
||||
|
||||
.points-outer-box {
|
||||
position: relative;
|
||||
width: 300px;
|
||||
height: 200px;
|
||||
padding: 3px;
|
||||
box-sizing: content-box;
|
||||
background-color: #3498db;
|
||||
color: #fff;
|
||||
border-radius: 20px;
|
||||
overflow: hidden;
|
||||
|
||||
/* inverted (concave) corners: a rounded border keeps the box solid */
|
||||
border: 3px solid #fff;
|
||||
outline-offset: -15px;
|
||||
outline: none;
|
||||
|
||||
/* background mask with an inward-dipping concave corner path (concave-up) */
|
||||
-webkit-mask:
|
||||
linear-gradient(#000) 0 0 / 100% 50% round,
|
||||
linear-gradient(#000) 100% 100% / 100% 50% round,
|
||||
linear-gradient(#fff) 0 100% / 10px 5px round;
|
||||
mask:
|
||||
linear-gradient(#000) 0 0 / 100% 50% round,
|
||||
linear-gradient(#000) 100% 100% / 100% 50% round,
|
||||
linear-gradient(#fff) 0 100% / 10px 5px round;
|
||||
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
|
||||
-webkit-mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 320 200'%3E%3Cpath d='M 20 0 Q 0 0 0 20 L 0 180 Q 0 200 20 200 L 300 200 Q 320 200 320 180 L 320 200 Z'/%3E%3C/svg%3E");
|
||||
}
|
||||
|
||||
.points-inner-box {
|
||||
padding: 30px;
|
||||
color: #fff;
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user