1 parent
1e0d900376
commit
abf1c2990c
3 files changed
+32
-54
No files matched your search
Vendored
+1
-2
@@ -1,4 +1,3 @@
|
|||||||
{
|
{
|
||||||
"compilets.autoStart": false,
|
"compilets.autoStart": false
|
||||||
"pendant.showThinking": true
|
|
||||||
}
|
}
|
||||||
@@ -1,28 +1,28 @@
|
|||||||
'use client';
|
"use client";
|
||||||
|
|
||||||
import { useLocalStorage } from '@/hooks/useLocalStorage'
|
import { useLocalStorage } from "@/hooks/useLocalStorage"
|
||||||
import { PREF } from '@/utils/const'
|
import { PREF } from "@/utils/const"
|
||||||
import { parsePlayerData } from '@/utils/dataparser';
|
import { parsePlayerData } from "@/utils/dataparser";
|
||||||
import ChargedButton from '../ChargedButton';
|
import ChargedButton from "../ChargedButton";
|
||||||
import styles from '@/css/Tour.module.css';
|
import styles from "@/css/Tour.module.css";
|
||||||
import MapView, { PlaceMarker } from '../MapView';
|
import MapView, { PlaceMarker } from "../MapView";
|
||||||
import { useEffect, useState } from 'react';
|
import { useEffect, useState } from "react";
|
||||||
import { usePermissions } from '@/hooks/usePermission';
|
import { usePermissions } from "@/hooks/usePermission";
|
||||||
import PermissionCheck from '../PermissionCheck';
|
import PermissionCheck from "../PermissionCheck";
|
||||||
|
|
||||||
export default function Tour() {
|
export default function Tour() {
|
||||||
const [ stepStr, setStep ] = useLocalStorage(PREF.step, '0');
|
const [ stepStr, setStep ] = useLocalStorage(PREF.step, "0");
|
||||||
const [ tourCode, setTourCode ] = useLocalStorage(PREF.code, '');
|
const [ tourCode, setTourCode ] = useLocalStorage(PREF.code, "");
|
||||||
const [ completedRiddlesStr, setCompletedRiddles ] = useLocalStorage(PREF.completed_riddles, '');
|
const [ completedRiddlesStr, setCompletedRiddles ] = useLocalStorage(PREF.completed_riddles, "");
|
||||||
const [ playersStr, setPlayers ] = useLocalStorage(PREF.players, '');
|
const [ playersStr, setPlayers ] = useLocalStorage(PREF.players, "");
|
||||||
const [ pointsStr, setPoints ] = useLocalStorage(PREF.points, '0');
|
const [ pointsStr, setPoints ] = useLocalStorage(PREF.points, "0");
|
||||||
const [ markers, setMarkers ] = useState<PlaceMarker[]>([]);
|
const [ markers, setMarkers ] = useState<PlaceMarker[]>([]);
|
||||||
const { gpsStatus, cameraStatus } = usePermissions();
|
const { gpsStatus, cameraStatus } = usePermissions();
|
||||||
const step = Number.parseInt(stepStr) || 0;
|
const step = Number.parseInt(stepStr) || 0;
|
||||||
const points = Number.parseInt(pointsStr) || 0;
|
const points = Number.parseInt(pointsStr) || 0;
|
||||||
const players = parsePlayerData(playersStr);
|
const players = parsePlayerData(playersStr);
|
||||||
|
|
||||||
const permissionsGranted = gpsStatus === 'granted' && cameraStatus === 'granted';
|
const permissionsGranted = gpsStatus === "granted" && cameraStatus === "granted";
|
||||||
|
|
||||||
const [ test, setTest ] = useState(false);
|
const [ test, setTest ] = useState(false);
|
||||||
|
|
||||||
@@ -34,9 +34,9 @@ export default function Tour() {
|
|||||||
navigator.geolocation.getCurrentPosition(
|
navigator.geolocation.getCurrentPosition(
|
||||||
(position) => {
|
(position) => {
|
||||||
setMarkers([{
|
setMarkers([{
|
||||||
id: 'riddle_one',
|
id: "riddle_one",
|
||||||
title: 'Erstes Rätsel',
|
title: "Erstes Rätsel",
|
||||||
description: 'Test Punkt verschoben vom Standort',
|
description: "Test Punkt verschoben vom Standort",
|
||||||
lng: position.coords.longitude + 0.002,
|
lng: position.coords.longitude + 0.002,
|
||||||
lat: position.coords.latitude,
|
lat: position.coords.latitude,
|
||||||
}]);
|
}]);
|
||||||
@@ -54,31 +54,31 @@ export default function Tour() {
|
|||||||
}, []);
|
}, []);
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<div className={styles['screen-container']}>
|
<div className={styles["screen-container"]}>
|
||||||
<div className={styles['top-bar']}>
|
<div className={styles["top-bar"]}>
|
||||||
<div className={styles['top-bar-content']}>
|
<div className={styles["top-bar-content"]}>
|
||||||
<div className={styles['points-outer-box']}>
|
<div className={styles["points-outer-box"]}>
|
||||||
<div className={styles['points-inner-box']}>
|
<div className={styles["points-inner-box"]}>
|
||||||
Your content goes here
|
Your content goes here
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div className={styles['main-content']}>
|
<div className={styles["main-content"]}>
|
||||||
<div className={styles['map']}>
|
<div className={styles["map"]}>
|
||||||
<MapView markers={markers} onMarkerClick={(marker) => {
|
<MapView markers={markers} onMarkerClick={(marker) => {
|
||||||
if (marker.id === 'riddle_one') {
|
if (marker.id === "riddle_one") {
|
||||||
setTest(true);
|
setTest(true);
|
||||||
}
|
}
|
||||||
}}></MapView>
|
}}></MapView>
|
||||||
</div>
|
</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>Riddle Overlay</p>
|
||||||
<p>Idealer weise dann mit Popup Animation (Slide In oder Fade In)</p>
|
<p>Idealer weise dann mit Popup Animation (Slide In oder Fade In)</p>
|
||||||
<p>Klicken um zu schließen</p>
|
<p>Klicken um zu schließen</p>
|
||||||
</div>
|
</div>
|
||||||
{ !permissionsGranted ?
|
{ !permissionsGranted ?
|
||||||
<div className={styles['permissions-overlay']}>
|
<div className={styles["permissions-overlay"]}>
|
||||||
<PermissionCheck></PermissionCheck>
|
<PermissionCheck></PermissionCheck>
|
||||||
</div>
|
</div>
|
||||||
: null
|
: null
|
||||||
|
|||||||
+2
-23
@@ -5,7 +5,6 @@
|
|||||||
width: 100%;
|
width: 100%;
|
||||||
overflow: hidden;
|
overflow: hidden;
|
||||||
}
|
}
|
||||||
|
|
||||||
.top-bar {
|
.top-bar {
|
||||||
position: absolute;
|
position: absolute;
|
||||||
top: 0;
|
top: 0;
|
||||||
@@ -95,6 +94,7 @@
|
|||||||
top: 0;
|
top: 0;
|
||||||
left: 0;
|
left: 0;
|
||||||
width: 100%;
|
width: 100%;
|
||||||
|
/*height: 100%; TODO: fullsize when doing this*/
|
||||||
padding: 1rem;
|
padding: 1rem;
|
||||||
background-color: #000000AA;
|
background-color: #000000AA;
|
||||||
z-index: 10;
|
z-index: 10;
|
||||||
@@ -115,31 +115,10 @@
|
|||||||
position: relative;
|
position: relative;
|
||||||
width: 300px;
|
width: 300px;
|
||||||
height: 200px;
|
height: 200px;
|
||||||
padding: 3px;
|
|
||||||
box-sizing: content-box;
|
|
||||||
background-color: #3498db;
|
background-color: #3498db;
|
||||||
color: #fff;
|
color: #fff;
|
||||||
border-radius: 20px;
|
|
||||||
overflow: hidden;
|
|
||||||
|
|
||||||
/* inverted (concave) corners: a rounded border keeps the box solid */
|
-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");
|
||||||
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;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
.points-inner-box {
|
.points-inner-box {
|
||||||
|
|||||||
Reference in new issue
Block a user