Used AI to change project to blazor webassembly.

This commit is contained in:
2026-08-10 14:49:01 +02:00
parent 218dbe36d9
commit e1053844c0
1117 changed files with 6441 additions and 749 deletions

View File

@@ -0,0 +1,59 @@
let dotNetObject;
let observer;
let sections;
export function initialize(dotNetHelper) {
dotNetObject = dotNetHelper;
// Setup IntersectionObserver for navigation highlighting
setupIntersectionObserver();
// Setup click handlers for navigation
setupNavigationClickObserver();
}
function setupIntersectionObserver() {
const observer = new IntersectionObserver((entries) => {
entries.forEach(entry => {
if (entry.isIntersecting) {
const sectionId = entry.target.id;
dotNetObject.invokeMethodAsync('HandleSectionChange', sectionId);
}
});
}, {
threshold: 0.5
});
sections = document.querySelectorAll('.scroll_section');
sections.forEach(section => {
observer.observe(section);
});
}
function setupNavigationClickObserver() {
const navLinks = document.querySelectorAll('.nav_option');
navLinks.forEach(link => {
link.addEventListener('click', (event) => {
event.preventDefault();
const targetId = link.getAttribute('href');
scrollToSection(targetId.substring(1));
});
});
}
export function scrollToSection(sectionId) {
const targetSection = document.getElementById(sectionId);
if (targetSection) {
targetSection.scrollIntoView({
behavior: 'smooth'
});
}
}
export function dispose() {
if (observer) {
sections.forEach(section => {
observer.unobserve(section);
});
}
}