feat: added home-button to docs
This commit is contained in:
@@ -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
31
docs/js/home_button.js
Normal 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);
|
||||
});
|
||||
Reference in New Issue
Block a user