last adjustments

This commit is contained in:
LionTion committed 2026-10-24 05:41:08 +02:00
1 parent 4bcce765b7
commit c08e3bed57
4 files changed
+21 -39

No files matched your search

+1 -1
View File
@@ -13,7 +13,7 @@ export default function RootLayout({ children }: LayoutProps<"/">) {
<html lang="en" dir="ltr" className={clsx("eisenkraft-regular")}> <html lang="en" dir="ltr" className={clsx("eisenkraft-regular")}>
<meta name="viewport" content="width=device-width, initial-scale=1.0, interactive-widget=resizes-visual" /> <meta name="viewport" content="width=device-width, initial-scale=1.0, interactive-widget=resizes-visual" />
<meta name="apple-mobile-web-app-title" content="Excalibur Outdoor Tour" /> <meta name="apple-mobile-web-app-title" content="Excalibur Outdoor Tour" />
<meta name="apple-mobile-web-app-capable" content="yes" /> <meta name="mobile-web-app-capable" content="yes" />
<meta httpEquiv="ScreenOrientation" content="autoRotate:disabled" /> <meta httpEquiv="ScreenOrientation" content="autoRotate:disabled" />
<body> <body>
<SerwistProvider swUrl="/serwist/sw.js">{children}</SerwistProvider> <SerwistProvider swUrl="/serwist/sw.js">{children}</SerwistProvider>
+2
View File
@@ -1,5 +1,7 @@
import { spawnSync } from "node:child_process"; import { spawnSync } from "node:child_process";
import { createSerwistRoute } from "@serwist/turbopack"; import { createSerwistRoute } from "@serwist/turbopack";
import fs from "node:fs";
import path from "node:path";
// If you are using Next.js versions older than 15.0.0, add the // If you are using Next.js versions older than 15.0.0, add the
// `nextConfig` option so that Serwist can configure the service // `nextConfig` option so that Serwist can configure the service
// worker according to your options. Serwist 10 and newer will // worker according to your options. Serwist 10 and newer will
+1 -32
View File
@@ -20,7 +20,7 @@ const serwist = new Serwist({
precacheEntries: self.__SW_MANIFEST, precacheEntries: self.__SW_MANIFEST,
precacheOptions: { precacheOptions: {
cleanupOutdatedCaches: true, cleanupOutdatedCaches: true,
concurrency: 20, concurrency: 5,
directoryIndex: "index.html", directoryIndex: "index.html",
fallbackToNetwork: true, fallbackToNetwork: true,
}, },
@@ -50,34 +50,3 @@ const serwist = new Serwist({
}); });
serwist.addEventListeners(); serwist.addEventListeners();
/** From Gemini */
/*
import { defaultCache } from '@serwist/next/worker';
import type { PrecacheEntry, SerwistGlobalConfig } from 'serwist';
import { CacheFirst, Serwist } from 'serwist';
declare const self: ServiceWorkerGlobalScope &
SerwistGlobalConfig & {
__SW_MANIFEST: (string | PrecacheEntry)[];
};
const serwist = new Serwist({
precacheEntries: self.__SW_MANIFEST,
skipWaiting: true,
clientsClaim: true,
navigationPreload: true,
runtimeCaching: [
...defaultCache,
{
// Intercept map tile requests from standard OSM / tile servers
matcher: ({ url }) => url.hostname.includes('tile.openstreetmap.org') || url.pathname.includes('/tiles/'),
handler: new CacheFirst({
cacheName: 'excalibur-offline-map-tiles-v1',
}),
},
],
});
serwist.addEventListeners();
*/
+17 -6
View File
@@ -40,6 +40,7 @@ export default function Riddle_6({
const [isHeartFast, setIsHeartFast] = useState(true); const [isHeartFast, setIsHeartFast] = useState(true);
const closePopupRef = useRef<(() => void) | null>(null); const closePopupRef = useRef<(() => void) | null>(null);
const heartFastTimerRef = useRef<NodeJS.Timeout | null>(null); const heartFastTimerRef = useRef<NodeJS.Timeout | null>(null);
const popupTimerRef = useRef<NodeJS.Timeout | null>(null);
const voiceOverModeRef = useRef(voiceOverMode); const voiceOverModeRef = useRef(voiceOverMode);
useEffect(() => { useEffect(() => {
@@ -47,22 +48,32 @@ export default function Riddle_6({
}, [voiceOverMode]); }, [voiceOverMode]);
const handleClosePopup = () => { const handleClosePopup = () => {
if (popupTimerRef.current) {
clearTimeout(popupTimerRef.current);
popupTimerRef.current = null;
}
if (closePopupRef.current) { if (closePopupRef.current) {
closePopupRef.current(); closePopupRef.current();
} else { } else {
setPopupData(null); setPopupData(null);
} }
}; };
useEffect(() => { useEffect(() => {
if (!popupData || voiceOverMode === "on") return; if (!popupData) return;
const timer = setTimeout(() => { popupTimerRef.current = setTimeout(() => {
handleClosePopup(); handleClosePopup();
}, 9000); }, 15000);
return () => clearTimeout(timer); return () => {
}, [popupData, voiceOverMode]); if (popupTimerRef.current) {
clearTimeout(popupTimerRef.current);
popupTimerRef.current = null;
}
};
}, [popupData]);
useEffect(() => { useEffect(() => {
if (page !== 2 || mode === 'won') return; if (page !== 2 || mode === 'won') return;