-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathindex.html
127 lines (108 loc) · 7.96 KB
/
index.html
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
<!DOCTYPE html>
<html>
<head>
<title>Manual Brick Breaker</title>
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<link rel="stylesheet" href="styles.css">
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.0.0/css/all.min.css" integrity="sha512-9usAa10IRO0HhonpyAIVpjrylPvoDwiPUiKdWk5t3PyolY1cOd4DSE0Ga+ri4AuTroPR5aQvXU9xC6qOPnzFeg==" crossorigin="anonymous" referrerpolicy="no-referrer" />
<meta property="og:title" content="Manual Brick Breaker" />
<meta property="og:description" content="Play brick breaker with your hands!" />
<meta property="og:type" content="website" />
<meta property="og:url" content="https://manual-brick-breaker.netlify.app/" />
<meta property="og:image" content="https://collidingscopes.github.io/manual-brick-breaker/assets/siteOGImage3.png">
<meta property="og:image:type" content="image/png" >
<meta property="og:image:width" content="1365" >
<meta property="og:image:height" content="1374" >
<link rel="icon" href="assets/siteFavicon.png">
<link rel="apple-touch-icon" href="assets/siteFavicon.png">
<link rel="preconnect" href="https://fonts.googleapis.com">
<link rel="preconnect" href="https://fonts.gstatic.com" crossorigin>
<link href="https://fonts.googleapis.com/css2?family=IBM+Plex+Mono:ital,wght@0,100;0,200;0,300;0,400;0,500;0,600;0,700;1,100;1,200;1,300;1,400;1,500;1,600;1,700&display=swap" rel="stylesheet">
<script src="https://cdn.jsdelivr.net/npm/@mediapipe/hands/hands.js"></script>
<script src="https://cdn.jsdelivr.net/npm/@mediapipe/camera_utils/camera_utils.js"></script>
<script src="https://cdn.jsdelivr.net/npm/@mediapipe/drawing_utils/drawing_utils.js"></script>
</head>
<body>
<div class="game-container-div">
<div class="game-container">
<canvas id="gameCanvas"></canvas>
<video id="videoElement" playsinline></video>
<div class="stats">
<div>Lives: <span id="livesElement">💛💛💛</span></div>
<div>Level: <span id="levelElement">1</span></div>
<div>Score: <span id="scoreElement">0</span></div>
</div>
<div id="levelUpIndicator" class="level-up-indicator">
<p class="level-up-text">LEVEL UP!</p>
<p class="level-up-subtitle">speed +10%, paddle size -10%</p>
</div>
</div>
<div class="game-footer-div">
<button id="restartButton" class="restart-button inline" onclick="restartGame()">Restart Game</button>
<a class="about-link inline" href="#aboutText">[Info]</a>
<a class="donate-link inline" href="https://www.buymeacoffee.com/stereoDrift" target="_blank" rel="noopener">[$]</a>
</div>
<div id="startModal" class="modal">
<div class="modal-content">
<h2>MANUAL BRICK BREAKER</h2>
<p>✋ Move your hand left/right, keeping your palm in front of your camera</p>
<p>🧱 Break all the bricks to advance to the next level</p>
<p>🎚️ Each level increases ball speed by 10% and reduces paddle width by 10%</p>
<p>👁️ Make sure your webcam is enabled and your palm is visible</p>
<button class="start-button" onclick="startGame()">Start Game</button>
</div>
</div>
<div id="gameOverModal" class="game-over-modal">
<div class="modal-content">
<button class="close-button" onclick="closeGameOverModal()">×</button>
<h2>Game Over!</h2>
<div class="stats-grid">
<div class="label">Final Level:</div>
<div id="finalLevel">1</div>
<div class="label">Final Score:</div>
<div id="finalScore">0</div>
</div>
<p class="loading-text hidden">Loading high scores, please wait...</p>
<button class="restart-button" onclick="restartGame()">Play Again</button>
</div>
</div>
</div>
<div id="notesDiv">
<div id="textBox">
<h2 id="aboutText">MANUAL BRICK BREAKER</h2>
<p>Play brick breaker the way our ancestors wanted us to -- with our hands!</p>
<p>✋ Move your hand left/right, keeping your palm in front of your camera</p>
<p>🧱 Break all the bricks to advance to the next level</p>
<p>🎚️ Each level increases ball speed by 10% and reduces paddle width by 10%</p>
<p>👁️ Make sure your webcam is enabled and your palm is visible</p>
<p>If you're having trouble with the hand-tracking, please try to tilt your camera down and move a bit farther from your computer. Make sure that your palm is visible to the webcam.</p>
<p>All processing is done in real-time within your browser. This project is built using javascript, html canvas, and mediapipe hand tracking (<a href="https://github.com/collidingScopes/manual-brick-breaker" rel="noopener" target="_blank">github code</a>).</p>
<p>This game is free and open source, offered under an MIT license (you can use the code for personal or commercial purposes).</p>
<p>If you enjoyed this and are feeling generous, feel free to buy me a coffee. I will continue to build free and open source projects, and this would be much appreciated during late-night coding sessions!</p>
<a href="https://www.buymeacoffee.com/stereoDrift" target="_blank"><img src="https://www.buymeacoffee.com/assets/img/custom_images/yellow_img.png" alt="Buy Me A Coffee"></a>
<p>I do not have access to any of your data or webcam video, as all processing is done "client-side" (i.e., <b>no videos or images are saved/stored by me — they appear on your computer only</b>).</p>
<p>If you enjoyed this, you may be interested in my other free / open source projects:</p>
<ul>
<li><a href="https://collidingScopes.github.io/ascii" target="_blank" rel="noopener">Video-to-ASCII</a>: turn videos into ASCII pixel art</li>
<li><a href="https://collidingScopes.github.io/shimmer" target="_blank" rel="noopener">Shape Shimmer</a>: turn photos into funky wave animations</li>
<li><a href="https://collidingScopes.github.io" target="_blank" rel="noopener">Colliding Scopes</a>: turn photos into kaleidoscope animations</li>
<li><a href="https://collidingScopes.github.io/forcefield" target="_blank" rel="noopener">Force-Field Animation</a>: turn photos into particle animations</li>
</ul>
<p>Feel free to reach out to discuss, ask questions, or just to say hi! You can find me <a href="https://www.instagram.com/stereo.drift/" target="_blank" rel="noopener">@stereo.drift</a> on instagram, or through the other places below :)</p>
</div>
</div>
<div id="linksDiv">
<table id="infoMenuTable">
<tr>
<td><button id="gitHubButton"class="socialMediaButton"><a href="https://github.com/collidingScopes/manual-brick-breaker" target="_blank" rel="noopener"><i class="fa-brands fa-github"></i></a></button></td>
<td><button id="coffeeButton" class="socialMediaButton"><a href="https://www.buymeacoffee.com/stereoDrift" target="_blank" rel="noopener"><i class="fa-solid fa-heart"></i></a></button></td>
<td><button id="instagramButton" class="socialMediaButton"><a href="https://www.instagram.com/stereo.drift/" target="_blank" rel="noopener"><i class="fa-brands fa-instagram"></i></a></button></td>
<td><button id="xButton" class="socialMediaButton"><a class="x-link" href="https://x.com/measure_plan" target="_blank" rel="noopener">𝕏</i></a></button></td>
<td><button id="emailButton" class="socialMediaButton"><a href="mailto:[email protected]" target="_blank" rel="noopener"><i class="fa-solid fa-envelope"></i></a></button></td>
</tr>
</table>
</div>
</body>
<script src="config.js"></script>
<script src="game.js"></script>
</html>