diff --git a/docs/book.toml b/docs/book.toml index d2d69ba..875f3d9 100644 --- a/docs/book.toml +++ b/docs/book.toml @@ -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 = "/" \ No newline at end of file +git-repository-url = "https://github.com/Ewwii-sh/ewwii" +site-url = "/" +additional-js = ["js/home_button.js"] \ No newline at end of file diff --git a/docs/js/home_button.js b/docs/js/home_button.js new file mode 100644 index 0000000..8a3b76c --- /dev/null +++ b/docs/js/home_button.js @@ -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); +});