diff options
| author | Fuwn <[email protected]> | 2024-01-27 02:18:31 -0800 |
|---|---|---|
| committer | Fuwn <[email protected]> | 2024-01-27 02:18:31 -0800 |
| commit | 490ed12d38ccf54b3b849b169cc7029f9741eac0 (patch) | |
| tree | 1c18a096d31b5ec1186dc597a88a5cecad42e810 /src/app.html | |
| parent | feat(layout): reset all but settings on commit (diff) | |
| download | due.moe-490ed12d38ccf54b3b849b169cc7029f9741eac0.tar.xz due.moe-490ed12d38ccf54b3b849b169cc7029f9741eac0.zip | |
feat(settings): random helper
Diffstat (limited to 'src/app.html')
| -rw-r--r-- | src/app.html | 17 |
1 files changed, 16 insertions, 1 deletions
diff --git a/src/app.html b/src/app.html index 8040c0b0..521b7730 100644 --- a/src/app.html +++ b/src/app.html @@ -82,10 +82,25 @@ <script> document.addEventListener('DOMContentLoaded', () => { const mai = document.getElementById('mai'); - const aoButa = JSON.parse(localStorage.getItem('settings')).displayAoButa; + let aoButa = JSON.parse(localStorage.getItem('settings')).displayAoButa; mai.style.display = 'block'; + if (aoButa === 'random') { + const random = Math.floor(Math.random() * 3); + switch (random) { + case 0: + aoButa = 'mai'; + break; + case 1: + aoButa = 'nodoka'; + break; + case 2: + aoButa = 'kaede'; + break; + } + } + switch (aoButa) { case 'mai': { |