repl.it
HTML, CSS, JS

No description

fork
loading
Files
  • index.html
  • buildings
  • loading screen
  • visuals
  • HackTimer.js
  • nameMaker.js
  • script.js
  • style.css
  • updates.html
  • version.php
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
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
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
<link rel="shortcut icon" href="visuals/small cookie.png" />

<div id="loadingScreen">
<link href="/loading screen/loadingStyle.css" rel="stylesheet" />
<div class="loading-text">Loading...</div>
<div class="shown"></div>
<div class="shown" style="animation-duration: 8s;"></div>
<div class="hidden"></div>
<img src="visuals/cookie.png" class="main" draggable="false" />
</div>

<head>
<title>Cookie Clicker</title>
<link rel="stylesheet" type="text/css" href="https://cdn.jsdelivr.net/npm/[email protected]/build/cookieconsent.min.css" />
</head>

<link href="style.css" rel="stylesheet" type="text/css" />
<script src="HackTimer.js"></script>
<script type="text/javascript" src="nameMaker.js"></script>
<script src="script.js"></script>

<script>
var loadingScreenElement = document.getElementById("loadingScreen");
loadingScreenElement.parentNode.removeChild(loadingScreenElement);
</script>

<body>

<div class="container" id="container" style="width: 100%; height: 100%;">

<div class="column" style="left: 0; position: relative; width: 30vw;">

<div style="height: 40px; background-image: linear-gradient(rgba(0,0,0,0.4) 20%, rgba(0,0,0,0));"><img id="cheatCookie" src="visuals/cheat.png" height="32px" width="32px" style="border: gold ridge 2px; background-color: black; opacity: 0.6; border-radius: 2px; visibility: hidden;" onmouseover="document.getElementById('cheatDiv').style.visibility = 'visible'"/></div>

<div style="text-align: center; padding-left: 56px; visibility: hidden; position: absolute;" id="cheatDiv" onmouseleave="document.getElementById('cheatDiv').style.visibility = 'hidden'">
<div class="row">
<div class="popup" style="left: 0; top: 0; transform: translate(0px, 0px); width: 300px; color: white; font-weight: 900; text-align:center;">
Dev tools
</div>
<div class="row">
<button class="popupButton" onclick="number = parseInt(prompt('How many cookies do you want?'));">Amount</button>
</div>
<div class="row">
<button class="popupButton" onclick="number *= 10">x10</button>
<button class="popupButton" onclick="number /= 10">/10</button>
</div>
<div class="row">
<button class="popupButton" onclick="number *= 1000">x1k</button>
<button class="popupButton" onclick="number /= 1000">/1k</button>
</div>
<div class="row">
<button class="popupButton" onclick="generateGoldCookie(1)">Lucky</button>
<button class="popupButton" onclick="generateGoldCookie(49)">Frenzy</button>
<button class="popupButton" onclick="generateGoldCookie(97)">Click Frenzy</button>
</div>
</div>
</div>


<div class="bakeryName" style="padding-left: 50px; padding-right: 50px;">
<div class="row" id="bakeryName" onclick="changeName(true)" style="background-color: rgb(0,0,0,0.3); border-radius: 15px;">
(click here to change your name)'s bakery
</div>
</div>

<script>
try {
  bakeryNameVar = localStorage.getItem("name");
  document.getElementById('bakeryName').innerHTML = bakeryNameVar + "'s  bakery";
  if (bakeryNameVar.includes('saysmagicword')) {
    document.getElementById('cheatCookie').style.visibility = 'visible';
  };
} catch {};
</script>

<div style="height: 10px;"></div>

<div style="padding-left: 50px; padding-right: 50px; background-color: rgb(0,0,0,0.3);">
<div class="row">
<div id="display" style="font-size: 30px;text-align: center; font-weight: 900;">
0 cookies
</div>
</div>

<div class="row">
<div id="cps" style="font-size: 17px;text-align: center; font-weight: 900;">
per second: 0
</div>
</div>
</div>

<div style="height: 100px;"></div>

<div class="row" style="text-align: center;">
<img src="visuals/cookie.png" alt="cookie could not load" draggable="false" width="200" height="200" onclick="add(event);" class="cookie">
</div>

<button onclick="if (confirm('There is no update available at the moment, but you can force unreleased updates by clicking OK')) {location.reload();}" style="text-align: center; cursor: pointer; background: none; opacity: 0.5; left: 0; bottom: 6; position: fixed; border: none; color: white; font-weight: 900; font-size: 20; user-select: none; outline: none;" id="updateButton"></button>

<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.4.1/jquery.min.js"></script>
<script>
versionNumber = undefined;
updateNotes = undefined;

