-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathmoney.html
More file actions
248 lines (228 loc) · 8.73 KB
/
Copy pathmoney.html
File metadata and controls
248 lines (228 loc) · 8.73 KB
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
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<script>(function(){if(!sessionStorage.getItem('recaptcha_verified')||sessionStorage.getItem('recaptcha_verified')!=='true'){window.location.href='exp.html';}})();</script>
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Money Clicker</title>
<style>
body {
font-family: Arial, sans-serif;
text-align: center;
margin-top: 50px;
}
#clickButton, .options-button, .button {
padding: 20px;
font-size: 20px;
cursor: pointer;
background-color: #28a745;
color: white;
border: none;
border-radius: 5px;
margin-top: 20px;
box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
transition: background-color 0.3s, transform 0.3s;
}
#clickButton:hover, .options-button:hover, .button:hover {
background-color: #218838;
transform: translateY(-2px);
}
#counter {
font-size: 24px;
margin-top: 20px;
}
.description {
margin-top: 10px;
font-size: 16px;
}
.options-button {
position: fixed;
top: 20px;
right: 20px;
}
.options-menu {
display: none;
position: fixed;
top: 60px;
right: 20px;
background-color: #f9f9f9;
border: 1px solid #ccc;
padding: 10px;
border-radius: 5px;
}
.options-menu button {
display: block;
width: 100%;
margin-top: 10px;
}
.cheat-window {
display: none;
position: fixed;
top: 50%;
left: 50%;
transform: translate(-50%, -50%);
background-color: #fff;
border: 1px solid #ccc;
padding: 20px;
border-radius: 5px;
z-index: 10;
}
.overlay {
display: none;
position: fixed;
top: 0;
left: 0;
width: 100%;
height: 100%;
background-color: rgba(0, 0, 0, 0.5);
z-index: 5;
}
</style>
</head>
<body>
<h1>Clicker Game</h1>
<button id="clickButton">Click me!</button>
<div id="counter">Clicks: 0</div>
<button id="upgradeButton" class="button">Upgrade Click (Cost: 10)</button>
<div class="description">Increase your click power by 3 for each upgrade.</div>
<button id="botButton" class="button">Buy Clicker Bot (Cost: 100)</button>
<div class="description">Buy a bot that clicks automatically, half of the user click upgrades per second.</div>
<div id="upgradeCount">Upgrades: 0</div>
<div id="botCount">Bots: 0</div>
<button class="options-button" onclick="toggleOptionsMenu()">Options</button>
<div class="options-menu" id="optionsMenu">
<button onclick="openCheatWindow()">Cheat</button>
<button onclick="location.href='hub.html'">Quit game (Back to hub)</button>
<button onclick="closeOptionsMenu()">Close window</button>
</div>
<div class="overlay" id="overlay" onclick="closeCheatWindow()"></div>
<div class="cheat-window" id="cheatWindow">
<h2>PLEASE CONFIG CHEAT HERE!</h2>
<label for="cheatOption">Choose Cheat:</label>
<select id="cheatOption">
<option value="clicks">Clicks</option>
<option value="upgradeCost">Upgrade Cost</option>
<option value="botCost">Bot Cost</option>
<option value="clickValue">Click Value</option>
</select><br><br>
<label for="cheatValue">Enter Value:</label>
<input type="text" id="cheatValue"><br><br>
<button onclick="saveCheat()">Save</button>
<button onclick="closeCheatWindow()">Close</button>
</div>
<script>
let count = 0;
let clickValue = 1;
let upgradeCost = 10;
let botCost = 100;
let upgrades = 0;
let bots = 0;
const clickButton = document.getElementById('clickButton');
const counter = document.getElementById('counter');
const upgradeButton = document.getElementById('upgradeButton');
const botButton = document.getElementById('botButton');
const upgradeCount = document.getElementById('upgradeCount');
const botCount = document.getElementById('botCount');
clickButton.addEventListener('click', () => {
count += clickValue;
counter.textContent = 'Clicks: ' + count;
});
upgradeButton.addEventListener('click', () => {
if (count >= upgradeCost) {
count -= upgradeCost;
clickValue += 3;
upgradeCost = Math.floor(upgradeCost * 1.5);
upgrades++;
counter.textContent = 'Clicks: ' + count;
upgradeButton.textContent = 'Upgrade Click (Cost: ' + upgradeCost + ')';
upgradeCount.textContent = 'Upgrades: ' + upgrades;
}
});
botButton.addEventListener('click', () => {
if (count >= botCost) {
count -= botCost;
bots++;
botCost = Math.floor(botCost * 1.5);
botButton.textContent = 'Buy Clicker Bot (Cost: ' + botCost + ')';
botCount.textContent = 'Bots: ' + bots;
}
});
setInterval(() => {
count += bots * Math.floor(clickValue / 2);
counter.textContent = 'Clicks: ' + count;
}, 1000);
function toggleOptionsMenu() {
var menu = document.getElementById('optionsMenu');
if (menu.style.display === 'none' || menu.style.display === '') {
menu.style.display = 'block';
} else {
menu.style.display = 'none';
}
}
function closeOptionsMenu() {
document.getElementById('optionsMenu').style.display = 'none';
}
function openCheatWindow() {
document.getElementById('cheatWindow').style.display = 'block';
document.getElementById('overlay').style.display = 'block';
}
function closeCheatWindow() {
document.getElementById('cheatWindow').style.display = 'none';
document.getElementById('overlay').style.display = 'none';
}
function saveCheat() {
var cheatOption = document.getElementById('cheatOption').value;
var cheatValue = parseInt(document.getElementById('cheatValue').value);
switch (cheatOption) {
case 'clicks':
count = cheatValue;
counter.textContent = 'Clicks: ' + count;
break;
case 'upgradeCost':
upgradeCost = cheatValue;
upgradeButton.textContent = 'Upgrade Click (Cost: ' + upgradeCost + ')';
break;
case 'botCost':
botCost = cheatValue;
botButton.textContent = 'Buy Clicker Bot (Cost: ' + botCost + ')';
break;
case 'clickValue':
clickValue = cheatValue;
break;
default:
console.error('Unknown cheat option');
}
closeCheatWindow();
}
// Session timeout and tab exit detection
(function() {
const TIMEOUT_MS = 10 * 60 * 1000; // 10 minutes
function updateActivity() {
sessionStorage.setItem('last_activity', Date.now().toString());
}
function checkTimeout() {
const lastActivity = sessionStorage.getItem('last_activity');
if (!lastActivity || Date.now() - parseInt(lastActivity) > TIMEOUT_MS) {
sessionStorage.clear();
window.location.href = 'exp.html';
}
}
// Initialize last activity
updateActivity();
// Update activity on user interactions
['mousedown', 'keydown', 'scroll', 'touchstart'].forEach(function(event) {
document.addEventListener(event, updateActivity);
});
// Check timeout every minute
setInterval(checkTimeout, 60000);
// Clear session when tab is hidden/exited
document.addEventListener('visibilitychange', function() {
if (document.hidden) {
sessionStorage.clear();
window.location.href = 'exp.html';
}
});
})();
</script>
</body>
</html>