2026-01-05 19:33:15 +01:00
|
|
|
window.onload = function(){
|
|
|
|
|
init();
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
2026-04-11 17:49:46 +02:00
|
|
|
function slugify(text) {
|
|
|
|
|
return text.trim()
|
|
|
|
|
.toLowerCase()
|
|
|
|
|
.normalize('NFD').replace(/[\u0300-\u036f]/g, '')
|
|
|
|
|
.replace(/[^a-z0-9\s-]/g, '')
|
|
|
|
|
.replace(/\s+/g, '-')
|
|
|
|
|
.replace(/-+/g, '-');
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
function addHeadingIds(root) {
|
|
|
|
|
root.querySelectorAll('h3, h4').forEach(heading => {
|
|
|
|
|
if (!heading.id) {
|
|
|
|
|
heading.id = slugify(heading.textContent);
|
|
|
|
|
}
|
|
|
|
|
});
|
|
|
|
|
}
|
|
|
|
|
|
2026-01-05 19:33:15 +01:00
|
|
|
function init(){
|
|
|
|
|
let fadeEl = document.getElementById('fade');
|
|
|
|
|
if (fadeEl) {
|
|
|
|
|
fadeEl.classList.add('loaded');
|
|
|
|
|
}
|
2026-04-11 17:49:46 +02:00
|
|
|
addHeadingIds(document);
|
2026-01-05 19:33:15 +01:00
|
|
|
}
|