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

@ -0,0 +1,26 @@
<!DOCTYPE html>
{{ with .Site.LanguageCode }}<html lang="{{ . }}">{{ else }}<html>{{ end }}
<head>
{{- partial "head.html" . -}}
{{- partial "custom-head.html" . -}}
</head>
<body>
{{- partial "prepend-body.html" . -}}
<div class="container">
{{- partial "notification.html" . -}}
{{- partial "site-header.html" . -}}
{{- partial "global-menu.html" . -}}
<div class="content-container">
<main>
{{- block "main" . -}}{{- end -}}
<footer>
{{- partial "content-footer.html" . -}}
{{- partial "powered.html" . -}}
</footer>
</main>
{{- partial "sidebar.html" . -}}
</div>
</div>
</body>
</html>

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( './sidebar-menu.js' );
require( './keydown-nav.js' );
require( './headerlink.js' );
require( './code.js' ); require( './code.js' );

View file

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

View file

@ -949,11 +949,6 @@ main:only-child {
background: #eee; background: #eee;
} }
.backtothetop {
display: none;
font-size: 200%;
}
.fa-layers .fa-circle { .fa-layers .fa-circle {
color: #fff; color: #fff;
} }

File diff suppressed because one or more lines are too long

View file

@ -1 +1 @@
!function(){var e={127:function(){document.addEventListener("DOMContentLoaded",(function(){var e=document.querySelector(".nav-prev"),t=document.querySelector(".nav-next");document.addEventListener("keydown",(function(n){e&&"ArrowLeft"===n.key&&(location.href=e.getAttribute("href")),t&&"ArrowRight"===n.key&&(location.href=t.getAttribute("href"))}))}))},219:function(){!function(){function e(e){e.currentTarget.setAttribute("class","copy-btn copy"),e.currentTarget.setAttribute("aria-label","Copy this code.")}window.onload=function(){new ClipboardJS(".copy",{target:function(e){return e.nextElementSibling}}).on("success",(function(e){!function(e){e.setAttribute("class","copy-btn copy tooltipped"),e.setAttribute("aria-label","Copied!")}(e.trigger),e.clearSelection()})).on("error",(function(e){console.error("Action:",e.action),console.error("Trigger:",e.trigger)}))},document.addEventListener("DOMContentLoaded",(function(){document.querySelectorAll(".copy").forEach((function(t){t.addEventListener("animationend",e)}))}))}()},447:function(){document.addEventListener("DOMContentLoaded",(function(){document.querySelector("main").querySelectorAll("h1, h2, h3, h4, h5, h6").forEach((function(e){if(e.id){var t=document.createElement("a");t.setAttribute("class","headerlink"),t.setAttribute("href","#"+e.id),t.setAttribute("title","Permalink to this headline");var n=document.createElement("i");n.setAttribute("class","fas fa-hashtag"),n.setAttribute("aria-hidden","true"),t.append(n),e.append(t)}}))}))},738:function(){document.addEventListener("DOMContentLoaded",(function(){document.querySelector(".slide-menu").addEventListener("click",(function(e){var t=e.target;if(t.classList.contains("mark")){e.preventDefault();var n=t.parentNode.parentNode.querySelector(".sub-menu"),r="";"-"===t.innerHTML&&(r="+",n.style.display="none"),"+"===t.innerHTML&&(r="-",n.style.display="unset"),t.innerHTML=r}}))}))}},t={};function n(r){var o=t[r];if(void 0!==o)return o.exports;var i=t[r]={exports:{}};return e[r](i,i.exports,n),i.exports}n(738),n(127),n(447),n(219)}(); !function(){var e={219:function(){!function(){function e(e){e.currentTarget.setAttribute("class","copy-btn copy"),e.currentTarget.setAttribute("aria-label","Copy this code.")}window.onload=function(){new ClipboardJS(".copy",{target:function(e){return e.nextElementSibling}}).on("success",(function(e){!function(e){e.setAttribute("class","copy-btn copy tooltipped"),e.setAttribute("aria-label","Copied!")}(e.trigger),e.clearSelection()})).on("error",(function(e){console.error("Action:",e.action),console.error("Trigger:",e.trigger)}))},document.addEventListener("DOMContentLoaded",(function(){document.querySelectorAll(".copy").forEach((function(t){t.addEventListener("animationend",e)}))}))}()},738:function(){document.addEventListener("DOMContentLoaded",(function(){document.querySelector(".slide-menu").addEventListener("click",(function(e){var t=e.target;if(t.classList.contains("mark")){e.preventDefault();var n=t.parentNode.parentNode.querySelector(".sub-menu"),o="";"-"===t.innerHTML&&(o="+",n.style.display="none"),"+"===t.innerHTML&&(o="-",n.style.display="unset"),t.innerHTML=o}}))}))}},t={};function n(o){var r=t[o];if(void 0!==r)return r.exports;var i=t[o]={exports:{}};return e[o](i,i.exports,n),i.exports}n(738),n(219)}();