From 9d3c194216acea80472785e320479e75e5b4f5c0 Mon Sep 17 00:00:00 2001
From: Fuwn <contact@fuwn.me>
Date: Tue, 5 Dec 2023 18:08:43 -0800
Subject: feat(settings): live mai toggle

---
 src/routes/settings/+page.svelte | 11 +++++++++++
 1 file changed, 11 insertions(+)

(limited to 'src/routes/settings/+page.svelte')

diff --git a/src/routes/settings/+page.svelte b/src/routes/settings/+page.svelte
index 269fe340..4d339c4d 100644
--- a/src/routes/settings/+page.svelte
+++ b/src/routes/settings/+page.svelte
@@ -105,6 +105,17 @@
 		<SettingCheckboxToggle
 			setting="displayMai"
 			text={`Display <a href="https://anilist.co/character/127222/Mai-Sakurajima">Mai</a>`}
+			onChange={() => {
+				const mai = document.getElementById('mai');
+
+				if (!mai) return;
+
+				if ($settings.displayMai) {
+					mai.style.display = 'block';
+				} else {
+					mai.style.display = 'none';
+				}
+			}}
 		>
 			<SettingHint lineBreak>Let her remind you. It's for your own benefit.</SettingHint>
 		</SettingCheckboxToggle>
-- 
cgit v1.2.3

