Skip to content

Commit e7a7aa1

Browse files
committed
MATH-SPRINT-GAME
1 parent fba980a commit e7a7aa1

2 files changed

Lines changed: 43 additions & 0 deletions

File tree

Source Code/script.js

Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,44 @@
88
* Repository: https://github.com/Amey-Thakur/MATH-SPRINT-GAME
99
* License: MIT
1010
*/
11+
12+
// =========================================
13+
// CONSOLE EASTER EGG 🏃‍♂️
14+
// =========================================
15+
console.log(
16+
"%c🏃‍♂️ Math Sprint Game",
17+
"font-size: 24px; font-weight: bold; color: #8b5cf6; text-shadow: 2px 2px 0 #1e1b4b;"
18+
);
19+
console.log(
20+
"%c➕➖✖️➗ Race against time with math equations!",
21+
"font-size: 14px; color: #64748b;"
22+
);
23+
console.log(
24+
"%c🎮 Developed by Amey Thakur & Mega Satish",
25+
"font-size: 12px; color: #22c55e;"
26+
);
27+
console.log(
28+
"%c🔗 https://github.com/Amey-Thakur/MATH-SPRINT-GAME",
29+
"font-size: 12px; color: #2563eb;"
30+
);
31+
console.log(
32+
"%c⚠️ This game is protected. Please respect the authors' work!",
33+
"font-size: 12px; color: #f59e0b; font-weight: bold;"
34+
);
35+
36+
// =========================================
37+
// SECURITY MEASURES 🔒
38+
// =========================================
39+
(function initSecurity() {
40+
document.addEventListener('contextmenu', function (e) { e.preventDefault(); });
41+
document.addEventListener('dragstart', function (e) { e.preventDefault(); });
42+
document.addEventListener('selectstart', function (e) {
43+
if (e.target.tagName !== 'INPUT' && e.target.tagName !== 'TEXTAREA') e.preventDefault();
44+
});
45+
document.addEventListener('keydown', function (e) {
46+
if (e.key === 'F12' || (e.ctrlKey && e.shiftKey && ['I', 'J', 'C'].includes(e.key)) || (e.ctrlKey && e.key === 'u')) e.preventDefault();
47+
});
48+
})();
1149
// Pages
1250
const gamePage = document.getElementById('game-page');
1351
const scorePage = document.getElementById('score-page');

Source Code/style.css

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,11 @@ body {
3838
overflow: hidden;
3939
display: flex;
4040
justify-content: center;
41+
/* Anti-Select Protection */
42+
-webkit-user-select: none;
43+
-moz-user-select: none;
44+
-ms-user-select: none;
45+
user-select: none;
4146
height: 100vh;
4247
background: #e8e8e8;
4348
background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='80' height='80' viewBox='0 0 80 80'%3E%3Cg fill='%23161616' fill-opacity='0.1'%3E%3Cpath fill-rule='evenodd' d='M11 0l5 20H6l5-20zm42 31a3 3 0 1 0 0-6 3 3 0 0 0 0 6zM0 72h40v4H0v-4zm0-8h31v4H0v-4zm20-16h20v4H20v-4zM0 56h40v4H0v-4zm63-25a3 3 0 1 0 0-6 3 3 0 0 0 0 6zm10 0a3 3 0 1 0 0-6 3 3 0 0 0 0 6zM53 41a3 3 0 1 0 0-6 3 3 0 0 0 0 6zm10 0a3 3 0 1 0 0-6 3 3 0 0 0 0 6zm10 0a3 3 0 1 0 0-6 3 3 0 0 0 0 6zm-30 0a3 3 0 1 0 0-6 3 3 0 0 0 0 6zm-28-8a5 5 0 0 0-10 0h10zm10 0a5 5 0 0 1-10 0h10zM56 5a5 5 0 0 0-10 0h10zm10 0a5 5 0 0 1-10 0h10zm-3 46a3 3 0 1 0 0-6 3 3 0 0 0 0 6zm10 0a3 3 0 1 0 0-6 3 3 0 0 0 0 6zM21 0l5 20H16l5-20zm43 64v-4h-4v4h-4v4h4v4h4v-4h4v-4h-4zM36 13h4v4h-4v-4zm4 4h4v4h-4v-4zm-4 4h4v4h-4v-4zm8-8h4v4h-4v-4z'/%3E%3C/g%3E%3C/svg%3E");

0 commit comments

Comments
 (0)