-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathindex.html
More file actions
699 lines (607 loc) · 25 KB
/
index.html
File metadata and controls
699 lines (607 loc) · 25 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
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
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
<!DOCTYPE html>
<html lang="en" data-theme="light">
<head>
<meta charset="UTF-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<title>George Brook – Front End Developer | CV & Portfolio</title>
<meta name="description"
content="Explore the CV of George Brook, a Front End developer specializing in accessible, performant, and user-focused web experiences." />
<link rel="canonical" href="https://yourdomain.com/" />
<meta property="og:title" content="George Brook – Front End Developer | CV & Portfolio" />
<meta property="og:description"
content="Explore the CV of George Brook, a Front End developer specializing in accessible, performant, and user-focused web experiences." />
<meta property="og:type" content="website" />
<meta property="og:url" content="https://yourdomain.com/" />
<meta property="og:image" content="https://yourdomain.com/og-image.jpg" />
<meta name="twitter:card" content="summary_large_image" />
<meta name="twitter:title" content="George Brook – Front End Developer | CV & Portfolio" />
<meta name="twitter:description"
content="Explore the CV of George Brook, a Front End developer specializing in accessible, performant, and user-focused web experiences." />
<meta name="twitter:image" content="https://yourdomain.com/og-image.jpg" />
<meta name="theme-color" content="#ffffff" media="(prefers-color-scheme: light)">
<meta name="theme-color" content="#121212" media="(prefers-color-scheme: dark)">
<link rel="icon" href="/favicon.ico" sizes="any" />
<link rel="apple-touch-icon" href="/apple-touch-icon.png" />
<link rel="manifest" href="/site.webmanifest" />
<link rel="preconnect" href="https://fonts.googleapis.com">
<link rel="preconnect" href="https://fonts.gstatic.com" crossorigin>
<link
href="https://fonts.googleapis.com/css2?family=Chivo+Mono:ital,wght@0,100..900;1,100..900&family=Montserrat:ital,wght@0,100..900;1,100..900&display=swap"
rel="stylesheet">
<script type="application/ld+json">
{
"@context": "https://schema.org",
"@type": "Person",
"name": "George Brook",
"jobTitle": "Front End Developer",
"url": "https://yourdomain.com/",
"sameAs": [
"https://linkedin.com/in/georgebrook",
"https://github.com/georgebrook"
],
"address": {
"@type": "PostalAddress",
"addressLocality": "London",
"addressCountry": "UK"
}
}
</script>
<script src="https://cdn.jsdelivr.net/npm/chart.js"></script>
<style>
:root {
--text: #2f2f2f;
--bg: #ffffff;
--accent: #010101;
--muted: #666;
--shadow: #d6d6d6;
}
[data-theme="dark"] {
--text: #eaeaea;
--bg: #121212;
--accent: #eaeaea;
--muted: #aaa;
}
* {
box-sizing: border-box;
}
body {
margin: 0;
font-family: "Montserrat", sans-serif;
font-optical-sizing: auto;
font-style: normal;
font-size: 1rem;
line-height: 1.6;
color: var(--text);
background: var(--bg);
}
a {
color: var(--text);
}
header svg {
width: 40px;
height: 40px;
}
header h1 {
margin: 0;
display: flex;
align-items: center;
gap: 10px;
}
.background-noise {
position: fixed;
inset: 0;
z-index: -1;
pointer-events: none;
}
main {
max-width: 1000px;
margin: auto;
padding: 1.5rem 3rem;
background: var(--bg);
}
h1 {
font-size: 2.4rem;
margin-bottom: 0.2rem;
font-family: "Chivo Mono", monospace;
font-optical-sizing: auto;
font-style: normal;
}
h2 {
border-bottom: 2px solid var(--accent);
padding-bottom: 0.2rem;
margin-top: 2.5rem;
font-size: 1.8rem;
font-family: "Chivo Mono", monospace;
font-optical-sizing: auto;
font-style: normal;
}
h3 {
margin: 1.5rem 0 0.3rem;
font-size: 1.4rem;
font-family: "Chivo Mono", monospace;
font-optical-sizing: auto;
font-style: normal;
}
p {
margin: 0;
}
.intro {
font-style: italic;
display: flex;
align-items: center;
margin-top: 20px;
gap: 20px;
padding: 10px 0;
}
.intro p {
margin: 0;
}
.image-border img {
width: 200px;
height: 200px;
border-radius: 50%;
border: 5px solid var(--bg);
object-fit: cover;
aspect-ratio: 1/1;
}
.meta {
font-style: italic;
}
ul {
padding-left: 1.4rem;
}
a:hover {
text-decoration: underline;
}
.fun-button {
cursor: pointer;
display: inline-flex;
justify-content: center;
align-items: center;
user-select: none;
width: 48px;
height: 48px;
color: var(--text);
position: fixed;
bottom: 23px;
top: 23px;
right: 34px;
border-radius: 10px;
background: rgba(255, 255, 255, 0.2);
box-shadow: 0 4px 30px rgba(0, 0, 0, 0.1);
backdrop-filter: blur(5px);
-webkit-backdrop-filter: blur(5px);
border: 1px solid rgba(255, 255, 255, 0.3);
}
.font-toggle {
right: 100px;
}
.color-toggle {
right: 95px;
}
.reset-toggle {
right: 202px;
}
.theme-toggle input {
display: none;
}
.image-border {
--gradient: linear-gradient(45deg, #48006d, #4d75ff, #66fff5, #23cc68, #e6ff6c);
aspect-ratio: 1 / 1;
padding: 6px;
display: flex;
border-radius: 50%;
background: var(--gradient);
background-size: 300% 300%;
animation: gradientFlow 5s ease infinite;
transition: animation-duration 0.3s ease;
cursor: pointer;
}
.image-border.clicked {
--gradient: linear-gradient(45deg, #ff4e50, #fc913a, #f9d423, #ff6b6b, #ffe259);
}
@keyframes gradientFlow {
0% {
background-position: 0% 50%;
}
50% {
background-position: 100% 50%;
}
100% {
background-position: 0% 50%;
}
}
.image-border--mobile {
display: none;
width: 100px;
height: 100px;
}
@media (max-width: 999px) {
.image-border--mobile {
display: flex;
padding: 3px;
}
.image-border--desktop,
.cv-icon {
display: none;
}
main {
padding: 1.5rem 1rem 3rem;
box-shadow: none;
}
header h1 {
font-size: 1.8rem;
line-height: 1.4;
gap: 20px;
}
.intro {
flex-direction: column;
align-items: flex-start;
margin-top: 10px;
}
.image-border img {
width: 100%;
height: 100%;
border-width: 4px;
}
.fun-button {
top: auto;
bottom: 26px;
right: 23px;
}
.font-toggle {
right: 89px;
}
.color-toggle {
right: 85px;
}
.reset-toggle {
right: 220px;
}
}
</style>
</head>
<body>
<canvas class="background-noise"></canvas>
<button id="random-color-btn" class="color-toggle fun-button" aria-label="Randomise font">
<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24">
<path fill="none" stroke="currentColor" stroke-dasharray="28" stroke-dashoffset="28" stroke-linecap="round"
stroke-linejoin="round" stroke-width="2" d="M12 3c0 0 7 6 7 12c0 2 -1 6 -7 6M12 3c0 0 -7 6 -7 12c0 2 1 6 7 6">
<animate attributeName="stroke-dashoffset" dur="3s" values="28;0;28;" repeatCount="indefinite" />
</path>
<path fill="currentColor" fill-opacity="0"
d="M12 3C12 3 15.27 5.81 17.34 9.5L6 18.41C5.21 17.24 5 15.91 5 15C5 9 12 3 12 3Z">
<animate attributeName="fill-opacity" dur="3s" values="0;0.3;0" repeatCount="indefinite" />
</path>
</svg>
</button>
<label class="theme-toggle fun-button" for="themeToggle" aria-label="Toggle dark mode">
<input type="checkbox" id="themeToggle" />
<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24">
<g fill="none" stroke="currentColor" stroke-dasharray="4" stroke-dashoffset="4" stroke-linecap="round"
stroke-linejoin="round" stroke-width="1">
<path d="M13 4h1.5M13 4h-1.5M13 4v1.5M13 4v-1.5">
<animate id="lineMdMoonRisingFilledAltLoop0" fill="freeze" attributeName="stroke-dashoffset"
begin="0.7s;lineMdMoonRisingFilledAltLoop0.begin+6s" dur="0.4s" values="4;0" />
<animate fill="freeze" attributeName="stroke-dashoffset"
begin="lineMdMoonRisingFilledAltLoop0.begin+2s;lineMdMoonRisingFilledAltLoop0.begin+4s" dur="0.4s"
values="4;0" />
<animate fill="freeze" attributeName="stroke-dashoffset"
begin="lineMdMoonRisingFilledAltLoop0.begin+1.2s;lineMdMoonRisingFilledAltLoop0.begin+3.2s;lineMdMoonRisingFilledAltLoop0.begin+5.2s"
dur="0.4s" values="0;4" />
<set fill="freeze" attributeName="d" begin="lineMdMoonRisingFilledAltLoop0.begin+1.8s"
to="M12 5h1.5M12 5h-1.5M12 5v1.5M12 5v-1.5" />
<set fill="freeze" attributeName="d" begin="lineMdMoonRisingFilledAltLoop0.begin+3.8s"
to="M12 4h1.5M12 4h-1.5M12 4v1.5M12 4v-1.5" />
<set fill="freeze" attributeName="d" begin="lineMdMoonRisingFilledAltLoop0.begin+5.8s"
to="M13 4h1.5M13 4h-1.5M13 4v1.5M13 4v-1.5" />
</path>
<path d="M19 11h1.5M19 11h-1.5M19 11v1.5M19 11v-1.5">
<animate id="lineMdMoonRisingFilledAltLoop1" fill="freeze" attributeName="stroke-dashoffset"
begin="1.1s;lineMdMoonRisingFilledAltLoop1.begin+6s" dur="0.4s" values="4;0" />
<animate fill="freeze" attributeName="stroke-dashoffset"
begin="lineMdMoonRisingFilledAltLoop1.begin+2s;lineMdMoonRisingFilledAltLoop1.begin+4s" dur="0.4s"
values="4;0" />
<animate fill="freeze" attributeName="stroke-dashoffset"
begin="lineMdMoonRisingFilledAltLoop1.begin+1.2s;lineMdMoonRisingFilledAltLoop1.begin+3.2s;lineMdMoonRisingFilledAltLoop1.begin+5.2s"
dur="0.4s" values="0;4" />
<set fill="freeze" attributeName="d" begin="lineMdMoonRisingFilledAltLoop1.begin+1.8s"
to="M17 11h1.5M17 11h-1.5M17 11v1.5M17 11v-1.5" />
<set fill="freeze" attributeName="d" begin="lineMdMoonRisingFilledAltLoop1.begin+3.8s"
to="M18 12h1.5M18 12h-1.5M18 12v1.5M18 12v-1.5" />
<set fill="freeze" attributeName="d" begin="lineMdMoonRisingFilledAltLoop1.begin+5.8s"
to="M19 11h1.5M19 11h-1.5M19 11v1.5M19 11v-1.5" />
</path>
<path d="M19 4h1.5M19 4h-1.5M19 4v1.5M19 4v-1.5">
<animate id="lineMdMoonRisingFilledAltLoop2" fill="freeze" attributeName="stroke-dashoffset"
begin="2s;lineMdMoonRisingFilledAltLoop2.begin+6s" dur="0.4s" values="4;0" />
<animate fill="freeze" attributeName="stroke-dashoffset" begin="lineMdMoonRisingFilledAltLoop2.begin+2s"
dur="0.4s" values="4;0" />
<animate fill="freeze" attributeName="stroke-dashoffset"
begin="lineMdMoonRisingFilledAltLoop2.begin+1.2s;lineMdMoonRisingFilledAltLoop2.begin+3.2s" dur="0.4s"
values="0;4" />
<set fill="freeze" attributeName="d" begin="lineMdMoonRisingFilledAltLoop2.begin+1.8s"
to="M20 5h1.5M20 5h-1.5M20 5v1.5M20 5v-1.5" />
<set fill="freeze" attributeName="d" begin="lineMdMoonRisingFilledAltLoop2.begin+5.8s"
to="M19 4h1.5M19 4h-1.5M19 4v1.5M19 4v-1.5" />
</path>
</g>
<path fill="currentColor" stroke="currentColor" stroke-linecap="round" stroke-linejoin="round" stroke-width="2"
d="M7 6 C7 12.08 11.92 17 18 17 C18.53 17 19.05 16.96 19.56 16.89 C17.95 19.36 15.17 21 12 21 C7.03 21 3 16.97 3 12 C3 8.83 4.64 6.05 7.11 4.44 C7.04 4.95 7 5.47 7 6 Z"
transform="translate(0 22)">
<animateMotion fill="freeze" calcMode="linear" dur="0.6s" path="M0 0v-22" />
</path>
</svg>
</label>
<main>
<header>
<h1>
<a href="#" class="image-border image-border--mobile" role="button" aria-pressed="false" onclick="
event.preventDefault();
const img = this.querySelector('img');
const isClicked = this.classList.toggle('clicked');
this.setAttribute('aria-pressed', isClicked);
img.src = isClicked ? 'me-black-and-white.jpg' : 'me3.webp';
img.alt = isClicked ? 'A colour version of me.' : 'An image of me with a great view.';
">
<img class="image-mobile" src="me3.webp" alt="An image of me with a great view.">
</a>
<svg class="cv-icon" xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24">
<g fill="none" stroke="currentColor" stroke-linecap="round" stroke-linejoin="round" stroke-width="2">
<path stroke-dasharray="64" stroke-dashoffset="64"
d="M13.5 3l5.5 5.5v11.5c0 0.55 -0.45 1 -1 1h-12c-0.55 0 -1 -0.45 -1 -1v-16c0 -0.55 0.45 -1 1 -1Z">
<animate fill="freeze" attributeName="stroke-dashoffset" dur="0.6s" values="64;0" />
</path>
<path d="M14.5 3.5l2.25 2.25l2.25 2.25z" opacity="0">
<animate fill="freeze" attributeName="d" begin="0.6s" dur="0.2s"
values="M14.5 3.5l2.25 2.25l2.25 2.25z;M14.5 3.5l0 4.5l4.5 0z" />
<set fill="freeze" attributeName="opacity" begin="0.6s" to="1" />
</path>
<path stroke-dasharray="8" stroke-dashoffset="8" d="M9 13h6">
<animate fill="freeze" attributeName="stroke-dashoffset" begin="0.8s" dur="0.2s" values="8;0" />
</path>
<path stroke-dasharray="4" stroke-dashoffset="4" d="M9 17h3">
<animate fill="freeze" attributeName="stroke-dashoffset" begin="1s" dur="0.2s" values="4;0" />
</path>
</g>
</svg>
George Brook
</h1>
<div class="intro">
<a href="#" class="image-border image-border--desktop" role="button" aria-pressed="false" onclick="
event.preventDefault();
const img = this.querySelector('img');
const isClicked = this.classList.toggle('clicked');
this.setAttribute('aria-pressed', isClicked);
img.src = isClicked ? 'me-black-and-white.jpg' : 'me3.webp';
img.alt = isClicked ? 'A colour version of me.' : 'An image of me with a great view.';
">
<img class="image-mobile" src="me3.webp" alt="An image of me with a great view.">
</a>
<div class="blurb">
<p>
I’m a front-end developer who enjoys building fast, accessible websites with clean, well-structured code. I care about good CSS, thoughtful UI, and making things work smoothly for users and developers alike. I like working with design systems, improving team standards, and exploring how tools like AI can support front-end work.
</p>
<br>
<p>
Most recent personal public project: <a
href="https://devtools-ecru.vercel.app">https://devtools-ecru.vercel.app</a>
</p>
</div>
</div>
<section>
<h2>Education</h2>
<p><strong>Bachelor of Science (Physics, Upper Second Class Honours)</strong><br>University of Bath — 2012</p>
<p><em>Dissertation: Investigating Noise and Underwater Acoustics in the Deep Sea.
Built MATLAB algorithms to analyze signal data.</em>
</p>
</section>
<section>
<h2>Professional Experience</h2>
<h3>Catch Digital (London, UK – Remote)</h3>
<p><strong>Senior Front-End Developer</strong> · March 2022 – May 2025</p>
<ul>
<li>Designed and implemented modular front-end systems across enterprise-scale websites.</li>
<li>Spearheaded the adoption of atomic design principles and scalable component libraries using Storybook and
modern CSS architecture (BEM).</li>
<li>Optimized page performance across 20+ websites, reducing load times through code splitting and
performance-first tooling.</li>
<li>Modernized build pipelines with Webpack, GitHub Actions, and CI/CD workflows, improving developer
efficiency.</li>
<li>Led the integration of headless CMS platforms and third-party APIs, including secure authentication flows
with JWT.</li>
<li>Built reusable React components for e-commerce tools like shopping carts and dynamic product filters.</li>
<li>Mentored junior developers on JavaScript best practices and accessibility standards.</li>
<li>Regularly led client demos and translated complex technical solutions into business-aligned outcomes.</li>
</ul>
<p><strong>Notable Projects/Clients:</strong></p>
<p><em>My Business Stream (Scottish Water), IOP, Norton Abrasives, Edrington Digital Platform, SES, IAB UK,
TTTech Auto, Framestore, Ashmore Group</p>
<small><strong>Reason for Leaving:</strong> Company restructure and merger.</small>
<h3>Zoocha Ltd (Hertford, UK – Remote)</h3>
<p><strong>Mid → Senior Front-End Developer</strong> · March 2014 – February 2022</p>
<ul>
<li>Delivered front-end solutions for high-traffic websites, including public sector and finance projects.
</li>
<li>Led compliance efforts for accessibility (AAA/WCAG) and legal standards.</li>
<li>Developed prototypes and MVPs using the latest front-end stacks.</li>
<li>Advocated for and implemented atomic design systems and reusable UI components.</li>
<li>Coached team members on writing scalable, maintainable code using modern HTML, CSS, and JavaScript
standards.</li>
</ul>
<p><strong>Notable Projects/Clients:</strong></p>
<p><em>Greater London Authority, TalkLondon, Ofsted Reports, FCA, Falmouth University, Visit Britain, Visit
Jersey, Ofsted Parent View</p>
<small><strong>Reason for Leaving:</strong> Transition to UK-only office model while based in South Africa.</small>
</section>
<section>
<h2>Technical Proficiency</h2>
<ul>
<li><strong>Languages & Frameworks</strong><br> React, Next.js, Vue.js, Svelte, TypeScript, JavaScript
(ES6+), HTML5, CSS3, SASS, Tailwind CSS, jQuery, Twig</li>
<li><strong>Component & UI Development</strong><br> Storybook, Atomic Design, BEM methodology, Accessible
UI
(WCAG 2.1/2.2), Semantic HTML</li>
<li><strong>Testing & Quality Assurance</strong><br> Jest, React Testing Library, Playwright, Pa11y,
Lighthouse, ESLint, Stylelint, Prettier</li>
<li><strong>Build & Automation Tools</strong><br> npm, Yarn, Webpack, Vite, Gulp, Grunt, Lint-Staged</li>
<li><strong>Version Control & Collaboration</strong><br> Git, GitHub, Bitbucket, Azure DevOps, Jira,
Confluence, Agile/Scrum, Code Reviews, Mentorship</li>
<li><strong>CMS & Platforms</strong><br> Drupal, WordPress, Prismic</li>
<li><strong>DevOps & Backend</strong><br> PHP, PHPStan, Composer, MySQL, Docker, DDEV, Linux, NGINX,
Jenkins,
AWS (Amplify, EC2, S3), Acquia Cloud, Pantheon, DigitalOcean, Vercel</li>
<li><strong>Analytics & Monitoring</strong><br> Google Analytics, Sentry</li>
</ul>
</section>
<section class="personal-info">
<h2>More About Me</h2>
<p>
When I’m not coding, I enjoy endurance running, competitive and recreational tennis, and perfecting my
homemade lasagne recipe. I am also passionate about art and music, and love exploring new creative outlets.
</p>
<ul>
<li><a href="https://codepen.io/georgebrook/pen/mqexXB" target="_blank" rel="noopener">Codepen</a></li>
<li><a href="https://github.com/georgebrook" target="_blank" rel="noopener">Github</a></li>
<li><a href="https://imgur.com/a/artwork-drf0g" target="_blank" rel="noopener">Artwork Portfolio</a></li>
<li><a href="https://soundcloud.com/zzxxccii" target="_blank" rel="noopener">Music</a></li>
<li><a href="https://www.drupal.org/u/georgebrook" target="_blank" rel="noopener">Drupal Profile</a></li>
<li><a href="https://www.linkedin.com/in/georgebrook/" target="_blank" rel="noopener">LinkedIn</a></li>
</ul>
</section>
<footer class="site-footer">
<p>Thank you for visiting my site. I look forward to connecting!</p>
</footer>
</main>
<script>
const randomColorBtn = document.getElementById('random-color-btn');
const body = document.body;
const headings = document.getElementsByTagName('h2');
const buttons = document.querySelectorAll('.fun-button');
const defaultColor = getComputedStyle(body).color;
function getRandomColor() {
const letters = '0123456789ABCDEF';
return '#' + Array.from({ length: 6 })
.map(() => letters[Math.floor(Math.random() * 16)])
.join('');
}
randomColorBtn.addEventListener('click', () => {
const color = getRandomColor();
body.style.color = color;
for (let heading of headings) {
heading.style.borderColor = color;
}
for (let button of buttons) {
button.style.color = color;
}
});
const toggleButton = document.getElementById('themeToggle');
const html = document.documentElement;
function updateMetaThemeColor(theme) {
const themeColor = theme === 'dark' ? '#121212' : '#ffffff';
let metaTag = document.querySelector('meta[name="theme-color"]');
if (!metaTag) {
metaTag = document.createElement('meta');
metaTag.name = 'theme-color';
document.head.appendChild(metaTag);
}
metaTag.setAttribute('content', themeColor);
}
const applyTheme = (theme) => {
html.setAttribute('data-theme', theme);
updateMetaThemeColor(theme);
};
const systemPrefersDark = window.matchMedia('(prefers-color-scheme: dark)');
let storedTheme = localStorage.getItem('theme');
if (storedTheme) {
applyTheme(storedTheme);
} else {
applyTheme(systemPrefersDark.matches ? 'dark' : 'light');
}
toggleButton.addEventListener('click', () => {
const current = html.getAttribute('data-theme');
const newTheme = current === 'dark' ? 'light' : 'dark';
applyTheme(newTheme);
localStorage.setItem('theme', newTheme);
});
systemPrefersDark.addEventListener('change', (e) => {
if (!localStorage.getItem('theme')) {
applyTheme(e.matches ? 'dark' : 'light');
}
});
const canvas = document.querySelector('.background-noise');
const ctx = canvas.getContext('2d');
const dotSize = 1;
const density = 0.25;
let imgData;
// Check for desktop
const isDesktop = () => window.innerWidth >= 1024;
function hexToRGBA(hex) {
hex = hex.replace('#', '');
if (hex.length === 3) {
hex = hex.split('').map(char => char + char).join('');
}
const r = parseInt(hex.substring(0, 2), 16);
const g = parseInt(hex.substring(2, 4), 16);
const b = parseInt(hex.substring(4, 6), 16);
const a = 255;
return (a << 24) | (r << 16) | (g << 8) | b;
}
function drawNoise() {
const isDark = document.documentElement.getAttribute('data-theme') === 'dark';
const bg = hexToRGBA(isDark ? '#1d1d1d' : '#f8f8f8');
const fg = hexToRGBA(isDark ? '#2d2d2d' : '#dddddd');
const cols = Math.ceil(canvas.width / dotSize);
const rows = Math.ceil(canvas.height / dotSize);
const buf = imgData.data;
for (let y = 0; y < rows; y++) {
for (let x = 0; x < cols; x++) {
const startX = x * dotSize;
const startY = y * dotSize;
const color = Math.random() < density ? fg : bg;
for (let dy = 0; dy < dotSize; dy++) {
for (let dx = 0; dx < dotSize; dx++) {
const px = startX + dx;
const py = startY + dy;
if (px >= canvas.width || py >= canvas.height) continue;
const pixelIndex = (py * canvas.width + px) * 4;
buf[pixelIndex] = (color >> 16) & 0xFF;
buf[pixelIndex + 1] = (color >> 8) & 0xFF;
buf[pixelIndex + 2] = color & 0xFF;
buf[pixelIndex + 3] = (color >> 24) & 0xFF;
}
}
}
}
ctx.putImageData(imgData, 0, 0);
}
function resize() {
canvas.width = window.innerWidth;
canvas.height = window.innerHeight;
imgData = ctx.createImageData(canvas.width, canvas.height);
ctx.imageSmoothingEnabled = false;
}
// Only start noise effect on desktop
if (isDesktop()) {
resize();
drawNoise();
loop();
}
// Update on resize if still desktop
window.addEventListener('resize', () => {
if (isDesktop()) {
resize();
drawNoise();
}
});
function loop() {
drawNoise();
requestAnimationFrame(loop);
}
console.log(
"%c🧑🏼💻🕹️🎾🥁👟🎹🛹🥩🥤🍿",
"font-size: 100px;"
);
</script>
</body>
</html>