feat: added home-button to docs

This commit is contained in:
Byson94
2025-08-16 12:46:23 +05:30
parent c977b0fd46
commit c9cbc606e4
2 changed files with 34 additions and 2 deletions

View File

@@ -7,5 +7,6 @@ title = "Ewii documentation"
[output.html]
default-theme = "navy"
git-repository-url = "https://github.com/byson94/ewwii/tree/master/docs"
site-url = "/"
git-repository-url = "https://github.com/Ewwii-sh/ewwii"
site-url = "/"
additional-js = ["js/home_button.js"]

31
docs/js/home_button.js Normal file
View File

@@ -0,0 +1,31 @@
document.addEventListener("DOMContentLoaded", function () {
const homeBtn = document.createElement("a");
homeBtn.href = "https://ewwii-sh.github.io/";
homeBtn.innerText = "🏠︎";
homeBtn.className = "home-button";
homeBtn.style.padding = "6px";
homeBtn.style.backgroundColor = "transparent";
homeBtn.style.color = "grey";
homeBtn.style.borderRadius = "4px";
homeBtn.style.textDecoration = "none";
homeBtn.style.display = "inline-flex";
homeBtn.style.alignItems = "center";
homeBtn.style.justifyContent = "center";
homeBtn.style.transition = "all 0.2s ease";
// Hover effect
homeBtn.addEventListener("mouseover", () => {
homeBtn.style.color = "#bbbbbb";
homeBtn.style.transform = "scale(1.01)";
});
homeBtn.addEventListener("mouseout", () => {
homeBtn.style.backgroundColor = "transparent";
homeBtn.style.color = "grey";
homeBtn.style.transform = "scale(1)";
});
const header = document.querySelector(".right-buttons");
if (header) header.appendChild(homeBtn);
});