chore: cleanup

This commit is contained in:
Cory Dransfeldt 2024-10-30 18:44:57 -07:00
parent 6ef59b5818
commit f27baa0ce7
No known key found for this signature in database
7 changed files with 39 additions and 35 deletions

View file

@ -83,7 +83,6 @@ export default async function (eleventyConfig) {
if (path && path.endsWith(".html")) {
return htmlmin.minify(content, {
collapseBooleanAttributes: true,
collapseWhitespace: true,
decodeEntities: true,
includeAutoGeneratedTags: false,
minifyCSS: true,

4
package-lock.json generated
View file

@ -1,12 +1,12 @@
{
"name": "coryd.dev",
"version": "2.4.4",
"version": "2.4.5",
"lockfileVersion": 3,
"requires": true,
"packages": {
"": {
"name": "coryd.dev",
"version": "2.4.4",
"version": "2.4.5",
"license": "MIT",
"dependencies": {
"@11ty/eleventy-fetch": "4.0.1",

View file

@ -1,6 +1,6 @@
{
"name": "coryd.dev",
"version": "2.4.4",
"version": "2.4.5",
"description": "The source for my personal site. Built using 11ty (and other tools).",
"type": "module",
"engines": {

View file

@ -28,6 +28,9 @@ menu {
& a {
text-decoration: none;
width: 100%;
height: 100%;
justify-content: center;
}
& .icon > svg,

View file

@ -59,10 +59,10 @@
--error: light-dark(#b81f1f, #ff8b8b);
--favorite: light-dark(#b03c72, #ff9ccd);
--link: light-dark(#7b5cba, #e2b8ff);
--music: light-dark(#1565c3, #99ccff);
--music: light-dark(#3d7099, #76b8cc);
--newsletter: light-dark(#37b0b0, #91fffa);
--now: light-dark(#cc1076, #ff82d5);
--search: light-dark(#3a6b94, #a0b8d9);
--search: light-dark(#6b5e3a, #c0b594);
--tattoo: light-dark(#951b1b, #ff7373);
--tv: light-dark(#cc3600, #ff8f66);
--warning: light-dark(#cc6f00, #ffbf66);

View file

@ -5,7 +5,7 @@
storage="local"
transition-duration="10ms"
>
<span class="loading client-side">&nbsp;{{ nowPlaying }}</span>
<span class="loading client-side">{{ nowPlaying }}</span>
<span class="content"></span>
<noscript>
<span>{{ nowPlaying }}</span>

View file

@ -48,38 +48,40 @@
</head>
<body>
<script>
(() => {
const storageType =
document.querySelector("theme-toggle")?.getAttribute("storage") === "local"
? localStorage
: sessionStorage;
window.addEventListener("load", () => {
(() => {
const storageType =
document.querySelector("theme-toggle")?.getAttribute("storage") === "local"
? localStorage
: sessionStorage;
const currentTheme = storageType.getItem("theme") || "auto";
const metaColorScheme = document.querySelector('meta[name="color-scheme"]');
const lightIcon = document.querySelector(".light");
const darkIcon = document.querySelector(".dark");
const autoIcon = document.querySelector(".auto");
const currentTheme = storageType.getItem("theme") || "auto";
const metaColorScheme = document.querySelector('meta[name="color-scheme"]');
const lightIcon = document.querySelector(".light");
const darkIcon = document.querySelector(".dark");
const autoIcon = document.querySelector(".auto");
if (currentTheme === "auto") {
metaColorScheme.setAttribute("content", "light dark");
document.documentElement.style.colorScheme = "";
} else {
metaColorScheme.setAttribute("content", currentTheme);
document.documentElement.style.colorScheme = currentTheme;
}
if (currentTheme === "auto") {
metaColorScheme.setAttribute("content", "light dark");
document.documentElement.style.colorScheme = "";
} else {
metaColorScheme.setAttribute("content", currentTheme);
document.documentElement.style.colorScheme = currentTheme;
}
lightIcon.style.display = "none";
darkIcon.style.display = "none";
autoIcon.style.display = "none";
lightIcon.style.display = "none";
darkIcon.style.display = "none";
autoIcon.style.display = "none";
if (currentTheme === "light") {
lightIcon.style.display = "inline";
} else if (currentTheme === "dark") {
darkIcon.style.display = "inline";
} else {
autoIcon.style.display = "inline";
}
})();
if (currentTheme === "light") {
lightIcon.style.display = "inline";
} else if (currentTheme === "dark") {
darkIcon.style.display = "inline";
} else {
autoIcon.style.display = "inline";
}
})();
});
</script>
<div class="main-wrapper">
<main>