1
0

fix cool time

This commit is contained in:
2026-03-07 03:42:10 +09:00
parent efc513be15
commit a4418a2aa9

View File

@@ -93,9 +93,13 @@ export default function App() {
}, [playAnim]);
const appStartRef = useRef(Date.now());
const lastSwitchRef = useRef(0);
const handleZoomOut = useCallback(() => {
// 起動後15秒は切り替え無効
if (Date.now() - appStartRef.current < 15000) return;
const now = Date.now();
// 起動後15秒、または切り替え後5秒はブロック
if (now - appStartRef.current < 15000) return;
if (now - lastSwitchRef.current < 5000) return;
lastSwitchRef.current = now;
setView('nasa');
}, []);
@@ -134,9 +138,9 @@ export default function App() {
{/* NASA center button */}
{isNasa && (
<button
onClick={() => setView('avatar')}
onMouseEnter={() => setView('avatar')}
onTouchStart={() => setView('avatar')}
onClick={() => { lastSwitchRef.current = Date.now(); setView('avatar'); }}
onMouseEnter={() => { lastSwitchRef.current = Date.now(); setView('avatar'); }}
onTouchStart={() => { lastSwitchRef.current = Date.now(); setView('avatar'); }}
style={{
position: 'absolute', top: '50%', left: '50%',
transform: 'translate(-50%, -50%)', zIndex: 100,