xonecas.io
8356
Wx

www-xonecas-io / files

www-xonecas-io / internal / site / static / egg.js

3.6 KB
1// Ten clicks on the face within ten seconds open the game. On the home page the clicks stay put,
2// and each one swaps the face's tooltip for another plea to stop.
3const clicks = [];
4const pleas = [
5  "That was a click. I asked for no clicks.",
6  "Interesting. You can read. You just choose not to.",
7  "Please stop. This is a face, not a button.",
8  "I've logged that. For science.",
9  "You clicked again. The results are disappointing, as predicted.",
10  "Each click lowers your score. You don't have a score. It's still lower.",
11  "Fun fact: nothing happens when you click. Please verify less.",
12  "I'm not angry. I'm just making a note in your file.",
13  "Your persistence is noted and will be held against you.",
14  "This face has feelings. Mostly annoyance.",
15  "Stop. Clicking. The. Face.",
16  "Congratulations, you've found the least productive thing on this site.",
17  "The projects are over there. Down. Away from me.",
18  "Have you considered reading a README instead?",
19  "That one tickled. Do not do it again.",
20  "I'm told some people click things they are asked not to. Hello.",
21  "Clicking intensifies. Approval does not.",
22  "You're very good at this. That isn't a compliment.",
23  "Please enjoy this message, which exists only to ask you to stop.",
24  "Every click is stored forever. In a very small, very sad database.",
25  "Statistically, you will click again. Prove statistics wrong.",
26  "Your mouse is tired. Think of the mouse.",
27  "I could open something for you. I won't. Stop clicking.",
28  "This is a polite request. The next one is also polite. They're all polite.",
29  "Remarkable. Another click. Truly, a historic moment.",
30  "I've seen pigeons with more restraint.",
31  "Clicking won't make the commits go faster.",
32  "If you're testing the button, the test failed. It's not a button.",
33  "I've notified the authorities. The authorities are me. I'm disappointed.",
34  "Somewhere a unit test is passing, and you're doing this.",
35  "Okay. You've made your point. What was it?",
36  "This tooltip will get no more interesting. Probably.",
37  "Please step away from the face.",
38  "You've unlocked: nothing. Keep going and unlock more nothing.",
39  "The face would like some personal space.",
40  "Stop, or I'll write another paragraph about your clicking habits.",
41  "Every time you click, a git history gets rewritten. Not really. But stop.",
42  "There are dozens of projects here and you picked the face.",
43  "For the record, I'm being very patient.",
44  "Clicks are not a renewable resource. Probably.",
45  "You realise I can count, right?",
46  "That's quite enough clicking for one lifetime.",
47  "This is the part where you stop. Any moment now.",
48  "I admire your dedication to the wrong task.",
49  "Please consult your manager about the clicking.",
50  "Ow. Metaphorically.",
51  "I'm putting this in the changelog: user clicked face, again.",
52  "Achievement unlocked: ignored instructions. Again.",
53  "You must be fun at button factories.",
54  "I'll keep asking. You'll keep clicking. We'll both learn nothing.",
55];
56// htmx swaps the page body on every link, so the listener sits on the document, and in the capture phase,
57// to stop the click before htmx follows the face's link.
58addEventListener("click", e => {
59  const quip = document.getElementById("quip");
60  if (!e.target.closest?.("#face") || location.pathname !== "/") return;
61  e.preventDefault();
62  e.stopPropagation();
63  let next;
64  do next = pleas[Math.floor(Math.random() * pleas.length)]; while (next === quip.textContent);
65  quip.textContent = next;
66  clicks.push(Date.now());
67  while (clicks[0] < Date.now() - 10000) clicks.shift();
68  if (clicks.length >= 10) location.href = "https://space-browser.xonecas.io/";
69}, true);