-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathscript.js
More file actions
1218 lines (1054 loc) · 45.1 KB
/
script.js
File metadata and controls
1218 lines (1054 loc) · 45.1 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
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
function setNavbarStyles() {
const navbar = document.querySelector('.navbar');
if (!navbar) return;
const isDarkMode = document.body.classList.contains('dark-mode');
const navbarBg = getComputedStyle(document.body).getPropertyValue('--navbar-bg').trim();
navbar.style.background = navbarBg;
navbar.style.boxShadow = window.scrollY > 100
? (isDarkMode ? '0 2px 20px rgba(0,0,0,0.3)' : '0 2px 20px rgba(0,0,0,0.1)')
: 'none';
}
// Initial navbar sync
setNavbarStyles();
// Mobile menu toggle
const hamburger = document.querySelector('.hamburger');
const navMenu = document.querySelector('.nav-menu');
if (hamburger && navMenu) {
hamburger.addEventListener('click', () => {
hamburger.classList.toggle('active');
navMenu.classList.toggle('active');
document.body.classList.toggle('menu-open', navMenu.classList.contains('active'));
});
// Close menu when clicking on a nav link
document.querySelectorAll('.nav-menu a').forEach(link => {
link.addEventListener('click', () => {
hamburger.classList.remove('active');
navMenu.classList.remove('active');
document.body.classList.remove('menu-open');
});
});
// Close menu when clicking outside
document.addEventListener('click', (e) => {
if (!hamburger.contains(e.target) && !navMenu.contains(e.target)) {
hamburger.classList.remove('active');
navMenu.classList.remove('active');
document.body.classList.remove('menu-open');
}
});
}
// Smooth scrolling for navigation links
document.querySelectorAll('a[href^="#"]').forEach(anchor => {
anchor.addEventListener('click', function (e) {
e.preventDefault();
const target = document.querySelector(this.getAttribute('href'));
if (target) {
target.scrollIntoView({
behavior: 'smooth',
block: 'start'
});
}
});
});
function initDesktopScrollspyDots() {
if (document.querySelector('.scrollspy-dots')) return;
const sectionEntries = getMainSectionEntries();
if (!sectionEntries.length) return;
const dotsNav = document.createElement('nav');
dotsNav.className = 'scrollspy-dots';
dotsNav.setAttribute('aria-label', 'Section navigation');
const dotsList = document.createElement('ul');
sectionEntries.forEach(({ targetId, label }) => {
const item = document.createElement('li');
const dot = document.createElement('a');
dot.className = 'scrollspy-dot';
dot.href = targetId;
dot.dataset.target = targetId;
dot.setAttribute('aria-label', label);
dot.setAttribute('title', label);
item.appendChild(dot);
dotsList.appendChild(item);
});
dotsNav.appendChild(dotsList);
document.body.appendChild(dotsNav);
const dotLinks = Array.from(dotsNav.querySelectorAll('.scrollspy-dot'));
const desktopMq = window.matchMedia('(min-width: 1024px)');
const setActiveDot = (activeTargetId) => {
dotLinks.forEach((dot) => {
const isActive = dot.dataset.target === activeTargetId;
dot.classList.toggle('is-active', isActive);
if (isActive) {
dot.setAttribute('aria-current', 'location');
} else {
dot.removeAttribute('aria-current');
}
});
};
const resolveActiveTarget = () => {
const sectionOffset = window.scrollY + Math.round(window.innerHeight * 0.35);
let activeTargetId = sectionEntries[0].targetId;
sectionEntries.forEach(({ targetId, sectionEl }) => {
if (sectionEl.offsetTop <= sectionOffset) {
activeTargetId = targetId;
}
});
if (window.innerHeight + window.scrollY >= document.documentElement.scrollHeight - 4) {
activeTargetId = sectionEntries[sectionEntries.length - 1].targetId;
}
return activeTargetId;
};
const updateActiveDot = () => {
if (!desktopMq.matches) {
setActiveDot('');
return;
}
setActiveDot(resolveActiveTarget());
};
let scrollTicking = false;
const onScroll = () => {
if (scrollTicking) return;
scrollTicking = true;
window.requestAnimationFrame(() => {
updateActiveDot();
scrollTicking = false;
});
};
dotLinks.forEach((dot) => {
dot.addEventListener('click', (event) => {
const targetSelector = dot.dataset.target;
const targetElement = targetSelector ? document.querySelector(targetSelector) : null;
if (!targetElement) return;
event.preventDefault();
const prefersReducedMotion = window.matchMedia('(prefers-reduced-motion: reduce)').matches;
targetElement.scrollIntoView({
behavior: prefersReducedMotion ? 'auto' : 'smooth',
block: 'start'
});
});
});
window.addEventListener('scroll', onScroll, { passive: true });
window.addEventListener('resize', onScroll);
if (typeof desktopMq.addEventListener === 'function') {
desktopMq.addEventListener('change', updateActiveDot);
} else if (typeof desktopMq.addListener === 'function') {
desktopMq.addListener(updateActiveDot);
}
updateActiveDot();
}
function getMainSectionEntries() {
const navAnchors = Array.from(document.querySelectorAll('.nav-menu > li > a[href^="#"]'));
return navAnchors
.map((anchor) => {
const targetId = anchor.getAttribute('href');
if (!targetId || targetId === '#') return null;
const sectionEl = document.querySelector(targetId);
if (!sectionEl) return null;
const label = (anchor.textContent || '').trim() || targetId.replace('#', '');
return { targetId, sectionEl, label };
})
.filter(Boolean);
}
function initMobileSectionArrows() {
if (document.querySelector('.mobile-section-arrows')) return;
const sectionEntries = getMainSectionEntries();
if (sectionEntries.length < 2) return;
const mobileNav = document.createElement('nav');
mobileNav.className = 'mobile-section-arrows';
mobileNav.setAttribute('aria-label', 'Section navigation controls');
const upButton = document.createElement('button');
upButton.type = 'button';
upButton.className = 'mobile-section-arrow mobile-section-arrow-up';
upButton.innerHTML = '<span aria-hidden="true">↑</span>';
const downButton = document.createElement('button');
downButton.type = 'button';
downButton.className = 'mobile-section-arrow mobile-section-arrow-down';
downButton.innerHTML = '<span aria-hidden="true">↓</span>';
mobileNav.appendChild(upButton);
mobileNav.appendChild(downButton);
document.body.appendChild(mobileNav);
const mobileMq = window.matchMedia('(max-width: 1023px)');
const resolveActiveIndex = () => {
const sectionOffset = window.scrollY + Math.round(window.innerHeight * 0.35);
let activeIndex = 0;
sectionEntries.forEach(({ sectionEl }, index) => {
if (sectionEl.offsetTop <= sectionOffset) {
activeIndex = index;
}
});
if (window.innerHeight + window.scrollY >= document.documentElement.scrollHeight - 4) {
activeIndex = sectionEntries.length - 1;
}
return activeIndex;
};
const scrollToIndex = (index) => {
const clampedIndex = Math.max(0, Math.min(index, sectionEntries.length - 1));
const targetSection = sectionEntries[clampedIndex]?.sectionEl;
if (!targetSection) return;
const prefersReducedMotion = window.matchMedia('(prefers-reduced-motion: reduce)').matches;
targetSection.scrollIntoView({
behavior: prefersReducedMotion ? 'auto' : 'smooth',
block: 'start'
});
};
const updateArrowState = () => {
if (!mobileMq.matches) {
mobileNav.classList.remove('is-visible');
upButton.classList.add('is-hidden');
downButton.classList.add('is-hidden');
return;
}
const activeIndex = resolveActiveIndex();
const nearTop = window.scrollY <= Math.max(8, Math.round(window.innerHeight * 0.05));
const nearBottom = window.innerHeight + window.scrollY >= document.documentElement.scrollHeight - 6;
const canGoUp = activeIndex > 0 && !nearTop;
const canGoDown = activeIndex < sectionEntries.length - 1 && !nearBottom;
mobileNav.classList.toggle('is-visible', canGoUp || canGoDown);
upButton.classList.toggle('is-hidden', !canGoUp);
upButton.disabled = !canGoUp;
if (canGoUp) {
const prevSectionLabel = sectionEntries[activeIndex - 1].label;
upButton.setAttribute('aria-label', `Scroll to ${prevSectionLabel}`);
upButton.setAttribute('title', prevSectionLabel);
} else {
upButton.setAttribute('aria-label', 'Already at top section');
upButton.removeAttribute('title');
}
downButton.classList.toggle('is-hidden', !canGoDown);
downButton.disabled = !canGoDown;
if (canGoDown) {
const nextSectionLabel = sectionEntries[activeIndex + 1].label;
downButton.setAttribute('aria-label', `Scroll to ${nextSectionLabel}`);
downButton.setAttribute('title', nextSectionLabel);
} else {
downButton.setAttribute('aria-label', 'Already at bottom section');
downButton.removeAttribute('title');
}
};
upButton.addEventListener('click', () => {
const activeIndex = resolveActiveIndex();
scrollToIndex(activeIndex - 1);
});
downButton.addEventListener('click', () => {
const activeIndex = resolveActiveIndex();
scrollToIndex(activeIndex + 1);
});
let scrollTicking = false;
const onScroll = () => {
if (scrollTicking) return;
scrollTicking = true;
window.requestAnimationFrame(() => {
updateArrowState();
scrollTicking = false;
});
};
window.addEventListener('scroll', onScroll, { passive: true });
window.addEventListener('resize', onScroll);
if (typeof mobileMq.addEventListener === 'function') {
mobileMq.addEventListener('change', updateArrowState);
} else if (typeof mobileMq.addListener === 'function') {
mobileMq.addListener(updateArrowState);
}
updateArrowState();
}
// Simple client-side i18n loader (supports en, it, es)
// Uses embedded locales from locales.js to avoid CORS issues on GitHub Pages
const supportedLangs = ['en', 'it', 'es'];
function loadLocale(lang) {
if (!supportedLangs.includes(lang)) lang = 'en';
if (!locales[lang]) {
console.warn('Locale not found for', lang);
lang = 'en';
}
const data = locales[lang];
window.currentLocaleData = data;
applyTranslations(data);
return data;
}
function applyTranslations(t) {
if (!t) return;
if (t['meta.title']) {
document.title = t['meta.title'];
}
if (t['meta.ogTitle']) {
const ogTitle = document.querySelector('meta[property="og:title"]');
if (ogTitle) ogTitle.setAttribute('content', t['meta.ogTitle']);
}
if (t['meta.ogDescription']) {
const ogDescription = document.querySelector('meta[property="og:description"]');
if (ogDescription) ogDescription.setAttribute('content', t['meta.ogDescription']);
}
if (t['meta.twitterTitle']) {
const twitterTitle = document.querySelector('meta[name="twitter:title"]');
if (twitterTitle) twitterTitle.setAttribute('content', t['meta.twitterTitle']);
}
if (t['meta.twitterDescription']) {
const twitterDescription = document.querySelector('meta[name="twitter:description"]');
if (twitterDescription) twitterDescription.setAttribute('content', t['meta.twitterDescription']);
}
document.querySelectorAll('[data-i18n]').forEach(el => {
const key = el.dataset.i18n;
const val = t[key];
if (val === undefined) return;
const tag = el.tagName.toLowerCase();
if (tag === 'input' || tag === 'textarea') {
el.placeholder = val;
} else {
// For elements with child nodes (like labels with icons or spans), replace only text nodes
let textNodeFound = false;
for (let node of el.childNodes) {
if (node.nodeType === Node.TEXT_NODE && node.textContent.trim().length > 0) {
node.textContent = val;
textNodeFound = true;
break;
}
}
// If no significant text node found, set textContent directly
if (!textNodeFound) {
el.textContent = val;
}
}
});
// Force re-translation of form labels with nested elements
updateFormLabels(t);
// Trigger modal form validation state update if modal is open
const contactModal = document.getElementById('contact-modal');
if (contactModal && contactModal.style.display === 'block') {
// Force validation display refresh for any fields with errors
document.querySelectorAll('.form-group.has-error').forEach(group => {
const errorSpan = group.querySelector('.error-message');
if (errorSpan && errorSpan.textContent) {
// Error message will be re-generated on next validation
group.classList.remove('has-error');
errorSpan.textContent = '';
}
});
}
}
function updateFormLabels(t) {
if (!t) return;
// Update form labels with their base translation + char-count
const nameLabel = document.querySelector('label[for="name"]');
if (nameLabel) {
const baseText = t['contact.name'] || 'Name';
const charCount = t['contact.minChars3'] || '(min 3 characters)';
nameLabel.innerHTML = `${baseText} <span class="char-count" data-i18n="contact.minChars3">${charCount}</span>`;
}
const emailLabel = document.querySelector('label[for="email"]');
if (emailLabel) {
const emailText = t['contact.emailField'] || 'Email';
emailLabel.textContent = emailText;
}
const messageLabel = document.querySelector('label[for="message"]');
if (messageLabel) {
const baseText = t['contact.message'] || 'Message';
const charCount = t['contact.minChars10'] || '(min 10 characters)';
messageLabel.innerHTML = `${baseText} <span class="char-count" data-i18n="contact.minChars10">${charCount}</span>`;
}
// Re-translate error messages for fields that currently have errors
document.querySelectorAll('.form-group.has-error').forEach(group => {
const field = group.querySelector('input, textarea');
if (field) {
const fieldId = field.id;
const minLength = field.minLength || 0;
// Re-validate to update error message in new language
if (fieldId === 'name') validateField('name', 3);
else if (fieldId === 'email') validateField('email', 0);
else if (fieldId === 'message') validateField('message', 10);
}
});
}
function setActiveLanguagePill(lang) {
document.querySelectorAll('.lang-pill').forEach(button => {
const isActive = button.dataset.lang === lang;
button.classList.toggle('active', isActive);
button.setAttribute('aria-pressed', isActive ? 'true' : 'false');
});
}
function getLangFromPath(pathname) {
const cleanPath = (pathname || '').replace(/\\/g, '/');
const segments = cleanPath.split('/').filter(Boolean);
if (segments.length === 0) return 'en';
const last = segments[segments.length - 1].toLowerCase();
const prev = segments.length > 1 ? segments[segments.length - 2].toLowerCase() : '';
if (last === 'it' || last === 'es') return last;
if (last === 'index.html' && (prev === 'it' || prev === 'es')) return prev;
return 'en';
}
function buildLanguagePath(lang) {
const isFile = window.location.protocol === 'file:';
const cleanPath = window.location.pathname.replace(/\\/g, '/');
const segments = cleanPath.split('/').filter(Boolean);
let baseSegments = segments.slice();
let fileName = 'index.html';
if (isFile) {
if (baseSegments.length > 0) {
const lastSegment = baseSegments[baseSegments.length - 1];
if (lastSegment.toLowerCase().endsWith('.html')) {
fileName = lastSegment;
baseSegments = baseSegments.slice(0, -1);
}
}
} else if (baseSegments.length > 0 && baseSegments[baseSegments.length - 1].toLowerCase() === 'index.html') {
baseSegments = baseSegments.slice(0, -1);
}
if (baseSegments.length > 0) {
const lastFolder = baseSegments[baseSegments.length - 1].toLowerCase();
if (lastFolder === 'it' || lastFolder === 'es') {
baseSegments = baseSegments.slice(0, -1);
}
}
if (lang !== 'en') {
baseSegments.push(lang);
}
let newPath = '/' + baseSegments.join('/');
if (!newPath.endsWith('/')) newPath += '/';
if (isFile) newPath += fileName;
return newPath;
}
function navigateToLanguage(lang) {
const newPath = buildLanguagePath(lang);
const hash = window.location.hash || '';
if (window.location.protocol === 'file:') {
window.location.href = `file://${newPath}${hash}`;
} else {
window.location.href = `${newPath}${hash}`;
}
}
document.addEventListener('DOMContentLoaded', function () {
let lang = getLangFromPath(window.location.pathname);
if (!supportedLangs.includes(lang)) lang = 'en';
// Load locale first
loadLocale(lang);
initDesktopScrollspyDots();
initMobileSectionArrows();
setActiveLanguagePill(lang);
document.querySelectorAll('.lang-pill').forEach(button => {
button.addEventListener('click', () => {
const chosen = button.dataset.lang;
if (!supportedLangs.includes(chosen)) return;
navigateToLanguage(chosen);
const hamburger = document.querySelector('.hamburger');
const navMenu = document.querySelector('.nav-menu');
if (hamburger && navMenu) {
hamburger.classList.remove('active');
navMenu.classList.remove('active');
document.body.classList.remove('menu-open');
}
});
});
});
function initProjectFilters() {
const filterBar = document.querySelector('.project-filters');
if (!filterBar) return;
const buttons = Array.from(filterBar.querySelectorAll('.filter-chip'));
const cards = Array.from(document.querySelectorAll('.projects-grid .project-card'));
if (!buttons.length || !cards.length) return;
const normalizeTags = (value) => (value || '')
.toLowerCase()
.split(/[\s,]+/)
.filter(Boolean);
const setActive = (filter) => {
buttons.forEach((btn) => {
btn.classList.toggle('active', btn.dataset.filter === filter);
});
};
const applyFilter = (filter) => {
cards.forEach((card) => {
const tags = normalizeTags(card.dataset.tech);
const shouldShow = filter === 'all' || tags.includes(filter);
card.classList.toggle('is-hidden', !shouldShow);
});
setActive(filter);
};
buttons.forEach((button) => {
button.addEventListener('click', () => {
const filter = button.dataset.filter || 'all';
applyFilter(filter);
});
});
applyFilter('all');
}
document.addEventListener('DOMContentLoaded', function () {
initProjectFilters();
});
// Project details data
const projectDetails = {
'redelivery-hub': {
title: 'Redelivery Hub',
description: 'A comprehensive automation platform that streamlines redelivery workflows through intelligent automation and real-time monitoring.',
features: [
'Multi-tool automation platform with unified interface',
'Automated ticket creation with Selenium WebDriver',
'Real-time status tracking and progress monitoring',
'File processing and validation systems',
'FileHunter for automated file discovery and copying',
'Redelivery Validator for quality assurance',
'TicketEye for bulk ticket management',
'Integrated SOP documentation system'
],
technologies: ['Python', 'Flask', 'Selenium WebDriver', 'HTML/CSS', 'JavaScript', 'Pandas', 'PyAutoGUI'],
impact: [
'Reduced manual ticket creation time by 90%',
'Automated file processing for 100+ jobs weekly',
'Eliminated human errors in repetitive tasks',
'Centralized multiple tools into single platform'
],
architecture: 'Flask web application with threaded background processes, real-time WebSocket communication, and modular tool integration.'
},
'lqa-extension': {
title: 'LQA Tool Extension',
description: 'Chrome extension that enhances the LQA Tool workflow with convenient comment selection and improved user experience.',
features: [
'Select Comment button for quick comment insertion',
'Blurb selection popup for improved workflow efficiency',
'Seamless integration with existing LQA Tool interface',
'Localization support for es-419 language codes',
'Enhanced user interface elements'
],
technologies: ['JavaScript', 'Chrome Extension API', 'HTML/CSS', 'JSON'],
impact: [
'Improved QA workflow efficiency by 40%',
'Reduced comment selection time',
'Enhanced user experience for quality assurance team'
],
architecture: 'Manifest V3 Chrome extension with content scripts and web accessible resources for seamless integration.'
},
'redelivery-agent': {
title: 'Redelivery Agent',
description: 'Web-based tool for processing redelivery Excel files with clean separation of UI and business logic.',
features: [
'Excel file processing with XLSX.js library',
'Multiple file upload and processing',
'Clean separation of UI and business logic',
'Modular JavaScript architecture',
'Export functionality for processed data',
'Requestor alias and intake source management'
],
technologies: ['JavaScript', 'HTML/CSS', 'XLSX.js', 'File API'],
impact: [
'Streamlined redelivery file processing',
'Reduced manual data entry errors',
'Improved data consistency across workflows'
],
architecture: 'Client-side web application with modular JavaScript design and Excel processing capabilities.'
},
'filemaster': {
title: 'FileMaster',
description: 'Python utility for advanced file management and processing operations, streamlining file organization tasks.',
features: [
'Advanced file management operations',
'Batch processing capabilities',
'File organization and sorting',
'Automated file operations',
'Error handling and logging'
],
technologies: ['Python', 'File System APIs', 'OS Module'],
impact: [
'Automated repetitive file operations',
'Improved file organization efficiency',
'Reduced manual file management tasks'
],
architecture: 'Python script with modular functions for various file operations and comprehensive error handling.'
},
'timestamps-converter': {
title: 'TimeStamps Converter',
description: 'Specialized tool for converting and processing timestamp formats in media files, essential for subtitle workflows.',
features: [
'Multiple timestamp format support',
'Batch conversion capabilities',
'Media file timestamp processing',
'Format validation and error checking',
'Subtitle synchronization support'
],
technologies: ['Python', 'Regular Expressions', 'File I/O'],
impact: [
'Automated timestamp conversion processes',
'Improved subtitle synchronization accuracy',
'Reduced manual timestamp editing time'
],
architecture: 'Python utility with regex-based parsing and conversion algorithms for various timestamp formats.'
},
'proxy-generation': {
title: 'Proxy Generation Tool',
description: 'Template for proxy generation processes, including SOPs and Excel template.',
features: [
'Excel template for partner support',
'Standard Operating Procedures (SOPs)',
'Partner support workflow template',
'Process standardization tool'
],
technologies: ['Microsoft Excel', 'Microsoft Word'],
impact: [
'Standardized proxy generation processes',
'Improved partner support efficiency',
'Reduced process variation and errors'
],
architecture: 'System based on standardized template and comprehensive process documentation.'
}
};
// Show localization projects
function showLocalizationProjects() {
const t = window.currentLocaleData || locales.en;
const modalBody = document.getElementById('modal-body');
modalBody.innerHTML = `
<h2>${t['modal.localization.title'] || 'Localization Projects Portfolio'}</h2>
<p class="project-description">${t['modal.localization.description'] || '40+ video game localization projects translated to Italian (it-IT)'}</p>
<h3>${t['modal.localization.vipProjectsTitle'] || 'VIP Projects'}</h3>
<div class="localization-projects">
<div class="project-item vip-project">
<h4>Dragon's Dogma II</h4>
<p><strong>${t['modal.localization.client'] || 'Client'}:</strong> Capcom</p>
<p><strong>${t['modal.localization.genre'] || 'Genre'}:</strong> ${t['modal.localization.dragons.genre'] || 'Fantasy RPG'}</p>
<p><strong>${t['modal.localization.scope'] || 'Scope'}:</strong> ${t['modal.localization.dragons.scope'] || 'Full game localization including dialogue, UI, and narrative elements'}</p>
</div>
<div class="project-item vip-project">
<h4>Super Mario Party Jamboree</h4>
<p><strong>${t['modal.localization.client'] || 'Client'}:</strong> Nintendo</p>
<p><strong>${t['modal.localization.genre'] || 'Genre'}:</strong> ${t['modal.localization.mario.genre'] || 'Party Game'}</p>
<p><strong>${t['modal.localization.scope'] || 'Scope'}:</strong> ${t['modal.localization.mario.scope'] || 'Complete localization with focus on family-friendly content and accessibility'}</p>
</div>
</div>
<h3>${t['modal.localization.additionalTitle'] || 'Additional Projects'}</h3>
<p>${t['modal.localization.additionalText'] || '38+ other video game localization projects across various genres including:'}</p>
<ul class="genre-list">
<li>${t['modal.localization.genre1'] || 'Action/Adventure Games'}</li>
<li>${t['modal.localization.genre2'] || 'Role-Playing Games (RPGs)'}</li>
<li>${t['modal.localization.genre3'] || 'Strategy Games'}</li>
<li>${t['modal.localization.genre4'] || 'Casual/Family Games'}</li>
<li>${t['modal.localization.genre5'] || 'Mobile Games'}</li>
</ul>
<h3>${t['modal.localization.specializationsTitle'] || 'Specializations'}</h3>
<div class="specializations">
<span class="spec-tag">${t['modal.localization.spec1'] || 'Video Game Localization'}</span>
<span class="spec-tag">${t['modal.localization.spec2'] || 'Cultural Adaptation'}</span>
<span class="spec-tag">${t['modal.localization.spec3'] || 'UI/UX Translation'}</span>
<span class="spec-tag">${t['modal.localization.spec4'] || 'Character Dialogue'}</span>
<span class="spec-tag">${t['modal.localization.spec5'] || 'Quality Assurance'}</span>
</div>
`;
const projectModal = document.getElementById('project-modal');
projectModal.classList.add('modal-group-3');
projectModal.classList.remove('modal-group-1');
projectModal.style.display = 'block';
}
// Show project details in modal
function showProjectDetails(projectId) {
const project = projectDetails[projectId];
if (!project) return;
// Helper function to get translation with fallback
const t = (key, fallback) => {
return (window.currentLocaleData && window.currentLocaleData[key]) || fallback;
};
const title = t(`projects.${projectId}.title`, project.title);
const description = t(`projects.${projectId}.description`, project.description);
const features = t(`projects.${projectId}.features`, project.features) || [];
const technologies = t(`projects.${projectId}.technologies`, project.technologies) || [];
const impact = t(`projects.${projectId}.impact`, project.impact) || [];
const architecture = t(`projects.${projectId}.architecture`, project.architecture) || '';
const keyFeaturesHeading = t(`projects.${projectId}.keyFeaturesHeading`, 'Key Features');
const technologiesHeading = t(`projects.${projectId}.technologiesHeading`, 'Technologies Used');
const impactHeading = t(`projects.${projectId}.impactHeading`, 'Impact & Results');
const architectureHeading = t(`projects.${projectId}.architectureHeading`, 'Architecture');
const modalBody = document.getElementById('modal-body');
modalBody.innerHTML = `
<h2>${title}</h2>
<p class="project-description">${description}</p>
<h3>${keyFeaturesHeading}</h3>
<ul class="feature-list">
${features.map(feature => `<li>${feature}</li>`).join('')}
</ul>
<h3>${technologiesHeading}</h3>
<div class="tech-tags">
${technologies.map(tech => `<span class="tech-tag">${tech}</span>`).join('')}
</div>
<h3>${impactHeading}</h3>
<ul class="impact-list">
${impact.map(i => `<li>${i}</li>`).join('')}
</ul>
<h3>${architectureHeading}</h3>
<p class="architecture-description">${architecture}</p>
`;
const projectModal = document.getElementById('project-modal');
projectModal.classList.add('modal-group-1');
projectModal.classList.remove('modal-group-3');
projectModal.style.display = 'block';
document.body.classList.add('modal-open');
document.documentElement.classList.add('modal-open');
}
// Close modal functionality
document.querySelector('.close').addEventListener('click', function () {
const projectModal = document.getElementById('project-modal');
projectModal.classList.remove('modal-group-1', 'modal-group-3');
projectModal.style.display = 'none';
document.body.classList.remove('modal-open');
document.documentElement.classList.remove('modal-open');
});
window.addEventListener('click', function (event) {
const modal = document.getElementById('project-modal');
if (event.target === modal) {
modal.classList.remove('modal-group-1', 'modal-group-3');
modal.style.display = 'none';
document.body.classList.remove('modal-open');
document.documentElement.classList.remove('modal-open');
}
});
// Add some dynamic styling for modal content
const style = document.createElement('style');
style.textContent = `
.project-description {
font-size: 1.1rem;
color: var(--text-light);
margin-bottom: 2rem;
line-height: 1.6;
}
.modal-content h2 {
color: var(--text-secondary);
margin-bottom: 1rem;
font-size: 2rem;
}
.modal-content h3 {
color: var(--text-secondary);
margin: 2rem 0 1rem 0;
font-size: 1.3rem;
}
.feature-list, .impact-list {
margin-bottom: 1.5rem;
padding-left: 1.5rem;
}
.feature-list li, .impact-list li {
margin-bottom: 0.5rem;
color: var(--text-primary);
line-height: 1.5;
}
.tech-tags {
display: flex;
flex-wrap: wrap;
gap: 0.5rem;
margin-bottom: 1.5rem;
}
.tech-tag {
background: var(--chip-bg) !important;
color: var(--chip-text) !important;
border: 1px solid var(--chip-border) !important;
padding: 6px 12px;
border-radius: 15px;
font-size: 0.9rem;
font-weight: 500;
}
.architecture-description {
color: var(--text-light);
line-height: 1.6;
font-style: italic;
}
.localization-projects {
margin-bottom: 2rem;
}
.project-item {
background: var(--card-bg);
padding: 1.5rem;
border-radius: 10px;
margin-bottom: 1rem;
border-left: 4px solid var(--accent-color);
}
.project-item h4 {
color: var(--text-secondary);
margin-bottom: 0.75rem;
font-size: 1.2rem;
}
.project-item p {
margin-bottom: 0.5rem;
color: var(--text-primary);
}
.genre-list {
margin-bottom: 2rem;
padding-left: 1.5rem;
}
.genre-list li {
margin-bottom: 0.5rem;
color: var(--text-primary);
}
.specializations {
display: flex;
flex-wrap: wrap;
gap: 0.5rem;
}
.spec-tag {
background: var(--chip-bg) !important;
color: var(--chip-text) !important;
border: 1px solid var(--chip-border) !important;
padding: 6px 12px;
border-radius: 15px;
font-size: 0.9rem;
font-weight: 500;
}
`;
document.head.appendChild(style);
// Add scroll effect to navbar
window.addEventListener('scroll', function () {
setNavbarStyles();
});
// Profile picture toggle functionality
document.addEventListener('DOMContentLoaded', function () {
const profileImg = document.querySelector('.profile-picture img');
if (profileImg) {
let isColored = false;
profileImg.addEventListener('click', function () {
isColored = !isColored;
this.style.filter = isColored ? 'grayscale(0%)' : 'grayscale(100%)';
});
}
});
// Add animation on scroll for project cards
const observerOptions = {
threshold: 0.1,
rootMargin: '0px 0px -50px 0px'
};
const observer = new IntersectionObserver(function (entries) {
entries.forEach(entry => {
if (entry.isIntersecting) {
entry.target.style.opacity = '1';
entry.target.style.transform = 'translateY(0)';
}
});
}, observerOptions);
// Observe project cards when DOM is loaded
document.addEventListener('DOMContentLoaded', function () {
const projectCards = document.querySelectorAll('.project-card');
projectCards.forEach(card => {
card.style.opacity = '0';
card.style.transform = 'translateY(30px)';
card.style.transition = 'opacity 0.6s ease, transform 0.6s ease';
observer.observe(card);
});
});
// Contact form modal functionality
document.addEventListener('DOMContentLoaded', function () {
const contactFormBtn = document.getElementById('contact-form-btn');
const contactModal = document.getElementById('contact-modal');
const contactModalClose = document.querySelector('.contact-modal-close');
const contactForm = document.getElementById('contact-form');
const formStatus = document.getElementById('form-status');
function getToastContainer() {
let container = document.querySelector('.toast-container');
if (!container) {
container = document.createElement('div');
container.className = 'toast-container';
container.setAttribute('aria-live', 'polite');
container.setAttribute('aria-atomic', 'true');
document.body.appendChild(container);
}
return container;
}
function showToast(message, type) {
const container = getToastContainer();
const toast = document.createElement('div');
const toastType = type === 'error' ? 'error' : 'success';
const iconText = toastType === 'error' ? '!' : 'OK';
toast.className = `toast toast-${toastType}`;
toast.setAttribute('role', toastType === 'error' ? 'alert' : 'status');
toast.innerHTML = `
<span class="toast-icon" aria-hidden="true">${iconText}</span>
<span class="toast-message">${message}</span>
<button class="toast-close" type="button" aria-label="Dismiss notification">x</button>
`;
container.appendChild(toast);
requestAnimationFrame(() => toast.classList.add('is-visible'));
const closeBtn = toast.querySelector('.toast-close');
const removeToast = () => {
toast.classList.remove('is-visible');
toast.addEventListener('transitionend', () => toast.remove(), { once: true });
};
const timer = setTimeout(removeToast, 4500);
closeBtn.addEventListener('click', () => {
clearTimeout(timer);
removeToast();