aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorFuwn <[email protected]>2023-12-05 16:02:11 -0800
committerFuwn <[email protected]>2023-12-05 16:02:11 -0800
commit33ff9a55922beb76105ba17c06c9711817ba8528 (patch)
treeb9c7d0b2f4c6e71f9e5729cf8bf250ce23c79b01
parentfeat(layout): mai (diff)
downloaddue.moe-33ff9a55922beb76105ba17c06c9711817ba8528.tar.xz
due.moe-33ff9a55922beb76105ba17c06c9711817ba8528.zip
feat(html): better mai hiding
-rw-r--r--src/app.html18
-rw-r--r--src/routes/+layout.svelte12
2 files changed, 18 insertions, 12 deletions
diff --git a/src/app.html b/src/app.html
index a7655851..7b7dad8d 100644
--- a/src/app.html
+++ b/src/app.html
@@ -75,6 +75,14 @@
document.getElementById('hover-header').style.display = 'none'
}
})
+
+ document.addEventListener('DOMContentLoaded', () => {
+ if (JSON.parse(localStorage.getItem("settings")).displayMai === true) {
+ document.getElementById('mai').style.display = 'block'
+ } else {
+ document.getElementById('mai').style.display = 'none'
+ }
+ })
</script>
<style>
@@ -99,6 +107,14 @@
filter: invert(1) hue-rotate(180deg);
}
}
+
+ #mai {
+ position: fixed;
+ left: 0;
+ bottom: 0;
+ height: auto;
+ width: 10vh;
+ }
</style>
%sveltekit.head%
@@ -106,6 +122,8 @@
<body data-sveltekit-preload-data="hover" style="max-width: 90% !important">
<div style="display: contents">%sveltekit.body%</div>
+
+ <img src="mai.png" alt="Mai Sakurajima" id="mai" />
</body>
</html> \ No newline at end of file
diff --git a/src/routes/+layout.svelte b/src/routes/+layout.svelte
index 8de5b2de..95c7c678 100644
--- a/src/routes/+layout.svelte
+++ b/src/routes/+layout.svelte
@@ -94,10 +94,6 @@
<slot />
</div>
-{#if $settings.displayMai}
- <img src="mai.png" alt="Mai Sakurajima" id="mai" />
-{/if}
-
<style>
:global(html.light-theme) {
filter: invert(0);
@@ -143,12 +139,4 @@
#hover-header:hover {
opacity: 1;
}
-
- #mai {
- position: fixed;
- left: 0;
- bottom: 0;
- height: auto;
- width: 10vh;
- }
</style>