From 6f4da4046dc7aa29459ecfb2f02f0204c4dcf59f Mon Sep 17 00:00:00 2001 From: Mark Hoekveen Date: Mon, 4 Mar 2024 14:33:41 +0100 Subject: [PATCH] Media player updates Seek bar, volume bar, updated quota max --- playlist/models/profile.py | 2 + playlist/static/img/seek.svg | 47 +++++++++++++++++++++ playlist/static/img/vol-select.svg | 63 ++++++++++++++++++++++++++++ playlist/static/img/volume.png | Bin 0 -> 393 bytes playlist/static/style.css | 51 +++++++++++++++++++++- playlist/templates/MediaPlayer.html | 10 ++++- 6 files changed, 171 insertions(+), 2 deletions(-) create mode 100644 playlist/static/img/seek.svg create mode 100644 playlist/static/img/vol-select.svg create mode 100644 playlist/static/img/volume.png diff --git a/playlist/models/profile.py b/playlist/models/profile.py index 81ae35a..192c553 100644 --- a/playlist/models/profile.py +++ b/playlist/models/profile.py @@ -7,6 +7,7 @@ from django.utils import timezone from datetime import datetime, timedelta NOMINATIONS_PER_DAY = 10 +MAX_QUOTA = 22 class Background(models.Model): def __str__(self): @@ -33,6 +34,7 @@ class Profile(models.Model): if elapsed.seconds > 300: noms_per_second = NOMINATIONS_PER_DAY/(60*60*24) self.quota += noms_per_second * elapsed.seconds + self.quota = min(self.quota, MAX_QUOTA) print(f"Er zijn {elapsed.seconds}s voorbij, je nieuwe quota is {self.quota}") self.quota_last_updated = timezone.now() diff --git a/playlist/static/img/seek.svg b/playlist/static/img/seek.svg new file mode 100644 index 0000000..0780962 --- /dev/null +++ b/playlist/static/img/seek.svg @@ -0,0 +1,47 @@ + + + + + + + + + diff --git a/playlist/static/img/vol-select.svg b/playlist/static/img/vol-select.svg new file mode 100644 index 0000000..ab1b6f2 --- /dev/null +++ b/playlist/static/img/vol-select.svg @@ -0,0 +1,63 @@ + + + + + + + + + + diff --git a/playlist/static/img/volume.png b/playlist/static/img/volume.png new file mode 100644 index 0000000000000000000000000000000000000000..a697102535d82469f2aea9399585c272b031655a GIT binary patch literal 393 zcmeAS@N?(olHy`uVBq!ia0vp^0wB!73?$#)eFPFE;PA<-^rAi=YeM|KF%KGhP}h?11Vl2ohYqEsNoU}Ruup=)5KYh)5)WNc+?sMwD1!`dMboFyt=akR{0J?{8S^xk5 literal 0 HcmV?d00001 diff --git a/playlist/static/style.css b/playlist/static/style.css index 3b92681..efee7ec 100644 --- a/playlist/static/style.css +++ b/playlist/static/style.css @@ -147,7 +147,11 @@ menu[role="tablist"] > li > a { iframe { opacity: 0; position: fixed; +} + +iframe.hide { left: 100%; + } /* Media player */ @@ -185,6 +189,32 @@ iframe { height: 22px; } +#seek::-moz-range-thumb { + background:transparent; + background-image: url(img/seek.svg); + width: 21px; + transform: none; +} +input[type="range"]#seek::-webkit-slider-thumb { + background:transparent; + background-image: url(img/seek.svg); + width: 21px; + transform: translateX(-5px) translateY(-4px); +} + +input[type="range"]#seek::-webkit-slider-runnable-track{ + height: 11px; + background: transparent; + box-shadow: 1px 0 0 white, 1px 1px 0 white, 0 1px 0 white, -1px 0 0 #461c1c, -1px -1px 0 #333, -1px 1px black, 1px -1px #a460a4 +} + +#seek::-moz-range-track { + height: 11px; + background: transparent; + box-shadow: 1px 0 0 white, 1px 1px 0 white, 0 1px 0 white, -1px 0 0 #461c1c, -1px -1px 0 #333, -1px 1px black, 1px -1px #a460a4 +} + + #media-control { display:flex; } @@ -250,6 +280,25 @@ iframe { background-image:url(img/eject.svg); } +#media-control #volume { + background-image:url(img/volume.png); + background-repeat:no-repeat; + padding-left: 24px; + background-position: 0 50%; + max-width: 120px; +} + +#volume::-moz-range-thumb { + background: transparent; + background-image:url(img/vol-select.svg); +} + +input[type="range"]#volume::-webkit-slider-thumb { + background: transparent; + -webkit-appearance: none; + background-image:url(img/vol-select.svg); +} + /* Clippy */ #clippy { position: fixed; @@ -390,7 +439,7 @@ iframe { .progress-indicator { height: 26px; padding: 4px 3px; - width: 360px; + width: 340px; } .field-row.settings label { diff --git a/playlist/templates/MediaPlayer.html b/playlist/templates/MediaPlayer.html index 10c932c..cb304e4 100644 --- a/playlist/templates/MediaPlayer.html +++ b/playlist/templates/MediaPlayer.html @@ -22,6 +22,8 @@
+
+ \ No newline at end of file