Suppression de la flêche pour remonter en haut de la page

This commit is contained in:
Stanislas Jouffroy 2025-03-24 20:42:06 +01:00
parent 3e173c0e7b
commit 82e06133b3
8 changed files with 28 additions and 53 deletions

View file

@ -1,22 +0,0 @@
(function() {
document.addEventListener('DOMContentLoaded', function(){
const targetElements = document.querySelector('main').querySelectorAll('h1, h2, h3, h4, h5, h6');
targetElements.forEach(( el ) => {
if (el.id) {
const headerlink = document.createElement('a');
headerlink.setAttribute('class', 'headerlink');
headerlink.setAttribute('href', '#' + el.id);
headerlink.setAttribute('title', 'Permalink to this headline');
const icon = document.createElement('i');
icon.setAttribute('class', 'fas fa-hashtag');
icon.setAttribute('aria-hidden', 'true');
headerlink.append(icon);
el.append(headerlink);
}
});
});
})();

View file

@ -1,18 +0,0 @@
(function() {
document.addEventListener('DOMContentLoaded', function(){
const nav_prev = document.querySelector('.nav-prev');
const nav_next = document.querySelector('.nav-next');
// prev links - left arrow key
document.addEventListener( 'keydown', event => {
if (nav_prev && event.key === 'ArrowLeft') {
location.href = nav_prev.getAttribute('href');
}
// next links - right arrow key
if (nav_next && event.key === 'ArrowRight') {
location.href = nav_next.getAttribute('href');
}
});
});
})();

View file

@ -1,4 +1,2 @@
require( './sidebar-menu.js' );
require( './keydown-nav.js' );
require( './headerlink.js' );
require( './code.js' );

View file

@ -200,10 +200,6 @@ figure > figcaption {
background: variable.$sidebar-active-color;
}
.backtothetop {
display: none;
font-size: 200%;
}
.fa-layers .fa-circle {
color: #fff;
}