mirror of
https://github.com/tiennm99/gsd-framework.git
synced 2026-05-26 17:55:39 +00:00
933e8b6feb
- Add touch-action: none to canvas to prevent zoom/scroll - Add overflow: hidden to body to prevent page scroll - Mobile touch gestures now properly blocked during gameplay 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <noreply@anthropic.com>
111 lines
2.9 KiB
HTML
111 lines
2.9 KiB
HTML
<!DOCTYPE html>
|
|
<html lang="en">
|
|
<head>
|
|
<meta charset="UTF-8" />
|
|
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
|
|
<title>Pikachu Match Game</title>
|
|
<style>
|
|
* {
|
|
margin: 0;
|
|
padding: 0;
|
|
box-sizing: border-box;
|
|
}
|
|
body {
|
|
display: flex;
|
|
justify-content: center;
|
|
align-items: center;
|
|
min-height: 100vh;
|
|
background-color: #1a1a2e;
|
|
overflow: hidden; /* Prevent scroll */
|
|
}
|
|
#game {
|
|
border-radius: 8px;
|
|
touch-action: none; /* Prevent all touch gestures */
|
|
}
|
|
#score-display {
|
|
position: absolute;
|
|
top: 20px;
|
|
right: 20px;
|
|
background-color: rgba(26, 26, 70, 0.9);
|
|
color: #eaeaea;
|
|
padding: 16px 24px;
|
|
border-radius: 8px;
|
|
font-size: 24px;
|
|
font-weight: bold;
|
|
z-index: 100;
|
|
}
|
|
#game-over-overlay {
|
|
display: none;
|
|
position: fixed;
|
|
top: 0;
|
|
left: 0;
|
|
width: 100%;
|
|
height: 100%;
|
|
background-color: rgba(0, 0, 0, 0.8);
|
|
justify-content: center;
|
|
align-items: center;
|
|
z-index: 1000;
|
|
}
|
|
#overlay-content {
|
|
background-color: rgba(26, 26, 70, 0.95);
|
|
padding: 40px;
|
|
border-radius: 12px;
|
|
text-align: center;
|
|
}
|
|
#game-over-message {
|
|
font-size: 48px;
|
|
color: #eaeaea;
|
|
margin-bottom: 24px;
|
|
}
|
|
#restart-button {
|
|
padding: 16px 32px;
|
|
font-size: 24px;
|
|
background-color: #e94560;
|
|
color: white;
|
|
border: none;
|
|
border-radius: 8px;
|
|
cursor: pointer;
|
|
transition: background-color 0.2s;
|
|
}
|
|
#restart-button:hover {
|
|
background-color: #d63850;
|
|
}
|
|
#shuffle-overlay {
|
|
display: none;
|
|
position: fixed;
|
|
top: 0;
|
|
left: 0;
|
|
width: 100%;
|
|
height: 100%;
|
|
justify-content: center;
|
|
align-items: center;
|
|
z-index: 500;
|
|
}
|
|
#shuffle-message {
|
|
background-color: rgba(26, 26, 70, 0.95);
|
|
padding: 24px 48px;
|
|
border-radius: 12px;
|
|
font-size: 32px;
|
|
color: #eaeaea;
|
|
}
|
|
</style>
|
|
</head>
|
|
<body>
|
|
<canvas id="game"></canvas>
|
|
<div id="score-container">
|
|
<div id="score-display">Score: 0</div>
|
|
<div id="previous-score-display" style="display: none;">Previous: 0</div>
|
|
</div>
|
|
<div id="game-over-overlay">
|
|
<div id="overlay-content">
|
|
<h1 id="game-over-message"></h1>
|
|
<button id="restart-button">Play Again</button>
|
|
</div>
|
|
</div>
|
|
<div id="shuffle-overlay">
|
|
<div id="shuffle-message">Shuffling...</div>
|
|
</div>
|
|
<script type="module" src="/src/main.ts"></script>
|
|
</body>
|
|
</html>
|