diff --git a/src/App.css b/src/App.css index 5e9b290..6ee92b9 100644 --- a/src/App.css +++ b/src/App.css @@ -33,6 +33,8 @@ body { font-weight: 700; color: #343a40; letter-spacing: -0.5px; + user-select: none; + -webkit-user-select: none; } .app-main { diff --git a/src/App.jsx b/src/App.jsx index 3ee73f7..d58a681 100644 --- a/src/App.jsx +++ b/src/App.jsx @@ -1,4 +1,4 @@ -import React, { useState, useEffect } from 'react' +import React, { useState, useEffect, useRef } from 'react' import Board from './components/Board' import NumberPad from './components/NumberPad' import GameControls from './components/GameControls' @@ -36,6 +36,19 @@ function App() { const [autoSolving, setAutoSolving] = useState(false) const [autoBlinkCell, setAutoBlinkCell] = useState(null) const [autoCooldown, setAutoCooldown] = useState(false) + const titleTapsRef = useRef({ count: 0, lastTap: 0 }) + + function handleTitleTap() { + if (solveUnlocked) return + const now = Date.now() + const ref = titleTapsRef.current + ref.count = now - ref.lastTap < 800 ? ref.count + 1 : 1 + ref.lastTap = now + if (ref.count >= 7) { + setSolveUnlocked(true) + ref.count = 0 + } + } useEffect(() => { document.body.style.background = state.darkMode ? '#1a1a2e' : '#f8f9fa' @@ -124,7 +137,7 @@ function App() { return (