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 0000000..a697102 Binary files /dev/null and b/playlist/static/img/volume.png differ 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