Added Custom JS and CSS
All checks were successful
Build and Deploy Documentation / build-and-deploy (push) Successful in 5s
All checks were successful
Build and Deploy Documentation / build-and-deploy (push) Successful in 5s
This commit is contained in:
@@ -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
7
overrides/main.html
Normal 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 %}
|
||||
@@ -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;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user