last adjustments
This commit is contained in:
1 parent
4bcce765b7
commit
c08e3bed57
4 files changed
+27
-45
No files matched your search
+1
-1
@@ -13,7 +13,7 @@ export default function RootLayout({ children }: LayoutProps<"/">) {
|
||||
<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="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" />
|
||||
<body>
|
||||
<SerwistProvider swUrl="/serwist/sw.js">{children}</SerwistProvider>
|
||||
|
||||
@@ -1,5 +1,7 @@
|
||||
import { spawnSync } from "node:child_process";
|
||||
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
|
||||
// `nextConfig` option so that Serwist can configure the service
|
||||
// worker according to your options. Serwist 10 and newer will
|
||||
|
||||
+1
-32
@@ -20,7 +20,7 @@ const serwist = new Serwist({
|
||||
precacheEntries: self.__SW_MANIFEST,
|
||||
precacheOptions: {
|
||||
cleanupOutdatedCaches: true,
|
||||
concurrency: 20,
|
||||
concurrency: 5,
|
||||
directoryIndex: "index.html",
|
||||
fallbackToNetwork: true,
|
||||
},
|
||||
@@ -50,34 +50,3 @@ const serwist = new Serwist({
|
||||
});
|
||||
|
||||
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();
|
||||
*/
|
||||
@@ -40,6 +40,7 @@ export default function Riddle_6({
|
||||
const [isHeartFast, setIsHeartFast] = useState(true);
|
||||
const closePopupRef = useRef<(() => void) | null>(null);
|
||||
const heartFastTimerRef = useRef<NodeJS.Timeout | null>(null);
|
||||
const popupTimerRef = useRef<NodeJS.Timeout | null>(null);
|
||||
|
||||
const voiceOverModeRef = useRef(voiceOverMode);
|
||||
useEffect(() => {
|
||||
@@ -47,22 +48,32 @@ export default function Riddle_6({
|
||||
}, [voiceOverMode]);
|
||||
|
||||
const handleClosePopup = () => {
|
||||
if (closePopupRef.current) {
|
||||
closePopupRef.current();
|
||||
} else {
|
||||
setPopupData(null);
|
||||
}
|
||||
};
|
||||
if (popupTimerRef.current) {
|
||||
clearTimeout(popupTimerRef.current);
|
||||
popupTimerRef.current = null;
|
||||
}
|
||||
|
||||
if (closePopupRef.current) {
|
||||
closePopupRef.current();
|
||||
} else {
|
||||
setPopupData(null);
|
||||
}
|
||||
};
|
||||
|
||||
useEffect(() => {
|
||||
if (!popupData || voiceOverMode === "on") return;
|
||||
if (!popupData) return;
|
||||
|
||||
const timer = setTimeout(() => {
|
||||
handleClosePopup();
|
||||
}, 9000);
|
||||
popupTimerRef.current = setTimeout(() => {
|
||||
handleClosePopup();
|
||||
}, 15000);
|
||||
|
||||
return () => clearTimeout(timer);
|
||||
}, [popupData, voiceOverMode]);
|
||||
return () => {
|
||||
if (popupTimerRef.current) {
|
||||
clearTimeout(popupTimerRef.current);
|
||||
popupTimerRef.current = null;
|
||||
}
|
||||
};
|
||||
}, [popupData]);
|
||||
|
||||
useEffect(() => {
|
||||
if (page !== 2 || mode === 'won') return;
|
||||
|
||||
Reference in new issue
Block a user