Skip to content

Commit cd14859

Browse files
committed
THE-MATH-GAME
1 parent 015cbfc commit cd14859

2 files changed

Lines changed: 43 additions & 0 deletions

File tree

Source Code/css/style.css

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,11 @@ body {
2525
width: 100%;
2626
height: 100vh;
2727
background: radial-gradient(circle, #fff, #ccc);
28+
/* Anti-Select Protection */
29+
-webkit-user-select: none;
30+
-moz-user-select: none;
31+
-ms-user-select: none;
32+
user-select: none;
2833
}
2934

3035
h1 {

Source Code/js/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/THE-MATH-GAME
99
* License: MIT
1010
*/
11+
12+
// =========================================
13+
// CONSOLE EASTER EGG 🧮
14+
// =========================================
15+
console.log(
16+
"%c🧮 The Math Game",
17+
"font-size: 24px; font-weight: bold; color: #a855f7; text-shadow: 2px 2px 0 #1e1b4b;"
18+
);
19+
console.log(
20+
"%c🔢 Test your multiplication skills!",
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/THE-MATH-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
// Game State Variables
1250
// Tracks whether the game is active, the current score, the timer interval reference,
1351
// the remaining time, and the correct answer for the current question.

0 commit comments

Comments
 (0)