diff --git a/src/assets/img/volume-triangle.svg b/src/assets/img/volume-triangle.svg new file mode 100644 index 0000000..b221da3 --- /dev/null +++ b/src/assets/img/volume-triangle.svg @@ -0,0 +1,3 @@ + diff --git a/src/assets/scss/5-modules/volume.scss b/src/assets/scss/5-modules/volume.scss new file mode 100644 index 0000000..184a368 --- /dev/null +++ b/src/assets/scss/5-modules/volume.scss @@ -0,0 +1,66 @@ +/* ----------------------------------------------------------- */ +/* == volume control volume */ +/* ----------------------------------------------------------- */ + +.volume { + position: relative; + margin: 1rem 0; +} + +.volume__bg, +.volume__progress { + position: absolute; + top: 0; + left: 0; + margin: .2rem .1rem; + width: calc(100% - .2rem); + height: calc(100% - .4rem); + + clip-path: url(#volume); +} + +.volume__bg { + background: rgba(99, 87, 118, .4); +} + +.volume__progress { + background-color: $color-primary; +} + +.volume__input { + position: relative; + z-index: 1; + appearance: none; + padding: 0; + width: 4rem; + border: none; + border-radius: .1rem; + background: none; + box-shadow: none; +} + +.volume__input::range-track { + width: 100%; + height: 17px; + border-radius: 0; + background: transparent; + box-shadow: 0px 0px 0px #000, 0px 0px 0px #0d0d0d; + cursor: pointer; + + animate: .2s; + clip-path: url(#volume); +} + +.volume__input::range-thumb { + position: relative; + appearance: none; + width: 20px; + width: 6px; + height: 19px; + border: 0px solid #000; + border-radius: 2px; + background: #fff; + box-shadow: -1px 2px 4px rgba(99, 87, 118, .6); + cursor: pointer; + transform: translateY(-.1rem); +} diff --git a/src/assets/scss/style.scss b/src/assets/scss/style.scss index 42120f9..fd0fc1c 100755 --- a/src/assets/scss/style.scss +++ b/src/assets/scss/style.scss @@ -65,6 +65,7 @@ @import "5-modules/player-big"; @import "5-modules/player-progress"; @import "5-modules/player-track"; +@import "5-modules/volume"; // -------------------------------------------------------------- diff --git a/src/components/Controls.svelte b/src/components/Controls.svelte index a311da4..65b19f7 100644 --- a/src/components/Controls.svelte +++ b/src/components/Controls.svelte @@ -1,18 +1,6 @@