Skip to content

Commit

Permalink
⚙️ FEATURE-#27: Update
Browse files Browse the repository at this point in the history
  • Loading branch information
FernandoCelmer committed Aug 20, 2023
1 parent 69307bb commit f0eb85c
Show file tree
Hide file tree
Showing 6 changed files with 881 additions and 6 deletions.
Empty file.
96 changes: 95 additions & 1 deletion mkdocs_simple_blog/assets/js/theme.js
Original file line number Diff line number Diff line change
@@ -1 +1,95 @@
document.addEventListener("DOMContentLoaded",function(){window.innerWidth<992&&(document.querySelectorAll(".navbar .dropdown").forEach(function(t){t.addEventListener("hidden.bs.dropdown",function(){this.querySelectorAll(".submenu").forEach(function(t){t.style.display="none"})})}),document.querySelectorAll(".dropdown-menu a").forEach(function(t){t.addEventListener("click",function(t){let e=this.nextElementSibling;e&&e.classList.contains("submenu")&&(t.preventDefault(),"block"==e.style.display?(e.style.display="none"):(e.style.display="block"))})}));let t={dark:{"--text":"white","--title":"white","--primary":"white","--background":"black"},light:{"--text":"black","--title":"black","--primary":"black","--background":"white"}};[...document.querySelectorAll(".color-button")].forEach((e)=>{e.addEventListener("click",()=>{let n=t[e.dataset.theme];for(var r in n)document.documentElement.style.setProperty(r,n[r]);})});var e=document.querySelectorAll("button[color-primary]");e.forEach(function(t){t.addEventListener("click",function(){var t=this.getAttribute("color-primary");document.documentElement.style.setProperty("--primary",t)})});var e=document.querySelectorAll("button[color-text]");e.forEach(function(t){t.addEventListener("click",function(){var t=this.getAttribute("color-text");document.documentElement.style.setProperty("--text",t)})});var e=document.querySelectorAll("button[color-title]");e.forEach(function(t){t.addEventListener("click",function(){var t=this.getAttribute("color-title");document.documentElement.style.setProperty("--title",t)})});var e=document.querySelectorAll("button[color-background]");e.forEach(function(t){t.addEventListener("click",function(){var t=this.getAttribute("color-background");document.documentElement.style.setProperty("--background",t)})});var e=document.querySelectorAll("button[style-site-name]");e.forEach(function(t){t.addEventListener("click",function(){var t=this.getAttribute("style-site-name");(title=document.getElementById("component-site-name").classList).remove("bold"),title.remove("italic"),title.remove("scratched"),title.remove("underline"),title.remove("overline"),title.add(t)})});var e=document.querySelectorAll("button[style-title]");e.forEach(function(t){t.addEventListener("click",function(){var t=this.getAttribute("style-title");(title=document.getElementById("component-title").classList).remove("bold"),title.remove("italic"),title.remove("scratched"),title.remove("underline"),title.remove("overline"),title.add(t)})});var e=document.querySelectorAll("button[component-id]");e.forEach(function(t){t.addEventListener("click",function(){var t=this.getAttribute("component-id"),e=this.getAttribute("status");document.getElementById(t).hidden=JSON.parse(e)})})})
document.addEventListener("DOMContentLoaded", function () {

window.innerWidth < 992 &&
(document.querySelectorAll(".navbar .dropdown").forEach(function (t) {
t.addEventListener("hidden.bs.dropdown", function () {
this.querySelectorAll(".submenu").forEach(function (t) {
t.style.display = "none";
});
});
}),
document.querySelectorAll(".dropdown-menu a").forEach(function (t) {
t.addEventListener("click", function (t) {
let e = this.nextElementSibling;
e && e.classList.contains("submenu") && (t.preventDefault(), "block" == e.style.display ? (e.style.display = "none") : (e.style.display = "block"));
});
}));

let t = {
dark: {
"--text": "white",
"--title": "white",
"--primary": "white",
"--background": "black"
},
light: {
"--text": "black",
"--title": "black",
"--primary": "black",
"--background": "white"
}
};
[...document.querySelectorAll(".color-button")].forEach((e) => {
e.addEventListener("click", () => {
let n = t[e.dataset.theme];
for (var r in n) document.documentElement.style.setProperty(r, n[r]);
});
});

var e = document.querySelectorAll("button[color-primary]");
e.forEach(function (t) {
t.addEventListener("click", function () {
var t = this.getAttribute("color-primary");
document.documentElement.style.setProperty("--primary", t);
});
});

var e = document.querySelectorAll("button[color-text]");
e.forEach(function (t) {
t.addEventListener("click", function () {
var t = this.getAttribute("color-text");
document.documentElement.style.setProperty("--text", t);
});
});

var e = document.querySelectorAll("button[color-title]");
e.forEach(function (t) {
t.addEventListener("click", function () {
var t = this.getAttribute("color-title");
document.documentElement.style.setProperty("--title", t);
});
});

var e = document.querySelectorAll("button[color-background]");
e.forEach(function (t) {
t.addEventListener("click", function () {
var t = this.getAttribute("color-background");
document.documentElement.style.setProperty("--background", t);
});
});

var e = document.querySelectorAll("button[style-site-name]");
e.forEach(function (t) {
t.addEventListener("click", function () {
var t = this.getAttribute("style-site-name");
(title = document.getElementById("component-site-name").classList).remove("bold"), title.remove("italic"), title.remove("scratched"), title.remove("underline"), title.remove("overline"), title.add(t);
});
});

var e = document.querySelectorAll("button[style-title]");
e.forEach(function (t) {
t.addEventListener("click", function () {
var t = this.getAttribute("style-title");
(title = document.getElementById("component-title").classList).remove("bold"), title.remove("italic"), title.remove("scratched"), title.remove("underline"), title.remove("overline"), title.add(t);
});
});

var e = document.querySelectorAll("button[component-id]");
e.forEach(function (t) {
t.addEventListener("click", function () {
var t = this.getAttribute("component-id"),
e = this.getAttribute("status");
document.getElementById(t).hidden = JSON.parse(e);
});
});
});
Empty file.
103 changes: 102 additions & 1 deletion mkdocs_simple_blog/assets/stylesheets/styles.css
Original file line number Diff line number Diff line change
@@ -1 +1,102 @@
:root{--text:#000;--title:#000;--primary:#000;--background:#fff;--color-black:#000;--color-white:#fff;--color-blue:#4051b5;--color-green:#4cae4f;--color-yellow:#f1dc15;--color-orange:#ffa724;--color-purple:#ab47bd;--color-red:#ff2c06}body{color:var(--text);background-color:var(--background)}small{color:var(--text)}code{background-color:var(--primary);color:var(--background)!important}pre{background-color:var(--primary)}a{color:var(--text)!important;text-decoration:underline}a:focus,a:hover{color:var(--primary)!important;text-decoration:underline}p{color:var(--text)}p a{font-weight:400;color:var(--primary);text-decoration:underline;text-underline-position:under}p a:focus,p a:hover{color:var(--primary)}h1,h2,h3,h4,h5,h6{color:var(--title);letter-spacing:.0625em;margin:3.2rem 0 1.6rem 0}blockquote{border-left:2px solid #dcdcdc}table td,table th{border:2px solid var(--primary)}.title-color{color:var(--title)}.dropdown-menu{color:var(--background);background-color:var(--background);border-color:var(--primary)}.dropdown-item.active,.dropdown-item:active,.dropdown-item:hover{color:var(--background)!important;background-color:var(--primary)!important}@media only screen and (max-width:1200px){.source-detail{border-color:var(--primary)}}
:root {
--text: #000;
--title: #000;
--primary: #000;
--background: #fff;
--color-black: #000;
--color-white: #fff;
--color-blue: #4051b5;
--color-green: #4cae4f;
--color-yellow: #f1dc15;
--color-orange: #ffa724;
--color-purple: #ab47bd;
--color-red: #ff2c06;
}

body {
color: var(--text);
background-color: var(--background);
}

small {
color: var(--text);
}

code {
background-color: var(--primary);
color: var(--background) !important;
}

pre {
background-color: var(--primary);
}

a {
color: var(--text) !important;
text-decoration: underline;
}

a:focus,
a:hover {
color: var(--primary) !important;
text-decoration: underline;
}

p {
color: var(--text);
}

p a {
font-weight: 400;
color: var(--primary);
text-decoration: underline;
text-underline-position: under;
}

p a:focus,
p a:hover {
color: var(--primary);
}

h1,
h2,
h3,
h4,
h5,
h6 {
color: var(--title);
letter-spacing: 0.0625em;
margin: 3.2rem 0 1.6rem 0;
}

blockquote {
border-left: 2px solid #dcdcdc;
}

table td,
table th {
border: 2px solid var(--primary);
}

.title-color {
color: var(--title);
}

.dropdown-menu {
color: var(--background);
background-color: var(--background);
border-color: var(--primary);
}

.dropdown-item.active,
.dropdown-item:active,
.dropdown-item:hover {
color: var(--background) !important;
background-color: var(--primary) !important;
}

@media only screen and (max-width: 1200px) {
.source-detail {
border-color: var(--primary);
}
}
Loading

0 comments on commit f0eb85c

Please sign in to comment.