-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathapp.js
More file actions
678 lines (592 loc) · 27.7 KB
/
app.js
File metadata and controls
678 lines (592 loc) · 27.7 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
// Target the letter
let tl = gsap.timeline()
const n = document.getElementById('#n');
const u = document.getElementById('#u');
const t = document.getElementById('#t');
const h = document.getElementById('#h');
const a = document.getElementById('#a');
const n2 = document.getElementById('#n2');
const a2 = document.getElementById('#a2');
const n3 = document.getElementById('#n3');
const four = document.getElementById('4');
const nine = document.getElementById('9');
const one = document.getElementById('1');
const t2 = document.getElementById('t2');
const tOverlap = document.getElementById('#tOverlap');
const h2 = document.getElementById('#h2');
const hOverlap = document.getElementById('#hOverlap');
const a3 = document.getElementById('#a3');
const r = document.getElementById('r');
const icon3 = document.getElementById('icon3');
const icon3Filler = document.getElementById('icon3Filler');
const m = document.getElementById('#m');
const j = document.getElementById('#j')
const a6 = document.getElementById('#a6')
const h3 = document.getElementById('#h3')
const r2 = document.getElementById('#r2')
const a4 = document.getElementById('#a4')
const a5 = document.getElementById('#a5')
const numbers = [four, nine, one];
const lastThreeLetters = [n2, a2, n3];
tl.set(numbers, { opacity: 0 });
tl.set(t2, {opacity: 0});
tl.set(tOverlap, {opacity: 0});
tl.set(h2, {opacity: 0});
tl.set(hOverlap, {opacity: 0});
tl.set(r, {opacity:0});
tl.set(icon3Filler, {scale:1});
tl.set(icon3, {scale:1});
tl.set(m, {opacity:0});
tl.set(j, {opacity:0});
tl.set(a6, {opacity:0});
tl.set(h3, {opacity:0});
tl.set(a4, {opacity:0});
tl.set(a5, {opacity:0});
const icon1 = document.getElementById("#icon1");
const icon2 = document.getElementById("#icon2");
tl.addLabel("step1", 0)
tl.to(n, {
duration: 0, // Duration of the animation in seconds
rotationX: 180, // Rotate around the Y-axis by 360 degrees
ease: "power2.inOut", // Easing function for a smoother animation
repeat: 0, // Repeat infinitely
yoyo: true // Make the animation reverse back to the start
});
tl.to(n, {
duration: 1, // Duration of the animation in seconds
rotationX: 360, // Rotate around the Y-axis by 360 degrees
ease: "bounce.inOut", // Easing function for a smoother animation
repeat: 0, // Repeat infinitely
yoyo: true // Make the animation reverse back to the start
});
tl.fromTo(icon1,
{ scale: 0 }, // Start scale
{ scale: 1, // End scale
duration: 0.5, // Animation duration in seconds
ease: "power2.inOut" // Easing function
}, "step1+=0.5");
tl.to(icon1,
{ y: -100, opacity: 0 , // End scale
duration: 0.5, // Animation duration in seconds
ease: "bounce.inOut" // Easing function
}, "step1+=1");
tl.fromTo(u,
{ opacity: 0, y:100},
{ opacity: 1, duration: 0.5, y:0},
"step1+=1");
tl.fromTo(t,
{opacity: 0, y: -100},
{opacity: 1, y: 0, duration: 0.25},
"step1+=1");
tl.fromTo(icon2,
{opacity: 0, scale: 0},
{opacity: 1, scale: 1, duration: 0.5},
"step1+=1.5"
);
tl.to(icon2, {rotateZ: 360, duration: 0.5, repeat: 5, ease: "none"}, "step1+=1.5");
tl.fromTo(h,
{opacity: 0, x: -50},
{opacity: 1, x: 0, ease: "bounce.inOut", duration: 0.25},
"step1+=2.5"
);
tl.fromTo(icon2,
{x: 0},
{x: "5vw", ease: "bounce.inOut", duration: 0.25},
"step1+=2.5"
);
tl.fromTo(icon2,
{y: 0},
{opacity: 0, y: 50, ease: "none", duration: 0.25},
"step1+=4"
);
tl.fromTo(a,
{opacity:0, y: 50},
{opacity: 1, y: 0, ease: "none", duration: 0.25},
"step1+=4"
);
tl.fromTo(numbers,
{opacity: 0, y: 50},
{opacity: 1, y: 0, ease: "none", duration: 0.25, stagger: 0.05},
"step1+=2" );
tl.fromTo(numbers,
{opacity:1, y: 0},
{opacity: 0, y: -50, ease: "none", duration: 0.25, stagger: 0.05},
"step1+=2.5" );
tl.fromTo(lastThreeLetters,
{opacity:0, y: 50},
{opacity: 1, y: 0, ease: "none", duration: 0.25, stagger: 0.05},
"step1+=2.5"
);
// t2, tOverlap, h2, hOverlap
tl.fromTo(tOverlap,
{opacity: 1, y: 100},
{opacity: 1, y: 0, ease: "ease.inOut", duration: 0.5, yoyo:true, repeat: 2},
"step1+=1"
);
tl.fromTo(tOverlap,
{opacity: 1, y: 0},
{opacity: 1, y: 200, ease: "ease.inOut", duration: 0.5},
"step1+=2.5"
);
tl.fromTo(t2,
{opacity: 1, y: -100},
{opacity: 1, y: 0, ease: "ease.inOut", duration: 0.5, yoyo:true, repeat: 2},
"step1+=1.5"
);
tl.fromTo(hOverlap,
{opacity: 1, y: 100},
{opacity: 1, y: 0, ease: "ease.inOut", duration: 0.5, yoyo:true, repeat: 2},
"step1+=1.25"
);
tl.fromTo(hOverlap,
{opacity: 1, y: 0},
{opacity: 1, y: 200, ease: "ease.inOut", duration: 0.5},
"step1+=2.75"
);
tl.fromTo(h2,
{opacity: 1, y: -100},
{opacity: 1, y: 0, ease: "ease.inOut", duration: 0.5, yoyo:true, repeat: 2},
"step1+=1.75"
);
tl.fromTo(a3,
{scale: 0},
{scale: 1, rotateY: 360, duration: 1},
"step1+=2"
);
tl.fromTo(a3,
{scale: 0},
{scale: 1, rotateY: 360, duration: 1},
"step1+=2"
);
tl.fromTo(icon3Filler,
{y:-600},
{y:0, duration: 1},
"step1+=2"
);
tl.fromTo(icon3,
{opacity: 1},
{opacity: 0, duration: 1},
"step1+=3"
)
tl.fromTo(icon3Filler,
{scale: 1},
{scale: 0.5, duration: 0.25},
"step1+=4"
);
tl.fromTo(icon3Filler,
{scale: 0.5},
{scale: 0, duration: 0.25},
"step1+=4.25"
);
tl.fromTo(r,
{scale: 0, opacity: 0},
{scale: 1, opacity: 1, duration: 0.25},
"step1+=4.5"
);
tl.fromTo(m,
{y: -100, opacity: 1},
{y: 0, opacity: 1, duration: 0.5},
"step1+=3"
);
tl.fromTo(j,
{opacity: 0},
{opacity: 1, duration: 0.25},
"step1+=2"
);
tl.fromTo(j,
{rotateX: 0},
{rotateX: 360, duration: 1},
"step1+=2"
);
j.addEventListener(
"mouseover",
(event) => {
tl.fromTo(j,
{rotateX: 0},
{rotateX: 360, duration:1, ease: "ease.inOut", delay: 1},
)
});
tl.fromTo(a4,
{x: -100, opacity: 1},
{x: 0, opacity: 1, duration: 0.5},
"step1+=3"
);
tl.fromTo(a5,
{x: 100, opacity: 1},
{x:0, opacity: 1, duration: 0.5, ease: "ease.inOut"},
"step1+=3"
);
gsap.from(".aboutMeParagraph", {
scrollTrigger: {
trigger: ".aboutMeParagraph",
start: "top 80%", // start when top of element hits 80% of viewport
},
duration: 1.2,
opacity: 0,
x: -50,
ease: "power2.out"
});
gsap.from(".skillBox", {
scrollTrigger: {
trigger: ".skillBox",
start: "top 80%",
},
duration: 1,
opacity: 0,
scale: 0.8,
stagger: 0.2,
ease: "back.out(1.7)"
});
gsap.from("nav ul li", {
duration: 1,
opacity: 0,
y: -20,
stagger: 0.15,
delay: 0.5,
ease: "power3.out"
});
tl.fromTo(a6,
{x: -100, opacity: 1},
{x: 0, opacity: 1, duration: 0.5},
"step1+=3"
);
tl.fromTo(h3,
{opacity: 1, rotateZ: -90},
{opacity: 1, rotateZ: 0, duration: 0.5, ease: "ease.inOut"},
"step1+=3"
);
tl.fromTo(r2,
{y: -200},
{y:0, duration: 0.5, ease: "ease.inOut"},
"step1+=3"
);
let projects = {
remap: {
title: "ReMap",
year: "2026",
hackathon: "UofT Hacks VIII",
category: "Full Stack",
categoryColor: "#7C3AED", // purple
languages: "Sonnet 3.5, FastAPI, Gemini 3.5, LangGraph, MapBoxGL, MongoDB, Next.js, OpenAI, Python, React, TailwindCSS",
description: "An interactive planning tool that helps urban planners explore development through an ecological and Indigenous lens using AI agents.",
githubLink: "https://github.com/hannatonthat/remap-uofthacks2026",
source: "./images/remap.png"
},
quickcart: {
title: "QuickCart",
year: "2026",
hackathon: "DeltaHacks XII",
category: "Full Stack",
categoryColor: "#7C3AED", // purple
languages: "React Native, Expo Router, Firebase, TypeScript, JavaScript, Flask, YOLOv8, OpenCV, MongoDB, CLIP, Stripe API",
description: "A mobile app that uses CLIP-powered computer vision to track grocery items in real time and streamlines checkout with Firebase syncing and Stripe payments.",
githubLink: "https://github.com/nuthanan06/quickcart",
source: "./images/quickcart.png"
},
swiftsdk: {
title: "Solana Swift SDK",
year: "2025",
hackathon: "Funded by Solana Foundation",
category: "Development Tools",
categoryColor: "#2563EB", // purple
languages: "Swift, Solana, web3-core, rpc-core",
description: "Built the first Solana SDK for Swift, enabling iOS developers to seamlessly integrate Solana blockchain functionalities into their applications.",
githubLink: "https://github.com/The-SolShare-Team/SolanaWalletAdapterKit",
source: "./images/solanaswift.png"
},
solshare: {
title: "Solshare",
year: "2025",
hackathon: "Hack the North (Best Use of Cohere API & Solana)",
category: "Full Stack",
categoryColor: "#7C3AED", // purple
languages: "Cohere API, Firebase, GCP, Solana, Swift, SwiftUI, Typescript",
description: "A cost-sharing mobile app designed to make splitting bills with friends easy, transparent, and secure, using blockchain technology.",
githubLink: "https://github.com/HTN-2025/Solshare-Front-End-App",
source: "./images/solshare.png"
},
investie: {
title: "Investie",
year: "2025",
hackathon: "Hack Western",
category: "Full Stack",
categoryColor: "#7C3AED", // purple
languages: "Gemini 4.0, Next.js, Node.js, TailwindCSS, Typescript",
description: "A female-focused investment app that helps users explore businesses, get AI-driven insights, and make informed financial decisions.",
githubLink: "https://github.com/nuthanan06/investie",
source: "./images/investie.png"
},
teabag: {
title: "Teabag",
year: "2024",
hackathon: "UofT Hacks VII",
category: "Full Stack",
categoryColor: "#7C3AED", // purple
languages: "Next.js, Typescript, TailwindCSS, Python, Flask, Firebase, Langchain",
description: "Summarizes stories from speech or text using AI. Built with Next.js, Flask, and Firebase.",
githubLink: "https://github.com/JenniferYu-8/teabag/tree/main",
source: "./images/teabag.png"
},
listenhacks: {
title: "TwoTabs",
year: "2026",
hackathon: "ListenHacks (2nd Place)",
category: "Full Stack",
categoryColor: "#7C3AED",
languages: "JavaScript, Python, HTML, CSS, Gemini, ElevenLabs",
description: "Cost-free, beginner-friendly music production in two tabs: chat with Gemini + ElevenLabs, then mix tracks live with computer-vision hand controls.",
githubLink: "https://github.com/nur4o4/listenhacks",
source: "./images/TwoTabs.png"
},
sk8tr: {
title: "Sk8tr",
year: "2026",
hackathon: "GenAI Genesis",
category: "AI/ML",
categoryColor: "#10B981",
languages: "Python, TypeScript, TensorFlow, MediaPipe, YOLO11, LangChain, FastAPI, Next.js, OpenCV, Twelve Labs",
description: "LangChain skating copilot that extracts YouTube clips from pro programs and scores classified jumps with NYT-style visuals, using a fine-tuned YOLO11 jump classifier.",
githubLink: "https://github.com/sylviax28/sk8tr",
source: "./images/Sk8tr.png"
},
skinCancerDetection: {
title: "AI Skin Cancer Detection",
year: "2023",
hackathon: "",
category: "AI/ML",
categoryColor: "#10B981", // green
languages: "PyTorch",
description: "CNN model for skin lesion classification. Achieved 74% accuracy with ResNet50.",
githubLink: "https://github.com/nuthanan06/AISkinCancerDetection/tree/main",
source: "./images/skincancerdetection.png"
},
communityCreator: {
title: "Community Creator",
year: "2023",
hackathon: "Hack the 6ix",
category: "Full Stack",
categoryColor: "#7C3AED", // purple
languages: "React, CSS, Cohere API",
description: "AI-powered platform for feedback on sustainable community practices.",
githubLink: "https://github.com/nuthanan06/Community-Creator",
source: "./images/communitycreatorlaptop.png"
},
personalPortfolio: {
title: "Personal Portfolio",
year: "2024",
hackathon: "",
category: "Full Stack",
categoryColor: "#7C3AED", // purple
languages: "HTML, Tailwind.css, Javascript, GSAP, Anime.js",
description: "Personal website to showcase my projects and interests with custom UI/UX.",
githubLink: "https://github.com/nuthanan06/PersonalPortfolio",
source: "./images/personalportfolio.png"
},
mathLossFunction: {
title: "Mathematical Analysis of Loss Functions",
year: "2022",
hackathon: "",
category: "Research",
categoryColor: "#F59E42", // orange
languages: "PyTorch",
description: "Research on how loss functions affect neural network accuracy and efficiency.",
githubLink: "https://github.com/nuthanan06/ResearchPapers/blob/main/Mathematical%20Analysis%20of%20Neural%20Networks.pdf",
source: "./images/neuralnetwork.png"
},
modelling: {
title: "Mathematical Analysis of Sustainable Architecture",
year: "2022",
hackathon: "",
category: "Research",
categoryColor: "#F59E42", // orange
languages: "Blender",
description: "Blender models and analysis of math in sustainable architecture.",
githubLink: "https://github.com/nuthanan06/ResearchPapers/blob/main/Mathematical%20Analysis%20of%20Sustainable%20Architecture.pdf",
source: "./images/mathematicalmodelling.png"
}
};
// --- Year & Category Filter UI ---
const allYears = Array.from(new Set(Object.values(projects).map(p => p.year))).sort((a, b) => b - a);
const allCategories = Array.from(new Set(Object.values(projects).map(p => p.category)));
let selectedYear = 'All';
let selectedCategory = 'All';
function renderProjects(year = 'All', category = 'All') {
let string = `<h2 class="relative text-shadow font-santoshi text-primary-purple text-[80px] ml-[30px] md:w-[50%] md:mb-8 font-extrabold md:mini:left-[0px] mini:m-auto mini:text-center"> Projects
<div class="relative md:line">
<div class="dotStuff">
<div class="md:dot"> </div>
<div class="md:dot"> </div>
<div class="md:dot"> </div>
</div>
</div>
</h2>`;
// Filters at the top
string += `<div class='flex flex-wrap gap-3 justify-center items-center mb-4'>
<span class="font-santoshi text-gray-300 mr-2">Year:</span>
<button class="px-4 py-1 rounded-full border font-santoshi text-lg transition-all duration-150 ${year==='All' ? 'bg-primary-purple text-white border-primary-purple' : 'bg-black text-primary-purple border-primary-purple hover:bg-primary-purple hover:text-white'}" onclick="window.filterProjects && window.filterProjects('All', '${category}')">All</button>`;
for (const y of allYears) {
string += `<button class="px-4 py-1 rounded-full border font-santoshi text-lg transition-all duration-150 ${year===y ? 'bg-primary-purple text-white border-primary-purple' : 'bg-black text-primary-purple border-primary-purple hover:bg-primary-purple hover:text-white'}" onclick=\"window.filterProjects && window.filterProjects('${y}', '${category}')\">${y}</button>`;
}
string += `</div>`;
string += `<div class='flex flex-wrap gap-3 justify-center items-center mb-8'>
<span class="font-santoshi text-gray-300 mr-2">Category:</span>
<button class="px-4 py-1 rounded-full border font-santoshi text-lg transition-all duration-150 ${category==='All' ? 'bg-primary-purple text-white border-primary-purple' : 'bg-black text-primary-purple border-primary-purple hover:bg-primary-purple hover:text-white'}" onclick="window.filterProjects && window.filterProjects('${year}', 'All')">All</button>`;
for (const c of allCategories) {
string += `<button class="px-4 py-1 rounded-full border font-santoshi text-lg transition-all duration-150 ${category===c ? 'bg-primary-purple text-white border-primary-purple' : 'bg-black text-primary-purple border-primary-purple hover:bg-primary-purple hover:text-white'}" onclick=\"window.filterProjects && window.filterProjects('${year}', '${c}')\">${c}</button>`;
}
string += `</div>`;
// Top 5 most important projects (customize this list/order as needed)
const topProjectKeys = [
'swiftsdk',
'solshare',
'remap',
'quickcart',
'skinCancerDetection'
];
const topKeySet = new Set(topProjectKeys);
const topProjects = topProjectKeys
.map(key => projects[key])
.filter(p => p && ((year === 'All' || p.year === year) && (category === 'All' || p.category === category)));
const restOrder = { listenhacks: 0, sk8tr: 1, investie: 2, teabag: 3 };
const restProjects = Object.entries(projects)
.filter(([key, p]) => !topKeySet.has(key) && ((year === 'All' || p.year === year) && (category === 'All' || p.category === category)))
.sort(([a], [b]) => (restOrder[a] ?? 999) - (restOrder[b] ?? 999))
.map(([, p]) => p);
// Render top projects (big cards)
if (topProjects.length > 0) {
string += `<div class="flex flex-col gap-8 w-full max-w-[1600px] px-4 md:px-8 xl:px-16 mx-auto mt-8 justify-between">`;
for (let element of topProjects) {
string += `<div class="project-feature-card rounded-3xl bg-[#232136] border-primary-purple border-4 shadow-xl overflow-hidden flex flex-col md:flex-row hover:border-opacity-100 transition-all duration-300 relative">
<img src="${element.source}" alt="${element.title} screenshot" class="w-full md:w-[40%] max-h-[360px] object-contain border-r border-primary-purple bg-black" style="aspect-ratio: 1/1;"/>
<div class="p-10 flex flex-col flex-1">
<span class="font-santoshi" style="background:${element.categoryColor};color:#fff;display:inline-block;padding:3px 16px;font-size:15px;font-weight:700;border-radius:9999px;margin-bottom:12px;align-self:flex-start;box-shadow:0 1px 4px 0 rgba(0,0,0,0.10);text-shadow:0 1px 2px rgba(0,0,0,0.10);line-height:1.2;">${element.category}</span>
<h3 class="font-santoshi text-primary-purple text-[32px] font-bold mb-2">${element.title}</h3>
<div class="text-[18px] text-gray-300 font-santoshi italic mb-2 mt-0">
${element.year}${element.hackathon ? ` — <span class='text-primary-purple'>${element.hackathon}</span>` : ''}
</div>
<hr class="border-t border-gray-700 mb-3">
<div class="flex flex-wrap gap-2 mb-3 justify-start">
${element.languages.split(',').map(lang => `<span class='inline-block border-[1px] border-primary-purple rounded-[10px] text-gray-300 px-2 py-0.5 text-[14px] font-semibold font-santoshi'>${lang.trim()}</span>`).join('')}
</div>
<p class="text-white text-[20px] font-santoshi mb-4 line-clamp-4">
${element.description}
</p>
<a href="${element.githubLink}" target="_blank" aria-label="GitHub Repository" class="absolute top-4 right-4 opacity-50 hover:opacity-100 transition-opacity duration-200">
<svg width="40" height="40" viewBox="0 0 24 24" fill="white" xmlns="http://www.w3.org/2000/svg">
<path d="M12 0.297C5.373 0.297 0 5.67 0 12.297c0 5.282 3.438 9.747 8.205 11.325.6.111.82-.261.82-.577 0-.285-.011-1.04-.017-2.042-3.338.726-4.042-1.61-4.042-1.61-.546-1.387-1.333-1.756-1.333-1.756-1.089-.745.083-.729.083-.729 1.205.085 1.84 1.237 1.84 1.237 1.07 1.834 2.809 1.304 3.495.997.108-.775.419-1.305.762-1.606-2.665-.304-5.466-1.332-5.466-5.931 0-1.31.469-2.381 1.236-3.221-.124-.303-.535-1.523.117-3.176 0 0 1.008-.322 3.301 1.23a11.52 11.52 0 0 1 3.003-.404c1.019.005 2.047.138 3.003.404 2.291-1.552 3.297-1.23 3.297-1.23.653 1.653.242 2.873.119 3.176.77.84 1.235 1.911 1.235 3.221 0 4.609-2.804 5.625-5.475 5.921.43.371.823 1.102.823 2.222 0 1.606-.015 2.898-.015 3.293 0 .319.216.694.825.576C20.565 22.04 24 17.576 24 12.297c0-6.627-5.373-12-12-12z"/>
</svg>
</a>
</div>
</div>`;
}
string += `</div>`;
}
// Render rest projects (grid)
if (restProjects.length > 0) {
string += `<div class="grid grid-cols-1 md:grid-cols-2 xl:grid-cols-3 gap-6 mt-8 w-full max-w-[1600px] px-4 md:px-8 xl:px-16 mx-auto justify-around">`;
for (let element of restProjects) {
string += `<div class="projectButton rounded-2xl bg-[#1C1C1E] border-primary-purple border-2 skillBox overflow-hidden flex flex-col hover:border-opacity-100 transition-all duration-300 relative">
<div class="p-6 flex flex-col flex-1">
<span class="font-santoshi" style="background:${element.categoryColor};color:#fff;display:inline-block;padding:3px 16px;font-size:15px;font-weight:700;border-radius:9999px;margin-bottom:12px;align-self:flex-start;box-shadow:0 1px 4px 0 rgba(0,0,0,0.10);text-shadow:0 1px 2px rgba(0,0,0,0.10);line-height:1.2;">${element.category}</span>
<h3 class="font-santoshi text-primary-purple text-[25px] w-[80%] font-bold mb-0">${element.title}</h3>
<div class="text-[15px] text-gray-300 font-santoshi italic mb-2 mt-0">
${element.year}${element.hackathon ? ` — <span class='text-primary-purple'>${element.hackathon}</span>` : ''}
</div>
<hr class="border-t border-gray-700 mb-3">
<div class="flex flex-wrap gap-2 mb-3 justify-start">
${element.languages.split(',').map(lang => `<span class='inline-block border-[1px] border-primary-purple rounded-[10px] text-gray-300 px-2 py-0.5 text-[12px] font-semibold font-santoshi'>${lang.trim()}</span>`).join('')}
</div>
<p class="text-white text-[15px] font-santoshi mb-4 line-clamp-3">
${element.description}
</p>
<a href="${element.githubLink}" target="_blank" aria-label="GitHub Repository" class="absolute top-4 right-4 opacity-50 hover:opacity-100 transition-opacity duration-200">
<svg width="28" height="28" viewBox="0 0 24 24" fill="white" xmlns="http://www.w3.org/2000/svg">
<path d="M12 0.297C5.373 0.297 0 5.67 0 12.297c0 5.282 3.438 9.747 8.205 11.325.6.111.82-.261.82-.577 0-.285-.011-1.04-.017-2.042-3.338.726-4.042-1.61-4.042-1.61-.546-1.387-1.333-1.756-1.333-1.756-1.089-.745.083-.729.083-.729 1.205.085 1.84 1.237 1.84 1.237 1.07 1.834 2.809 1.304 3.495.997.108-.775.419-1.305.762-1.606-2.665-.304-5.466-1.332-5.466-5.931 0-1.31.469-2.381 1.236-3.221-.124-.303-.535-1.523.117-3.176 0 0 1.008-.322 3.301 1.23a11.52 11.52 0 0 1 3.003-.404c1.019.005 2.047.138 3.003.404 2.291-1.552 3.297-1.23 3.297-1.23.653 1.653.242 2.873.119 3.176.77.84 1.235 1.911 1.235 3.221 0 4.609-2.804 5.625-5.475 5.921.43.371.823 1.102.823 2.222 0 1.606-.015 2.898-.015 3.293 0 .319.216.694.825.576C20.565 22.04 24 17.576 24 12.297c0-6.627-5.373-12-12-12z"/>
</svg>
</a>
</div>
<img src="${element.source}" alt="${element.title} screenshot" class="w-full max-h-[250px] object-contain mt-auto border-t border-primary-purple bg-black" style="aspect-ratio: 1/1;"/>
</div>`;
}
string += `</div>`;
}
string += `<div class="flex flex-row w-[100%] justify-center items-center gap-3">
<p class="my-4 text-gray-200 text-[15px] font-santoshi text-center"> @2024 Nuthanan Tharmarajah | </p>
<a href="https://se-webring.xyz/" target="_blank">
<img src="./images/logo_w.png" class="w-[30px] h-[20px]">
</a>
<a href="https://www.linkedin.com/in/nuthanan-tharmarajah/" target="_blank">
<img src="./images/linkedin.png"class="w-[30px] h-[30px]">
</a>
<a href="https://github.com/nuthanan06" target="_blank">
<img src="./images/github-white-icon.png"class="w-[30px] h-[30px]">
</a>
</div>
`;
// Removed erroneous leftover button and duplicate grid rendering
let projectsContainer = document.getElementById("projects");
projectsContainer.innerHTML = string;
// Animate only the big project cards (not the grid)
gsap.registerPlugin(ScrollTrigger);
document.querySelectorAll(".project-feature-card").forEach((card, i) => {
gsap.from(card, {
scrollTrigger: {
trigger: card,
start: "top 80%", // animate when card enters viewport
},
duration: 1,
x: i % 2 === 0 ? -100 : 100, // even buttons from left, odd from right
opacity: 0,
ease: "power3.out",
duration: 0.5,
});
});
// Animate the grid project cards (projectButton) after DOM update
document.querySelectorAll(".projectButton").forEach((btn, i) => {
gsap.from(btn, {
scrollTrigger: {
trigger: btn,
start: "top 80%",
},
duration: 0.5,
y: 50,
opacity: 0,
ease: "power2.out",
});
});
}
// Expose filter function globally for inline onclick
window.filterProjects = function(year, category) {
selectedYear = year;
selectedCategory = category;
renderProjects(year, category);
}
// Initial render
renderProjects(selectedYear, selectedCategory);
// Animate experience cards on scroll (assumes .experienceCard class is used)
document.querySelectorAll(".experienceCard").forEach((card, i) => {
gsap.from(card, {
scrollTrigger: {
trigger: card,
start: "top 80%",
},
duration: 1,
y: 50,
ease: "power2.out",
});
});
const circles = document.querySelectorAll(".circle");
circles.forEach((circle) => {
gsap.from(circle.querySelectorAll("p"), {
scrollTrigger: {
trigger: circle,
start: "top 80%", // start when circle enters viewport
toggleActions: "play none none none",
},
opacity: 0,
y: 50,
stagger: 0.2, // paragraphs animate one after another
duration: 0.6,
ease: "power3.out"
});
});