-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathmks.html
146 lines (134 loc) · 4.34 KB
/
mks.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
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
<!DOCTYPE html>
<html lang="en">
<head>
<link rel="icon" type="image/x-icon" href="emb.jpeg">
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Muqaddar ka Sikandar</title>
<link href="https://fonts.googleapis.com/css2?family=Playfair+Display+SC:wght@400;700&display=swap" rel="stylesheet">
<link rel="stylesheet" href="stylecabo.css">
<style>
body {
font-family: 'Playfair Display SC', serif;
text-align: center;
margin: 0;
padding: 0;
background-color: #fff;
}
.container {
max-width: 900px;
margin: 50px auto;
padding: 20px;
box-sizing: border-box;
}
h1 {
font-size: 60px;
font-weight:300;
margin-bottom: 30px;
}
h2 {
font-size: 25px;
font-weight:100;
margin-bottom: 30px;
color: #666666;
}
.score-section {
display: flex;
align-items: center;
justify-content: space-between;
margin: 20px 50px;
}
.player {
text-align: center;
flex: 1;
}
.player span {
display: block;
}
.name {
font-size: 25px;
color: #666;
margin-bottom: 10px;
}
.score {
font-size: 120px;
color: #333;
cursor: pointer;
}
.image-container {
text-align: center;
flex: 1;
}
.image-container img {
max-height: 350px;
width: auto;
}
</style>
</head>
<body>
<section class="header">
<nav>
<div class="nav-links" id="navLinks">
<ul>
<li><a href="index.html">Home</a></li>
<li><a href="devPass.html">DevB</a></li>
<!-- <li><a href="indexmeme.html">Me</a></li> -->
</ul>
</div>
</nav>
</section>
<div class="container">
<h1>Muqaddar ka Sikandar</h1>
<h2>All-Time Cabo Counter</h2>
<div class="score-section">
<div class="player">
<span class="name">You</span>
<span id="scorePrabal" class="score">0</span>
</div>
<div class="image-container">
<img src="cabo.jpg" alt="Skeleton Artwork">
</div>
<div class="player">
<span class="name">Challenger</span>
<span id="scoreSwayam" class="score">0</span>
</div>
</div>
</div>
<script>
// Load scores from local storage or set defaults
function loadScores() {
document.getElementById('scorePrabal').innerText = localStorage.getItem('scorePrabal') || 0;
document.getElementById('scoreSwayam').innerText = localStorage.getItem('scoreSwayam') || 0;
}
// Function to update and store scores
function updateScore(player, change) {
let element = document.getElementById(player);
let currentScore = parseInt(element.innerText);
let newScore = currentScore + change;
// Prevent negative scores
if (newScore < 0) newScore = 0;
element.innerText = newScore;
localStorage.setItem(player, newScore);
}
// Keyboard event listener for score controls
document.addEventListener('keydown', function(event) {
switch (event.key) {
case 'ArrowUp': // Increase Prabal's score
updateScore('scorePrabal', 1);
break;
case 'ArrowDown': // Decrease Prabal's score
updateScore('scorePrabal', -1);
break;
case 'ArrowRight': // Increase Swayam's score
updateScore('scoreSwayam', 1);
break;
case 'ArrowLeft': // Decrease Swayam's score
updateScore('scoreSwayam', -1);
break;
}
});
// Load scores on page load
window.onload = loadScores;
</script>
</body>
</html>