-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathindex.html
More file actions
680 lines (590 loc) · 22.8 KB
/
index.html
File metadata and controls
680 lines (590 loc) · 22.8 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
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Sam Goldfield's Interactive Website</title>
<meta name="apple-mobile-web-app-capable" content="yes" />
<meta name="mobile-web-app-capable" content="yes" />
<meta name="apple-mobile-web-app-status-bar-style" content="#87CEEB" />
<meta name="theme-color" content="#87CEEB" />
<meta property="og:creator" content="@samgdf" />
<meta property="og:title" content="Sam Goldfield's Interactive Website" />
<meta property="og:description" content="Explore Sam Goldfield's interactive website featuring links to LinkedIn and GitHub with a calm landscape, tall grass, and a running river with clouds overhead." />
<meta property="og:url" content="https://www.samgdf.com" />
<meta name="description" content="Sam Goldfield's interactive website" />
<link rel="icon" href="favicon.ico" type="image/x-icon" />
<link rel="canonical" href="https://www.samgdf.com/" />
<script type="application/ld+json">
{
"@context": "https://schema.org",
"@type": "Person",
"name": "Sam Goldfield",
"url": "https://www.samgdf.com/",
"jobTitle": "Sales Engineering Manager",
"worksFor": {
"@type": "Organization",
"name": "Galileo"
},
"sameAs": [
"https://github.com/samgdf",
"https://www.linkedin.com/in/samgdf/"
]
}
</script>
<style>
* {
margin: 0;
padding: 0;
overflow: hidden;
}
body {
background: #87CEEB;
width: 100vw;
height: 100vh;
position: relative;
}
/* Curved ledge effect using radial gradient */
body::before {
content: '';
position: absolute;
bottom: 0;
left: 0;
right: 0;
height: 60%;
background: radial-gradient(ellipse 120% 60% at 50% 100%, #6B8E23 0%, #6B8E23 30%, #98C58E 50%, #87CEEB 70%);
z-index: 0;
pointer-events: none;
}
.cloud {
position: absolute;
background: rgba(255, 255, 255, 0.4);
border-radius: 100px;
opacity: 0;
z-index: 0;
}
.cloud::before,
.cloud::after {
content: '';
position: absolute;
background: rgba(255, 255, 255, 0.4);
border-radius: 100px;
}
.cloud::before {
width: 50px;
height: 50px;
top: -25px;
left: 10px;
}
.cloud::after {
width: 60px;
height: 60px;
top: -30px;
right: 10px;
}
@keyframes float-cloud {
0% {
transform: translateX(-150px);
opacity: 0;
}
10% {
opacity: 0.6;
}
90% {
opacity: 0.6;
}
100% {
transform: translateX(calc(100vw + 150px));
opacity: 0;
}
}
#water {
position: absolute;
bottom: 15%;
width: 100%;
height: 12%;
background: linear-gradient(to bottom, #4a90a4 0%, #3a7a94 50%, #2a6a84 100%);
overflow: hidden;
z-index: 1;
cursor: pointer;
}
.ripple {
position: absolute;
border-radius: 50%;
background: radial-gradient(circle, rgba(255, 255, 255, 0.15) 0%, rgba(255, 255, 255, 0.08) 50%, transparent 100%);
transform: translate(-50%, -50%) scale(0);
animation: ripple-animation 1.2s ease-out forwards;
pointer-events: none;
}
@keyframes ripple-animation {
0% {
transform: translate(-50%, -50%) scale(0);
opacity: 1;
}
100% {
transform: translate(-50%, -50%) scale(2.5);
opacity: 0;
}
}
.water-wave {
position: absolute;
width: 200%;
height: 100%;
background: linear-gradient(90deg,
transparent 0%,
rgba(255, 255, 255, 0.1) 25%,
transparent 50%,
rgba(255, 255, 255, 0.1) 75%,
transparent 100%);
animation: flow 8s linear infinite;
}
.water-wave:nth-child(2) {
animation-duration: 12s;
opacity: 0.5;
}
@keyframes flow {
0% {
transform: translateX(-50%);
}
100% {
transform: translateX(0%);
}
}
#links-container {
position: absolute;
top: 50%;
left: 50%;
transform: translate(-50%, -50%);
z-index: 100;
display: flex;
gap: 40px;
align-items: center;
padding: 20px;
}
@keyframes fade-out {
0% {
opacity: 1;
}
100% {
opacity: 0;
}
}
@keyframes fade-out-reflection {
0% {
opacity: 0.25;
}
100% {
opacity: 0;
}
}
#links-container a {
color: #fff;
font-family: Arial, Helvetica, sans-serif;
font-size: 24px;
font-weight: bold;
text-decoration: none;
position: relative;
display: inline-block;
opacity: 1;
transition: opacity 1s ease-out;
}
.hover-zone {
position: fixed;
pointer-events: auto;
z-index: 99;
/* Debug: uncomment to see hover area */
/* background: rgba(255, 0, 0, 0.1); */
}
#links-container a:not(.hovered):not(.no-animation) {
animation: fade-out 1s ease-out 2s forwards;
}
#links-container a.hovered {
opacity: 1;
}
#links-container a.faded {
opacity: 0;
}
.reflection {
position: fixed;
color: rgba(255, 255, 255, 0.3);
font-family: Arial, Helvetica, sans-serif;
font-size: 24px;
font-weight: bold;
transform: scaleY(-1);
opacity: 0.25;
filter: blur(1.5px);
pointer-events: none;
z-index: 2;
transition: opacity 1s ease-out;
}
.reflection:not(.hovered):not(.no-animation) {
animation: fade-out-reflection 1s ease-out 2s forwards;
}
.reflection.hovered {
opacity: 0.25;
}
.reflection.faded {
opacity: 0;
}
.cloud.brightened {
opacity: 0.9 !important;
}
#grass-container {
position: absolute;
width: 100%;
height: 100%;
overflow: hidden;
z-index: 10;
pointer-events: none;
}
.grass-blade {
position: absolute;
bottom: 0;
width: 3px;
background: linear-gradient(to top, #4a6e1a 0%, #6B8E23 50%, #7fa632 100%);
transform-origin: bottom center;
opacity: 0.8;
transition: transform 0.3s ease-out;
}
</style>
</head>
<body>
<div id="clouds-container"></div>
<div id="water">
<div class="water-wave"></div>
<div class="water-wave"></div>
</div>
<div id="grass-container"></div>
<div id="links-container">
<a href="https://linkedin.com/in/samgdf" target="_blank" data-text="Linkedin">Linkedin</a>
<a href="https://github.com/samgdf" target="_blank" data-text="Github">Github</a>
</div>
<script>
// Dynamic Favicon System
const faviconCanvas = document.createElement('canvas');
faviconCanvas.width = 32;
faviconCanvas.height = 32;
const faviconCtx = faviconCanvas.getContext('2d');
let faviconLink = document.querySelector('link[rel="icon"]');
let currentFaviconState = 'default';
let faviconAnimationFrame = 0;
function updateFavicon(state, animationFrame = 0) {
faviconCtx.clearRect(0, 0, 32, 32);
if (state === 'grass-moving') {
// Sky
faviconCtx.fillStyle = '#87CEEB';
faviconCtx.fillRect(0, 0, 32, 20);
// Ground
faviconCtx.fillStyle = '#6B8E23';
faviconCtx.fillRect(0, 20, 32, 12);
// Animated grass blades
faviconCtx.strokeStyle = '#4a6e1a';
faviconCtx.lineWidth = 1.5;
for (let i = 0; i < 8; i++) {
const x = 4 + i * 4;
const sway = Math.sin(animationFrame * 0.3 + i) * 2;
faviconCtx.beginPath();
faviconCtx.moveTo(x, 32);
faviconCtx.lineTo(x + sway, 22);
faviconCtx.stroke();
}
// Wind indicator
faviconCtx.fillStyle = '#ffffff';
faviconCtx.globalAlpha = 0.6;
const windX = 8 + Math.sin(animationFrame * 0.2) * 3;
faviconCtx.fillRect(windX, 8, 4, 1);
faviconCtx.fillRect(windX + 2, 10, 6, 1);
faviconCtx.globalAlpha = 1;
} else if (state === 'water-ripple') {
// Sky
faviconCtx.fillStyle = '#87CEEB';
faviconCtx.fillRect(0, 0, 32, 16);
// Water with ripple
faviconCtx.fillStyle = '#4a90a4';
faviconCtx.fillRect(0, 16, 32, 16);
// Expanding ripple circles
const maxRadius = 12;
const radius = (animationFrame % 15) / 15 * maxRadius;
faviconCtx.strokeStyle = '#ffffff';
faviconCtx.globalAlpha = 1 - (radius / maxRadius);
faviconCtx.lineWidth = 1.5;
faviconCtx.beginPath();
faviconCtx.arc(16, 24, radius, 0, Math.PI * 2);
faviconCtx.stroke();
faviconCtx.globalAlpha = 1;
} else if (state === 'link-hover') {
// Sky
faviconCtx.fillStyle = '#87CEEB';
faviconCtx.fillRect(0, 0, 32, 20);
// Ground
faviconCtx.fillStyle = '#6B8E23';
faviconCtx.fillRect(0, 20, 32, 12);
// Highlighted link indicator (glowing dot)
const pulse = Math.sin(animationFrame * 0.4) * 0.3 + 0.7;
faviconCtx.fillStyle = '#ffffff';
faviconCtx.globalAlpha = pulse;
faviconCtx.beginPath();
faviconCtx.arc(16, 12, 4, 0, Math.PI * 2);
faviconCtx.fill();
faviconCtx.globalAlpha = 1;
// Link text lines
faviconCtx.fillStyle = '#ffffff';
faviconCtx.fillRect(11, 10, 10, 1);
faviconCtx.fillRect(11, 13, 10, 1);
} else {
// Default landscape
// Sky
faviconCtx.fillStyle = '#87CEEB';
faviconCtx.fillRect(0, 0, 32, 18);
// Cloud
faviconCtx.fillStyle = '#ffffff';
faviconCtx.globalAlpha = 0.7;
faviconCtx.beginPath();
faviconCtx.arc(20, 8, 3, 0, Math.PI * 2);
faviconCtx.arc(24, 8, 4, 0, Math.PI * 2);
faviconCtx.arc(28, 8, 3, 0, Math.PI * 2);
faviconCtx.fill();
faviconCtx.globalAlpha = 1;
// Water
faviconCtx.fillStyle = '#4a90a4';
faviconCtx.fillRect(0, 18, 32, 6);
// Ground/grass
faviconCtx.fillStyle = '#6B8E23';
faviconCtx.fillRect(0, 24, 32, 8);
// Static grass blades
faviconCtx.strokeStyle = '#4a6e1a';
faviconCtx.lineWidth = 1;
for (let i = 0; i < 8; i++) {
const x = 4 + i * 4;
faviconCtx.beginPath();
faviconCtx.moveTo(x, 32);
faviconCtx.lineTo(x, 26);
faviconCtx.stroke();
}
}
faviconLink.href = faviconCanvas.toDataURL();
}
function setFaviconState(state, duration = 2000) {
currentFaviconState = state;
faviconAnimationFrame = 0;
// Animate the favicon
const startTime = Date.now();
const animateInterval = setInterval(() => {
faviconAnimationFrame++;
updateFavicon(currentFaviconState, faviconAnimationFrame);
if (Date.now() - startTime > duration) {
clearInterval(animateInterval);
currentFaviconState = 'default';
updateFavicon('default');
}
}, 100);
}
// Initialize with default favicon
updateFavicon('default');
const grassContainer = document.getElementById('grass-container');
const cloudsContainer = document.getElementById('clouds-container');
const grassBlades = [];
// Generate clouds
function createClouds() {
const numClouds = 3;
for (let i = 0; i < numClouds; i++) {
const cloud = document.createElement('div');
cloud.className = 'cloud';
const size = 80 + Math.random() * 60;
cloud.style.width = `${size}px`;
cloud.style.height = `${size * 0.6}px`;
cloud.style.top = `${5 + Math.random() * 30}%`;
const duration = 40 + Math.random() * 30;
const delay = Math.random() * 30;
cloud.style.animation = `float-cloud ${duration}s linear ${delay}s infinite`;
cloudsContainer.appendChild(cloud);
trackCloud(cloud);
}
}
// Check cloud proximity to text and brighten
function updateCloudBrightness() {
// Disable on narrow screens to prevent layout issues
if (window.innerWidth < 400) {
clouds.forEach(cloud => {
cloud.classList.remove('brightened');
});
return;
}
const links = document.querySelectorAll('#links-container a');
clouds.forEach(cloud => {
const cloudRect = cloud.getBoundingClientRect();
let shouldBrighten = false;
// Only check if cloud is actually visible and has valid dimensions
if (cloudRect.width > 0 && cloudRect.height > 0) {
links.forEach(link => {
// Only brighten if link is visible (not faded out)
const linkOpacity = window.getComputedStyle(link).opacity;
if (parseFloat(linkOpacity) > 0.5) {
const linkRect = link.getBoundingClientRect();
// Calculate distance between cloud and link
const cloudCenterX = cloudRect.left + cloudRect.width / 2;
const cloudCenterY = cloudRect.top + cloudRect.height / 2;
const linkCenterX = linkRect.left + linkRect.width / 2;
const linkCenterY = linkRect.top + linkRect.height / 2;
const distance = Math.sqrt(
Math.pow(cloudCenterX - linkCenterX, 2) +
Math.pow(cloudCenterY - linkCenterY, 2)
);
// Brighten if within 200px
if (distance < 200) {
shouldBrighten = true;
}
}
});
}
if (shouldBrighten) {
cloud.classList.add('brightened');
} else {
cloud.classList.remove('brightened');
}
});
}
// Generate grass blades
function createGrass() {
const numBlades = Math.floor(window.innerWidth / 4);
for (let i = 0; i < numBlades; i++) {
const blade = document.createElement('div');
blade.className = 'grass-blade';
blade.style.left = `${Math.random() * 100}%`;
blade.style.height = `${Math.random() * 100 + 60}px`;
blade.style.transform = `rotate(${(Math.random() - 0.5) * 10}deg)`;
blade.style.zIndex = Math.floor(Math.random() * 100);
grassContainer.appendChild(blade);
grassBlades.push({
element: blade,
baseRotation: (Math.random() - 0.5) * 10,
offset: Math.random() * Math.PI * 2
});
}
}
// Animation variables
let moveX = 0;
let moveY = 0;
let time = 0;
// Keyboard controls
const keys = {};
let keyPressTimeout = null;
window.addEventListener('keydown', (e) => {
const isMovementKey = ['ArrowUp', 'ArrowDown', 'ArrowLeft', 'ArrowRight', 'w', 'a', 's', 'd'].includes(e.key);
if (isMovementKey && !keys[e.key]) {
setFaviconState('grass-moving', 2000);
}
keys[e.key] = true;
});
window.addEventListener('keyup', (e) => {
keys[e.key] = false;
});
// Update grass movement
function updateGrass() {
moveX = 0;
moveY = 0;
if (keys['ArrowUp'] || keys['w']) moveY = 1;
if (keys['ArrowDown'] || keys['s']) moveY = -1;
if (keys['ArrowLeft'] || keys['a']) moveX = -1;
if (keys['ArrowRight'] || keys['d']) moveX = 1;
time += 0.05;
grassBlades.forEach((blade) => {
const windEffect = Math.sin(time + blade.offset) * 2;
const moveEffect = moveX * 15 + moveY * 10;
const totalRotation = blade.baseRotation + windEffect + moveEffect;
blade.element.style.transform = `rotate(${totalRotation}deg)`;
});
}
// Animation loop
function animate() {
updateGrass();
updateCloudBrightness();
requestAnimationFrame(animate);
}
// Create reflections
const reflections = [];
function createReflections() {
const links = document.querySelectorAll('#links-container a');
links.forEach(link => {
const reflection = document.createElement('div');
reflection.className = 'reflection';
reflection.textContent = link.textContent;
reflection.dataset.link = link.textContent;
document.body.appendChild(reflection);
// Create hover zone
const hoverZone = document.createElement('div');
hoverZone.className = 'hover-zone';
document.body.appendChild(hoverZone);
function updatePositions() {
const linkRect = link.getBoundingClientRect();
const waterElement = document.getElementById('water');
const waterRect = waterElement.getBoundingClientRect();
const waterTop = waterRect.top; // Get actual water position
// Update reflection position
reflection.style.left = linkRect.left + 'px';
reflection.style.top = waterTop + 10 + 'px';
// Update hover zone position (200px above link, extending down to link)
hoverZone.style.left = (linkRect.left - 20) + 'px';
hoverZone.style.top = (linkRect.top - 200) + 'px';
hoverZone.style.width = (linkRect.width + 40) + 'px';
hoverZone.style.height = (200 + linkRect.height) + 'px';
}
updatePositions();
window.addEventListener('resize', updatePositions);
// Handle hover on both link and hover zone
const handleHoverStart = () => {
link.classList.add('hovered');
link.classList.add('no-animation');
link.classList.remove('faded');
reflection.classList.add('hovered');
reflection.classList.add('no-animation');
reflection.classList.remove('faded');
// Update favicon to show link hover
setFaviconState('link-hover', 3000);
};
const handleHoverEnd = () => {
link.classList.remove('hovered');
link.classList.add('faded');
reflection.classList.remove('hovered');
reflection.classList.add('faded');
};
link.addEventListener('mouseenter', handleHoverStart);
link.addEventListener('mouseleave', handleHoverEnd);
hoverZone.addEventListener('mouseenter', handleHoverStart);
hoverZone.addEventListener('mouseleave', handleHoverEnd);
reflections.push({ link, reflection, hoverZone });
});
}
// Track clouds for brightening
const clouds = [];
function trackCloud(cloudElement) {
clouds.push(cloudElement);
}
// Water ripple effect
const water = document.getElementById('water');
water.addEventListener('click', (e) => {
const rect = water.getBoundingClientRect();
const x = e.clientX - rect.left;
const y = e.clientY - rect.top;
const ripple = document.createElement('div');
ripple.className = 'ripple';
ripple.style.left = x + 'px';
ripple.style.top = y + 'px';
ripple.style.width = '40px';
ripple.style.height = '40px';
water.appendChild(ripple);
// Update favicon to show water ripple
setFaviconState('water-ripple', 1500);
// Remove ripple after animation completes
setTimeout(() => {
ripple.remove();
}, 1200);
});
// Initialize
createClouds();
createGrass();
createReflections();
animate();
</script>
</body>
</html>