From 58f87a323497afbccba039343d26b2b9a3614d28 Mon Sep 17 00:00:00 2001 From: ulith Date: Tue, 28 Jan 2025 01:20:28 +1300 Subject: [PATCH] music control buttons changed a bit --- static/rot/rot.css | 59 +++++++++++++++++++++++++++++----------------- static/rot/rot.js | 20 ++++++++++++++++ 2 files changed, 58 insertions(+), 21 deletions(-) diff --git a/static/rot/rot.css b/static/rot/rot.css index c9c75ee0..2cb4699a 100644 --- a/static/rot/rot.css +++ b/static/rot/rot.css @@ -1,8 +1,3 @@ -.music-controls-title { - text-align: left; - font-size: 18px; -} - .mutebutton { position: relative; display: inline-block; @@ -22,38 +17,39 @@ .mutecheck { display: inline-block; + font-family: "Arimo"; + font-size: 20px; + text-align: center; + color: var(--lightText); width: 24px; height: 24px; - vertical-align: middle; - padding: 5px; - border-radius: var(--btnRadius); + border-radius: 24px; + padding: 2px; } -/* SVG for unmuted state */ +/* unmuted state */ .mutecheck::before { - content: ''; - display: inline-block; - width: 24px; - height: 24px; - background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='24' height='24' viewBox='0 0 24 24'%3E%3Cpath fill='%23cdd6f4' d='M2.003 11.716c.037-1.843.056-2.764.668-3.552a3 3 0 0 1 .413-.431c.752-.636 1.746-.636 3.733-.636c.71 0 1.065 0 1.403-.092q.105-.03.209-.067c.33-.121.627-.33 1.22-.746c2.338-1.645 3.508-2.467 4.489-2.11c.188.069.37.168.533.29c.848.635.913 2.115 1.042 5.073c.048 1.096.08 2.034.08 2.555s-.032 1.46-.08 2.555c-.13 2.958-.194 4.438-1.042 5.073a2.1 2.1 0 0 1-.533.29c-.982.357-2.15-.465-4.49-2.11c-.592-.416-.889-.625-1.22-.746a3 3 0 0 0-.208-.067c-.338-.092-.693-.092-1.403-.092c-1.987 0-2.98 0-3.733-.636a3 3 0 0 1-.413-.43c-.612-.79-.63-1.71-.668-3.552a14 14 0 0 1 0-.57'/%3E%3Cpath fill='%23cdd6f4' fill-rule='evenodd' d='M19.49 5.552a.66.66 0 0 1 .97.094l-.529.471l.53-.47l.002.002l.003.004l.007.009l.079.112q.072.107.186.305c.149.264.339.652.526 1.171C21.64 8.291 22 9.851 22 12s-.36 3.71-.736 4.75c-.187.52-.377.907-.526 1.172a5 5 0 0 1-.265.417l-.007.009l-.003.003l-.001.002s-.001.001-.531-.47l.53.471a.66.66 0 0 1-.971.094a.77.77 0 0 1-.09-1.035l.03-.041q.04-.06.125-.207a6 6 0 0 0 .422-.943c.314-.871.644-2.253.644-4.222s-.33-3.35-.644-4.222a6 6 0 0 0-.422-.942a3 3 0 0 0-.157-.253m-1.641 1.833c.333-.197.753-.07.938.286l-.603.357l.603-.357l.001.002l.002.003l.003.007l.01.018l.024.053q.028.063.07.17c.053.145.12.35.185.62c.13.54.252 1.337.252 2.425c0 1.089-.122 1.886-.252 2.426c-.065.27-.132.475-.186.619a3 3 0 0 1-.094.223l-.009.018l-.003.007l-.002.003v.002s-.001.001-.604-.356l.603.357c-.185.355-.605.483-.938.286c-.33-.196-.45-.638-.272-.991l.004-.01l.035-.085c.032-.086.08-.23.13-.438c.1-.416.208-1.09.208-2.06c0-.971-.108-1.645-.208-2.06a4 4 0 0 0-.165-.524l-.004-.01a.76.76 0 0 1 .272-.991' clip-rule='evenodd'/%3E%3C/svg%3E"); - background-repeat: no-repeat; + content: ''; } -/* SVG for muted state */ +/* muted state */ input:checked ~ .mutecheck::before { - background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='24' height='24' viewBox='0 0 24 24'%3E%3Cpath fill='%23f38ba8' fill-rule='evenodd' d='M13.47 8.47a.75.75 0 0 1 1.06 0L17 10.94l2.47-2.47a.75.75 0 1 1 1.06 1.06L18.06 12l2.47 2.47a.75.75 0 0 1-1.06 1.06L17 13.06l-2.47 2.47a.75.75 0 0 1-1.06-1.06L15.94 12l-2.47-2.47a.75.75 0 0 1 0-1.06'/%3E%3Cpath fill='%23f38ba8' d='M3.681 8.164c-.621.788-.64 1.71-.678 3.552a14 14 0 0 0 0 .569c.038 1.842.057 2.763.678 3.551c.113.144.28.315.42.431c.763.636 1.771.636 3.788.636c.72 0 1.081 0 1.425.093q.107.029.211.066c.336.121.637.33 1.238.746c2.374 1.645 3.56 2.467 4.557 2.11a2.1 2.1 0 0 0 .541-.29c.786-.58.91-1.863 1.024-4.331l-1.294 1.294a2.25 2.25 0 1 1-3.182-3.182L13.818 12l-1.409-1.409a2.25 2.25 0 1 1 3.182-3.182l1.294 1.294c-.115-2.468-.238-3.751-1.024-4.331a2.1 2.1 0 0 0-.54-.29c-.997-.357-2.184.465-4.558 2.11c-.601.416-.902.625-1.238.746a3 3 0 0 1-.211.067c-.344.092-.704.092-1.425.092c-2.017 0-3.025 0-3.789.636c-.14.116-.306.287-.419.43'/%3E%3C/svg%3E"); + content: ''; + color: var(--icon); } -input:checked ~ .mutecheck { - background: color-mix(in srgb, var(--cRed) 5%, transparent); +.mutecheck:hover { + background-color: color-mix(in srgb, var(--icon) 40%, #00000000); +} +input:checked ~ .mutecheck:hover::before { + color: var(--lightText); } .volume-slider { position: relative; display: inline-block; width: 100%; - height: 24px; - margin: 0 10px; + height: 20px; vertical-align: middle; cursor: pointer; } @@ -95,6 +91,27 @@ input:checked ~ .mutecheck { gap: 2px; } +.volume-button-dwn, .volume-button-up { + display: unset; + font-family: "Arimo"; + font-size: 24px; + text-align: center; + color: var(--icon); + width: 32px; + padding: 4px; +} + +.volume-button-dwn { + margin: 0 3px 0 6px; +} +.volume-button-up { + margin: 0 6px 0 3px; +} + +.volume-button-up:hover, .volume-button-dwn:hover { + color: var(--lightText); +} + .volume-percentage { margin-right: 10px; } diff --git a/static/rot/rot.js b/static/rot/rot.js index 0a4df938..97e68d1d 100644 --- a/static/rot/rot.js +++ b/static/rot/rot.js @@ -319,6 +319,16 @@ const volumeThumb = document.createElement("div"); volumeThumb.className = "volume-thumb"; volumeSlider.appendChild(volumeThumb); + + const volumeStepDwn = document.createElement("button"); + volumeStepDwn.className = "volume-button-dwn button-default"; + volumeStepDwn.innerText = ""; + audioControl.appendChild(volumeStepDwn); + + const volumeStepUp = document.createElement("button"); + volumeStepUp.className = "volume-button-up button-default"; + volumeStepUp.innerText = ""; + audioControl.appendChild(volumeStepUp); const volumePercentage = document.createElement("div"); volumePercentage.className = "volume-percentage"; @@ -368,6 +378,16 @@ localStorage.audiomuted = audio.muted = musicmute.checked; playMusic(); }) + volumeStepDwn.addEventListener('click', () => { + var e = audio.volume - 0.05; + if (e < 0) e = 0; + volumeSet(e); + }) + volumeStepUp.addEventListener('click', () => { + var e = audio.volume + 0.05; + if (e > 1) e = 1; + volumeSet(e); + }) updateVolumeLabel(); }