aboutsummaryrefslogtreecommitdiff
path: root/src/app.html
diff options
context:
space:
mode:
authorFuwn <[email protected]>2025-06-23 01:09:20 -0700
committerFuwn <[email protected]>2025-06-23 01:09:20 -0700
commitfef162aabb5d9cca161a269009bad394f8b9b9a6 (patch)
tree29bc8b51b8f30f13ee1293bc068d9d9d92368ddf /src/app.html
parentstyle(app.html): Reformat (diff)
downloaddue.moe-fef162aabb5d9cca161a269009bad394f8b9b9a6.tar.xz
due.moe-fef162aabb5d9cca161a269009bad394f8b9b9a6.zip
feat(settings): Custom CSS
Diffstat (limited to 'src/app.html')
-rw-r--r--src/app.html17
1 files changed, 16 insertions, 1 deletions
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') {