Rehacer la web con Hugo: nuevo diseño, blog integrado y página del 29N
This commit is contained in:
parent
5d229667f0
commit
e75c923f90
59 changed files with 1262 additions and 1352 deletions
13
assets/js/main.js
Normal file
13
assets/js/main.js
Normal file
|
|
@ -0,0 +1,13 @@
|
|||
// Resalta en el índice de la ideología el principio que se está leyendo. Sin dependencias.
|
||||
(() => {
|
||||
const enlaces = document.querySelectorAll('.indice a');
|
||||
if (enlaces.length && 'IntersectionObserver' in window) {
|
||||
const obs = new IntersectionObserver(entradas => {
|
||||
entradas.forEach(en => {
|
||||
if (!en.isIntersecting) return;
|
||||
enlaces.forEach(a => a.classList.toggle('activo', a.hash === '#' + en.target.id));
|
||||
});
|
||||
}, { rootMargin: '-30% 0px -60% 0px' });
|
||||
document.querySelectorAll('.principio').forEach(p => obs.observe(p));
|
||||
}
|
||||
})();
|
||||
Loading…
Add table
Add a link
Reference in a new issue