Skip to content

Commit 68e07ed

Browse files
committed
Compress things more
Change variable names to short stuff. Apparently it's called mangling. I'll mangle you if you know what I mean. Also fix playlist-maker scrolling up when clicking on a thing (image options or difficulty options)
1 parent 23f3914 commit 68e07ed

12 files changed

+812
-755
lines changed

client/index.js

Lines changed: 97 additions & 95 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
1-
let improvements = [
2-
{
3-
css: `
1+
(() => {
2+
let improvements = [
3+
{
4+
css: `
45
html, body { height: 100%; }
56
body {
67
background: #1e1f26;
@@ -34,11 +35,11 @@ main {
3435
overflow: auto;
3536
}
3637
`,
37-
intro: 'Here is a list of what you can find on this website:',
38-
button: 'improve!'
39-
},
40-
{
41-
css: `
38+
intro: 'Here is a list of what you can find on this website:',
39+
button: 'improve!'
40+
},
41+
{
42+
css: `
4243
@keyframes gradient {
4344
from { background-position: 0 0; }
4445
to { background-position: -150px 0; }
@@ -83,11 +84,11 @@ li::before {
8384
animation: rotate 8s infinite, appear .3s;
8485
}
8586
`,
86-
intro: 'Comprehensive listing of the endpoints allowing access to the main utilities and pages available on this domain, granted it is accessed through a standard-compliant web browser:',
87-
button: 'IMPROVE'
88-
},
89-
{
90-
css: `
87+
intro: 'Comprehensive listing of the endpoints allowing access to the main utilities and pages available on this domain, granted it is accessed through a standard-compliant web browser:',
88+
button: 'IMPROVE'
89+
},
90+
{
91+
css: `
9192
@font-face {
9293
font-family: "Comic Sans MS";
9394
src: url("/client/comicsans.woff2") format("woff2"),
@@ -97,45 +98,45 @@ body { font-family: "Comic Sans MS", "Comic Sans", cursive; font-size: 20px; fon
9798
.intro { font-size: 2em; }
9899
.trail { position: fixed; top: 0; left: 0; font-size: 30px; transform: translate(-5px, -50%); pointer-events: none; }
99100
`,
100-
intro: 'wow cool site',
101-
action: (e) => {
102-
let initX = e.pageX || 0;
103-
let initY = e.pageY || 0;
104-
let trail = ['👌','👀','✔','💯','🔥','🍆','💦','👁','👅','👁'].map((e, i) => {
105-
let dom = document.createElement('div');
106-
dom.className = 'trail';
107-
dom.textContent = e;
108-
let x = initX + 22 * i;
109-
dom.style.left = x + 'px';
110-
dom.style.top = initY + 'px';
111-
document.body.appendChild(dom);
112-
return {
113-
x, y: initY,
114-
dom
115-
};
116-
});
117-
let mouse = { x: initX, y: initY };
118-
document.body.addEventListener('mousemove', e => {
119-
mouse.x = e.pageX;
120-
mouse.y = e.pageY;
121-
});
122-
function loop() {
123-
for (let i = 0, l = trail.length; i < l; i++) {
124-
let elem = trail[i];
125-
let prev = trail[i - 1] || mouse;
126-
elem.x += ((prev.x + (i ? 22 : 0)) - elem.x) / 8;
127-
elem.y += (prev.y - elem.y) / 8;
128-
elem.dom.style.left = elem.x + 'px';
129-
elem.dom.style.top = elem.y + 'px';
101+
intro: 'wow cool site',
102+
action: (e) => {
103+
let initX = e.pageX || 0;
104+
let initY = e.pageY || 0;
105+
let trail = ['👌','👀','✔','💯','🔥','🍆','💦','👁','👅','👁'].map((e, i) => {
106+
let dom = document.createElement('div');
107+
dom.className = 'trail';
108+
dom.textContent = e;
109+
let x = initX + 22 * i;
110+
dom.style.left = x + 'px';
111+
dom.style.top = initY + 'px';
112+
document.body.appendChild(dom);
113+
return {
114+
x, y: initY,
115+
dom
116+
};
117+
});
118+
let mouse = { x: initX, y: initY };
119+
document.body.addEventListener('mousemove', e => {
120+
mouse.x = e.pageX;
121+
mouse.y = e.pageY;
122+
});
123+
function loop() {
124+
for (let i = 0, l = trail.length; i < l; i++) {
125+
let elem = trail[i];
126+
let prev = trail[i - 1] || mouse;
127+
elem.x += ((prev.x + (i ? 22 : 0)) - elem.x) / 8;
128+
elem.y += (prev.y - elem.y) / 8;
129+
elem.dom.style.left = elem.x + 'px';
130+
elem.dom.style.top = elem.y + 'px';
131+
}
132+
requestAnimationFrame(loop);
130133
}
131134
requestAnimationFrame(loop);
132-
}
133-
requestAnimationFrame(loop);
135+
},
136+
button: '!͉͔̺͙͖̟̈̈̍̆̍!̪͈͎͎̺͓̞́̅ͭͮ̍̐͗!̞̿̀͗ͫ̐͒͌Í͈ͨ̆m͇̰̗̳̗̈́̐̐͐ͪ̊͐P̖̪̫̟̙ͬ̂͛O̭͚̹͕̲͙͕͂̍̒̎R̆̿̌V͒ͮe͙̺͖͈̞̫ͭͨ͊ͅ!̦̰̞̦̪̺ͥ̐!̞̯͔̗͛̈̔ͫ͌ͤ!̹̱̻'
134137
},
135-
button: '!͉͔̺͙͖̟̈̈̍̆̍!̪͈͎͎̺͓̞́̅ͭͮ̍̐͗!̞̿̀͗ͫ̐͒͌Í͈ͨ̆m͇̰̗̳̗̈́̐̐͐ͪ̊͐P̖̪̫̟̙ͬ̂͛O̭͚̹͕̲͙͕͂̍̒̎R̆̿̌V͒ͮe͙̺͖͈̞̫ͭͨ͊ͅ!̦̰̞̦̪̺ͥ̐!̞̯͔̗͛̈̔ͫ͌ͤ!̹̱̻'
136-
},
137-
{
138-
css: `
138+
{
139+
css: `
139140
@keyframes perspective {
140141
from { perspective: 10000vmax; }
141142
to { perspective: 100vmax; }
@@ -196,50 +197,51 @@ main { font-size: 1rem; background: none; }
196197
}
197198
aside { display: none }
198199
`,
199-
action: () => {
200-
let scaler = document.createElement('div');
201-
scaler.className = 'scaler';
202-
let cube = document.createElement('div');
203-
cube.className = 'cube';
204-
for (let i = 0; i < 6; i++) {
205-
let face = document.createElement('div');
206-
face.className = 'face';
207-
cube.appendChild(face);
208-
}
209-
scaler.appendChild(cube);
210-
document.body.appendChild(scaler);
211-
cube.children[0].appendChild(document.querySelector('main'));
212-
let vid = document.createElement('video');
213-
vid.className = 'background';
214-
vid.autoplay = true;
215-
vid.loop = true;
216-
vid.src = '/client/gnomed.mp4';
217-
document.body.appendChild(vid);
218-
},
219-
button: 'ye'
220-
}
221-
];
222-
let currentImprovement = 0;
223-
let intro = document.querySelector('.intro');
224-
let improveButton = document.querySelector('aside button');
225-
function improve(e) {
226-
let improvement = improvements[currentImprovement++];
227-
if (!improvement) {
228-
return;
229-
}
230-
if (improvement.css) {
231-
let css = document.createElement('style');
232-
css.appendChild(document.createTextNode(improvement.css));
233-
document.head.appendChild(css);
234-
}
235-
if (improvement.button) {
236-
improveButton.textContent = improvement.button;
237-
}
238-
if (improvement.intro) {
239-
intro.textContent = improvement.intro;
240-
}
241-
if (typeof improvement.action === 'function') {
242-
improvement.action(e);
200+
action: () => {
201+
let scaler = document.createElement('div');
202+
scaler.className = 'scaler';
203+
let cube = document.createElement('div');
204+
cube.className = 'cube';
205+
for (let i = 0; i < 6; i++) {
206+
let face = document.createElement('div');
207+
face.className = 'face';
208+
cube.appendChild(face);
209+
}
210+
scaler.appendChild(cube);
211+
document.body.appendChild(scaler);
212+
cube.children[0].appendChild(document.querySelector('main'));
213+
let vid = document.createElement('video');
214+
vid.className = 'background';
215+
vid.autoplay = true;
216+
vid.loop = true;
217+
vid.src = '/client/gnomed.mp4';
218+
document.body.appendChild(vid);
219+
},
220+
button: 'ye'
221+
}
222+
];
223+
let currentImprovement = 0;
224+
let intro = document.querySelector('.intro');
225+
let improveButton = document.querySelector('aside button');
226+
function improve(e) {
227+
let improvement = improvements[currentImprovement++];
228+
if (!improvement) {
229+
return;
230+
}
231+
if (improvement.css) {
232+
let css = document.createElement('style');
233+
css.appendChild(document.createTextNode(improvement.css));
234+
document.head.appendChild(css);
235+
}
236+
if (improvement.button) {
237+
improveButton.textContent = improvement.button;
238+
}
239+
if (improvement.intro) {
240+
intro.textContent = improvement.intro;
241+
}
242+
if (typeof improvement.action === 'function') {
243+
improvement.action(e);
244+
}
243245
}
244-
}
245-
improveButton.addEventListener('click', improve);
246+
improveButton.addEventListener('click', improve);
247+
})();

client/index.min.js

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)