From fef162aabb5d9cca161a269009bad394f8b9b9a6 Mon Sep 17 00:00:00 2001 From: Fuwn Date: Mon, 23 Jun 2025 01:09:20 -0700 Subject: feat(settings): Custom CSS --- src/app.html | 17 ++++++++++++++++- 1 file changed, 16 insertions(+), 1 deletion(-) (limited to 'src/app.html') diff --git a/src/app.html b/src/app.html index 6e3a5db3..9f318135 100644 --- a/src/app.html +++ b/src/app.html @@ -84,8 +84,23 @@ document.addEventListener('DOMContentLoaded', () => { const mai = document.getElementById('mai'); + const settings = JSON.parse(localStorage.getItem('settings')); + const customCSS = settings.displayCustomCSS; - aoButa = JSON.parse(localStorage.getItem('settings')).displayAoButa; + if (customCSS && customCSS.length > 0) { + const style = document.createElement('style'); + const head = document.head || document.getElementsByTagName('head')[0]; + + style.type = 'text/css'; + style.id = 'custom-css'; + + if (style.styleSheet) style.styleSheet.cssText = customCSS; + else style.appendChild(document.createTextNode(customCSS)); + + head.appendChild(style); + } + + aoButa = settings.displayAoButa; mai.style.display = 'block'; if (aoButa === 'random') { -- cgit v1.2.3