function updateVersionNumber() {
  $.get("version.php", function(data){
    versionNumber = data.split(',');
    updateNotes = versionNumber[1];
    versionNumber = versionNumber[0];
  });
  versionNumber = versionNumber;
  updateNotes = updateNotes;
};

$.get("version.php", function(data){
var versionNumber = data.split(',');
versionNumber = versionNumber[0];
oldVersionNumber = versionNumber;
document.getElementById('updateButton').innerHTML = 'V'+oldVersionNumber;
});


function checkUpdate() {
  updateVersionNumber();
  $.get("version.php", function(data){
    if (oldVersionNumber != versionNumber) {
      document.getElementById('updateButton').innerHTML = 'New version ' + versionNumber + ' available!<br> Click to update!';
      document.getElementById('updateButton').onclick = function() {if (confirm('New update notes:\n'+updateNotes+'\n\nClick "OK" to update.')) {location.reload()}};
    };
  });
};

window.setInterval(checkUpdate, 1000);

</script>


</div>

<div class="column">
<div style="background-image: url('visuals/wood-line.png'); height: 100%; width: 15px;"></div>
</div>


<div class="column" style="height: 96px">

<div class="row" style="text-align: center; color: grey; line-height: 48px; font-size: 20px; font-weight: 900">

<div class="column">
<div class="topLeft" id="topLeft" onclick="menuSelect('topLeft')">Options</div>
<div class="bottomLeft" id="bottomLeft" onclick="menuSelect('bottomLeft')">Stats</div>
</div>

<div class="column">
<div class="topRight" id="topRight" onclick="menuSelect('topRight')">Info</div>
<div class="bottomRight" id="bottomRight" onclick="menuSelect('bottomRight')">Legacy</div>
</div>
</div>

<div class="row">
<div style="background-image: url('visuals/wood-line-horiz.png'); left: calc(30vw + 15px); height: 15px; right: 330px; position: absolute; top: 93px"></div>
</div>
</div>





<div style="height: calc(vh-111px); width: calc(70vw-345px); left: calc(30vw + 15px); right: 330px; bottom: 0;position: fixed;" id="noSelect" style="visibility: visible">
</div>



<div id="options" class="optionsBackground">

<button onclick="reset()" style="background-color: white; text-align: center; cursor: pointer;">RESET</button>


</div>



<div id="stats" class="optionsBackground">
<div style="text-align: center; font-size: 30px; color: white; font-weight: 900">Statistics</div>
<br><br>
<div style="font-size: 25px; color: white; font-weight: 900">General</div>
<br>
<div style="font-size: 15px; color: #9D9D9D; font-weight: 600; font-family: 'Roboto', sans-serif; line-height: 1.2" id="generalStats">
Cookies in bank: 
<br>
Cookies baked (this ascention): 
<br>
Cookies baked (all time): 
<br>
Run started: 
<br>
Buildings owned: 
<br>
Cookies per second: 
<br>
Cookies per click: 
<br>
Cookie clicks: 
<br>
Hand-made cookies: 
<br>
Golden cookie clicks: 
<br><br>
Running version: 
</div>
</div>



<div id="info" class="optionsBackground">

<button onclick="window.open('updates.html')">Update Log</button>


</div>



<div id="legacy" class="optionsBackground">
</div>





<div class="column" style="right: 0; top: 0; position: fixed;">

<div class="sideHover" style="right: 345px; bottom: 0; position: fixed; visibility: hidden;" id="sideHover"></div>

<div class="column" style="position: fixed;">
<div style="background-image: url('visuals/wood-line.png'); height: 100%; width: 15px;"></div>
</div>


<div class="column" style="padding-left: 15px;">

<div style="height: 93px; width: 315px;">
<div class="row" style="font-size: 30px;text-align: center; font-weight: 900; padding-top: 50px; background-image: linear-gradient(rgba(0,0,0,0.65), rgba(0,0,0,0.3)); height: 50px">Store</div>
</div>

<div onmouseover="document.getElementById('upgradeDisplayText').style.visibility = 'visible'" onmouseout="document.getElementById('upgradeDisplayText').style.visibility = 'hidden'" style="height: 75px; width: 315px; background-color: rgb(0,0,0,0.5);)">

<div style="background-image: url('visuals/wood-line-horiz.png'); height: 15px; width: 315px; padding: 0px; font-size: 12px; color: #F6DAB8; font-weight: 800; text-shadow: 1px -1px 0 #000, 1px -1px 0 #000, -1px 1px 0 #000, 1px 1px 0 #000;"><div id="upgradeDisplayText" style="visibility: hidden;">Upgrades</div></div>

