figures simples + outdoor computer club
This commit is contained in:
parent
76dc174fca
commit
868a5b702c
18 changed files with 531 additions and 352 deletions
|
|
@ -3,9 +3,27 @@ window.onload = function(){
|
|||
};
|
||||
|
||||
|
||||
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);
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
function init(){
|
||||
let fadeEl = document.getElementById('fade');
|
||||
if (fadeEl) {
|
||||
fadeEl.classList.add('loaded');
|
||||
}
|
||||
addHeadingIds(document);
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue