diff options
author | Kyle Gunger <kgunger12@gmail.com> | 2024-11-15 16:13:21 -0500 |
---|---|---|
committer | Kyle Gunger <kgunger12@gmail.com> | 2024-11-15 16:13:21 -0500 |
commit | 77adcd1b20528e6040ac3802b7d5ece769cebe32 (patch) | |
tree | 4034e82f287b1e416bf6393c833531373ff4831b | |
parent | e0c8f4e49d68c3f174b8877e91beff02565cfa2b (diff) |
Scrubber
-rw-r--r-- | index.html | 3 | ||||
-rw-r--r-- | scripts/gui-common/widgets.js | 5 | ||||
-rw-r--r-- | styles/themes/base.css | 4 | ||||
-rw-r--r-- | styles/widgets.css | 53 |
4 files changed, 64 insertions, 1 deletions
@@ -33,6 +33,9 @@ </nav> <content> + <div class="widget scrubber" style="--percent: 0;"> + <div class="fill"></div> + </div> </content> <script src="scripts/gui-common/color.js"></script> diff --git a/scripts/gui-common/widgets.js b/scripts/gui-common/widgets.js index 4ac47fe..34df8e9 100644 --- a/scripts/gui-common/widgets.js +++ b/scripts/gui-common/widgets.js @@ -1234,5 +1234,8 @@ class WidgetSelectButton extends Widget */ class WidgetScrubber extends WidgetDragable { - + constructor() + { + + } } diff --git a/styles/themes/base.css b/styles/themes/base.css index c2478dd..14b11bd 100644 --- a/styles/themes/base.css +++ b/styles/themes/base.css @@ -41,4 +41,8 @@ --w-sel-button-selected: #0084ff; --w-sel-button-selected-hover: #3ea2ff; --w-sel-button-selected-active: #3ea2ff; + + /* Scrubber */ + --w-scr-nub: #eee; + --w-scr-nub-active: white; }
\ No newline at end of file diff --git a/styles/widgets.css b/styles/widgets.css index 28c12e1..b143743 100644 --- a/styles/widgets.css +++ b/styles/widgets.css @@ -593,3 +593,56 @@ input { --w-bg-active: var(--w-sel-button-selected-active); } +/** + Scrubber +*/ + +.scrubber { + width: calc(var(--base-unit) + 5px); + height: calc(3 * var(--base-unit) + 5px); + margin: 10px; + box-shadow: inset 5px 5px var(--w-shadow); + --w-bg-hover: var(--w-bg); + --w-bg-active: var(--w-bg); +} + +.scrubber.h { + height: calc(var(--base-unit) + 5px); + width: calc(3 * var(--base-unit) + 5px); +} + +.scrubber > .fill { + position:absolute; + width: 100%; + height: 100%; + left: 0; + top: 0; +} + +.scrubber > .fill::before { + content: '◈'; + display: block; + height: calc(var(--base-unit) - 10px); + width: calc(var(--base-unit) - 10px); + border-radius: 5px; + background-color: var(--w-scr-nub); + text-align: center; + vertical-align: middle; + + position: absolute; + + box-shadow: 1px 1px var(--w-shadow), 3px 3px var(--w-shadow); + + bottom: calc(50% - (var(--base-unit) - 10px) / 2 + (50% * var(--percent))); + left: calc(50% - (var(--base-unit) - 10px) / 2); +} + +.scrubber.h > .fill::before { + left: calc(50% - (var(--base-unit) - 10px) / 2 + (50% * var(--percent))); + bottom: calc(50% - (var(--base-unit) - 10px) / 2); +} + + +.scrubber:hover > .fill::before, .scrubber.touch > .fill::before { + background-color: var(--w-scr-nub-active); +}
\ No newline at end of file |