</div>

<div onmouseover="document.getElementById('buildingDisplayText').style.visibility = 'visible'" onmouseout="document.getElementById('buildingDisplayText').style.visibility = 'hidden'">

<div style="background-image: url('visuals/wood-line-horiz.png'); height: 15px; width: 315px; padding: 0px; font-size: 12px; color: #F6DAB8; font-weight: 800; text-shadow: 1px -1px 0 #000, 1px -1px 0 #000, -1px 1px 0 #000, 1px 1px 0 #000;"><div id="buildingDisplayText" style="visibility: hidden;">Buildings</div></div>


<div class="row">
<div style="background-color: #181818; width: 315px; height: 36; overflow: hidden;">

<div class="column" style="overflow: hidden;">

<button id="buyButton" class="sellArea" onclick="buySell=false;buySellFunction()" style="padding-top: 1px;">Buy</button>
<br>
<button id="sellButton" class="sellArea" onclick="buySell=true;buySellFunction()">Sell</button>

</div>

<div class="column">
<button id="1" class="sellArea" style="color: white; padding-left: 20px; padding-right: 20px; padding-top: 9px;" onclick="changeBuyMultiplier([1,1])">1</button>
</div>

<div class="column">
<button id="10" class="sellArea" style="padding-left: 20px; padding-right: 20px; padding-top: 9px;" onclick="changeBuyMultiplier([10,20.303718238])">10</button>
</div>

<div class="column">
<button id="100" class="sellArea" style="padding-left: 20px; padding-right: 20px; padding-top: 9px;" onclick="changeBuyMultiplier([100,7828749.671335256])">100</button>
</div>

<div class="column">
<button id="all" class="sellArea" style="padding-left: 20px; padding-right: 20px; padding-top: 9px; visibility: hidden;" onclick="changeBuyMultiplier(['all'])">All</button>
</div>

</div>
</div>

<div style="background-image: url('visuals/button-background.jpg');">

<div class="row">
<button id="cursor" class="shopButton" onclick="cursor.change()" onmouseover="buildingHover(event)" onmouseout="buildingHoverOff()" onmousemove="buildingHover(event)" style="background: url(/buildings/cursor.PNG) no-repeat 0px / 40px 53px;"></button>
</div>

<div class="row">
<button id="grandma" class="shopButton" onclick="grandma.change()" onmouseover="buildingHover(event)" onmouseout="buildingHoverOff()" onmousemove="buildingHover(event)" style="background: url(/buildings/grandma.PNG) no-repeat 0px / 53px 68px;"></button>
</div>

<div class="row">
<button id="farm" class="shopButton" onclick="farm.change()" onmouseover="buildingHover(event)" onmouseout="buildingHoverOff()" onmousemove="buildingHover(event)" style="background: url(/buildings/farm.PNG) no-repeat 0px / 53px 68px;"></button>
</div>

<div class="row">
<button id="mine" class="shopButton" onclick="mine.change()" onmouseover="buildingHover(event)" onmouseout="buildingHoverOff()" onmousemove="buildingHover(event)" style="background: url(/buildings/mine.PNG) no-repeat 0px / 53px 68px;"></button>
</div>

<div class="row">
<button id="factory" class="shopButton" onclick="factory.change()" onmouseover="buildingHover(event)" onmouseout="buildingHoverOff()" onmousemove="buildingHover(event)" style="background: url(/buildings/factory.PNG) no-repeat 0px / 53px 68px;"></button>
</div>

<div class="row">
<button id="bank" class="shopButton" onclick="bank.change()" onmouseover="buildingHover(event)" onmouseout="buildingHoverOff()" onmousemove="buildingHover(event)" style="background: url(/buildings/bank.PNG) no-repeat 0px / 53px 68px;"></button>
</div>

<div class="row">
<button id="temple" class="shopButton" onclick="temple.change()" onmouseover="buildingHover(event)" onmouseout="buildingHoverOff()" onmousemove="buildingHover(event)" style="background: url(/buildings/temple.PNG) no-repeat 0px / 53px 68px;"></button>
</div>

<div class="row">
<button id="wizard tower" class="shopButton" onclick="wizard_tower.change()" onmouseover="buildingHover(event)" onmouseout="buildingHoverOff()" onmousemove="buildingHover(event)" style="background: url(/buildings/wizardtower.PNG) no-repeat 0px / 53px 68px;"></button>
</div>

<div class="row">
<button id="shipment" class="shopButton" onclick="shipment.change()" onmouseover="buildingHover(event)" onmouseout="buildingHoverOff()" onmousemove="buildingHover(event)" style="background: url(/buildings/shipment.PNG) no-repeat 0px / 53px 68px;"></button>
</div>

