Added About Page

This commit is contained in:
2025-09-17 23:34:37 +10:00
parent 2f6006626d
commit b9e1f6827a
30 changed files with 1270 additions and 529 deletions

View File

@@ -28,57 +28,4 @@ defineOptions({
layout: AppLayout
})
// Types
const initSmoothScrolling = (): void => {
const navLinks = document.querySelectorAll('a[href^="#"]') as NodeListOf<HTMLAnchorElement>;
navLinks.forEach((link: HTMLAnchorElement) => {
link.addEventListener('click', (e: Event) => {
e.preventDefault();
const targetId = link.getAttribute('href');
const targetElement = targetId ? document.querySelector(targetId) as HTMLElement | null : null;
if (targetElement) {
const header = document.querySelector('.header') as HTMLElement | null;
const headerHeight = header ? header.offsetHeight : 0;
const targetPosition = targetElement.offsetTop - headerHeight;
window.scrollTo({
top: targetPosition,
behavior: 'smooth'
});
// Close dropdown if open
const dropdown = document.querySelector('.dropdown') as HTMLElement | null;
if (dropdown) {
dropdown.classList.remove('open');
}
}
});
});
};
// Initialize all functionality when DOM is loaded
onMounted(() => {
initSmoothScrolling();
});
// Add performance optimization
const debounce = <T extends (...args: any[]) => void>(func: T, wait: number): T => {
let timeout: number | undefined;
return ((...args: Parameters<T>) => {
const later = () => {
clearTimeout(timeout);
func(...args);
};
clearTimeout(timeout);
timeout = setTimeout(later, wait);
}) as T;
};
// Optimize scroll events
window.addEventListener('scroll', debounce(() => {
// Scroll-based animations can be added here
}, 16)); // ~60fps
</script>