Added Custom JS and CSS
All checks were successful
Build and Deploy Documentation / build-and-deploy (push) Successful in 5s

This commit is contained in:
Noah Pombas
2025-12-04 16:08:11 +01:00
parent 2c6f7d5987
commit cfae4ed243
3 changed files with 21 additions and 5 deletions

View File

@@ -7,8 +7,7 @@ function switchColor() {
document.documentElement.setAttribute("data-md-color-scheme", color);
}
// Botão no topo do site
const btn = document.createElement("button");
btn.textContent = "Switch Color";
btn.onclick = switchColor;
document.body.prepend(btn);
window.addEventListener("DOMContentLoaded", () => {
const btn = document.getElementById("color-toggle-btn");
if (btn) btn.onclick = switchColor;
});

7
overrides/main.html Normal file
View File

@@ -0,0 +1,7 @@
{% extends "base.html" %}
{% block header %}
{{ super() }}
<!-- Botão de trocar cor -->
<button id="color-toggle-btn">🎨 Switch Color</button>
{% endblock %}

View File

@@ -12,3 +12,13 @@
--md-primary-fg-color: #2ecc71;
--md-accent-fg-color: #2ecc71;
}
#color-toggle-btn {
margin-left: 1rem;
padding: 4px 10px;
font-size: 0.9rem;
border-radius: 5px;
border: 1px solid #ccc;
background: #fff;
cursor: pointer;
}