<div class="row">
<button id="alchemy lab" class="shopButton" onclick="alchemy_lab.change()" onmouseover="buildingHover(event)" onmouseout="buildingHoverOff()" onmousemove="buildingHover(event)" style="background: url(/buildings/alchemylab.PNG) no-repeat 0px / 53px 68px;"></button>
</div>

<div class="row">
<button id="portal" class="shopButton" onclick="portal.change()" onmouseover="buildingHover(event)" onmouseout="buildingHoverOff()" onmousemove="buildingHover(event)" style="background: url(/buildings/portal.PNG) no-repeat 0px / 53px 68px;"></button>
</div>

<div class="row">
<button id="time machine" class="shopButton" onclick="time_machine.change()" onmouseover="buildingHover(event)" onmouseout="buildingHoverOff()" onmousemove="buildingHover(event)" style="background: url(/buildings/timemachine.PNG) no-repeat 0px / 53px 68px;"></button>
</div>

<div class="row">
<button id="antimatter condenser" class="shopButton" onclick="antimatter_condenser.change()" onmouseover="buildingHover(event)" onmouseout="buildingHoverOff()" onmousemove="buildingHover(event)" style="background: url(/buildings/antimattercondenser.PNG) no-repeat 0px / 53px 68px;"></button>
</div>

<div class="row">
<button id="prism" class="shopButton" onclick="prism.change()" onmouseover="buildingHover(event)" onmouseout="buildingHoverOff()" onmousemove="buildingHover(event)" style="background: url(/buildings/prism.PNG) no-repeat 0px / 53px 68px;"></button>
</div>

<div class="row">
<button id="chancemaker" class="shopButton" onclick="chancemaker.change()" onmouseover="buildingHover(event)" onmouseout="buildingHoverOff()" onmousemove="buildingHover(event)" style="background: url(/buildings/chancemaker.PNG) no-repeat 0px / 53px 68px;"></button>
</div>

<div class="row">
<button id="fractal engine" class="shopButton" onclick="fractal_engine.change()" onmouseover="buildingHover(event)" onmouseout="buildingHoverOff()" onmousemove="buildingHover(event)" style="background: url(/buildings/fractalengine.PNG) no-repeat 0px / 53px 68px;"></button>
</div>

<div class="row">
<button id="javascript console" class="shopButton" onclick="javascript_console.change()" onmouseover="buildingHover(event)" onmouseout="buildingHoverOff()" onmousemove="buildingHover(event)" style="background: url(/buildings/javascriptconsole.PNG) no-repeat 0px / 53px 68px;"></button>
</div>

</div>
</div>
</div>
</div>

</div>

<div style="visibility: hidden;" class="popup" id="popup">
  <div class="popupText">Name your bakery</div>
  <div style="font-size: 14px; border: rgb(136, 136, 136) solid 1px; border-radius: 6px; width: 230px; vertical-align: center; padding: 5px; left: 4px; position: relative;">What should your bakery's name be?</div>
  <div style="height: 5px;"></div>
  <div class="popupInputDiv"><input type="text" id='input' autocomplete="off" class="popupInput"></input></div>
  <br>
  <input type="button" value="Confirm" onclick="changeName(false)" class="popupButton"></input>
  <button onclick="document.getElementById('input').value = randomName()" class="popupButton">Random</button>
  <button onclick="document.getElementById('popup').style.visibility = 'hidden';document.getElementById('container').style.pointerEvents = 'auto';" class="popupButton">Cancel</button>
</div>


<script>
try {
  bakeryNameVar = document.getElementById('input').value = bakeryNameVar;
} catch {};
document.getElementById("display").innerHTML = number + " cookies";
buySell = false;
buySellFunction();
window.setInterval(tick, 100);
window.setInterval(function() {
  buySell = !buySell;
  buySellFunction();
}, 1000);
var lastGolden = 0;
window.setInterval(goldenCookie, 1000);
</script>


<script src="https://cdn.jsdelivr.net/npm/[email protected]/build/cookieconsent.min.js" data-cfasync="false"></script>
<script>
try {
  window.cookieconsent.initialise({
    "palette": {
      "popup": {
        "background": "#237afc"
      },
      "button": {
        "background": "#fff",
        "text": "#237afc"
      }
    },
    "showLink": false,
    "content": {
      "message": "Unsurprisingly, we use cookies in our website to store data across sessions (number of cookies, bakery name, etc)",
      "dismiss": "Ok"
    }
  });
} catch {};
</script>

</body>
result
console
?