mirror of
https://github.com/BreizhHardware/lefrenchmathproject.git
synced 2026-01-18 16:37:32 +01:00
Add backButton
This commit is contained in:
@@ -168,6 +168,22 @@
|
||||
color: #ccc;
|
||||
}
|
||||
|
||||
.back-button {
|
||||
display: block;
|
||||
margin: 20px auto;
|
||||
padding: 10px 20px;
|
||||
background-color: #007BFF;
|
||||
color: white;
|
||||
border: none;
|
||||
cursor: pointer;
|
||||
border-radius: 5px;
|
||||
text-align: center;
|
||||
}
|
||||
|
||||
.back-button:hover {
|
||||
background-color: #0056b3;
|
||||
}
|
||||
|
||||
/* Styles existants */
|
||||
.site-title, .site-title:visited {
|
||||
color: #424242;
|
||||
@@ -204,6 +220,7 @@
|
||||
<nav>
|
||||
<ul id="toc"></ul>
|
||||
</nav>
|
||||
<button id="back-button" class="back-button">Retour</button>
|
||||
</div>
|
||||
<button class="toc-toggle-button">T</button>
|
||||
|
||||
@@ -288,6 +305,14 @@
|
||||
// Set the initial button text based on the current theme
|
||||
toggleButton.textContent = currentTheme === "light" ? "🌙" : "☀️";
|
||||
});
|
||||
|
||||
document.addEventListener("DOMContentLoaded", function () {
|
||||
const backButton = document.getElementById("back-button");
|
||||
|
||||
backButton.addEventListener("click", function () {
|
||||
window.history.back();
|
||||
});
|
||||
});
|
||||
</script>
|
||||
|
||||
</body>
|
||||
|
||||
Reference in New Issue
Block a user