|
6 | 6 | nextSong, previousSong, |
7 | 7 | isShuffledEnabled, isLoopingEnabled, |
8 | 8 | toggleShuffle, playOrPauseSong, |
9 | | - toggleLoop } from "../scripts/playbackService"; |
| 9 | + toggleLoop, isLoading } from "../scripts/playbackService"; |
10 | 10 | import { getImageUrl } from "../scripts/api"; |
11 | 11 | import { get } from "svelte/store"; |
12 | 12 | import { isTimerEnabled, timeLeft, toggleSleepTimer } from "../scripts/sleeptimerService"; |
|
18 | 18 | $: $isLoopingEnabled; |
19 | 19 | $: $isTimerEnabled; |
20 | 20 | $: $timeLeft; |
| 21 | + $: $isLoading |
21 | 22 | |
22 | 23 | function togglePlay() { |
23 | 24 | playOrPauseSong(get(currentSong).id); |
|
40 | 41 | {#if $currentSong && $currentSong.id !== -999} <!-- Ensure currentSong is valid --> |
41 | 42 | <div class="modal fade" id="songControlModal" tabindex="-1" aria-labelledby="songControlModalLabel" aria-hidden="false"> |
42 | 43 | <div class="modal-dialog modal-fullscreen-sm-down"> |
43 | | - <div class="modal-content bg-dark"> |
| 44 | + <div class="modal-content"> |
44 | 45 | <div class="modal-body"> |
45 | 46 | <div> |
46 | 47 | <div class="row"> |
|
50 | 51 | </div> |
51 | 52 | </div> |
52 | 53 | <div class="col-12 text-center"> |
53 | | - <img class="img-fluid border border-1 rounded rounded-2 mt-1" src={getImageUrl($currentSong.thumbnail_path)} alt="404" /> |
| 54 | + <img loading="lazy" class="img-fluid border border-1 rounded rounded-2 mt-1" src={getImageUrl($currentSong.thumbnail_path)} alt="404" /> |
54 | 55 | </div> |
55 | 56 | <div class="col-12"> |
56 | 57 | <input type="range" on:change={seekEvent} class="form-range mt-5" value={$playPercentage} min="0" max="100" step="1" /> |
57 | 58 | </div> |
58 | 59 | <div class="col-12"> |
59 | 60 | <div class="row mt-4"> |
60 | 61 | <div class="col-4"> |
61 | | - <button aria-label="previous song" on:click={previousSong} class="btn btn-dark w-100"> |
| 62 | + <button aria-label="previous song" on:click={previousSong} class="btn w-100"> |
62 | 63 | <i class="fa-solid fa-backward fa-2xl"></i> |
63 | 64 | </button> |
64 | 65 | </div> |
65 | 66 |
|
66 | 67 | <div class="col-4"> |
67 | | - <button on:click={togglePlay} class="btn btn-dark w-100"> |
| 68 | + <button on:click={togglePlay} class="btn w-100"> |
68 | 69 | {#if $isPlaying} |
69 | 70 | <i class="fa-solid fa-pause fa-2xl"></i> |
| 71 | + {:else if $isLoading} |
| 72 | + <i class="fa-solid fa-spinner fa-spin fa-2xl"></i> |
70 | 73 | {:else} |
71 | 74 | <i class="fa-solid fa-play fa-2xl"></i> |
72 | 75 | {/if} |
73 | 76 | </button> |
74 | 77 | </div> |
75 | 78 |
|
76 | 79 | <div class="col-4"> |
77 | | - <button aria-label="next song" on:click={nextSong} class="btn btn-dark w-100"> |
| 80 | + <button aria-label="next song" on:click={nextSong} class="btn w-100"> |
78 | 81 | <i class="fa-solid fa-forward fa-2xl"></i> |
79 | 82 | </button> |
80 | 83 | </div> |
|
84 | 87 | <div class="col-12"> |
85 | 88 | <div class="row mt-5"> |
86 | 89 | <div class="col-4"> |
87 | | - <button on:click={toggleSleepTimer} aria-label="sleep timer" type="button" class="btn btn-dark w-100"> |
88 | | - <i class="fa-solid fa-stopwatch-20" style="{$isTimerEnabled ? "color: #5bbd99;" : "color:white;"}"> |
| 90 | + <button on:click={toggleSleepTimer} aria-label="sleep timer" type="button" class="btn w-100"> |
| 91 | + <i class="fa-solid fa-stopwatch-20" style="{$isTimerEnabled ? "color: #1CC558;" : "color:white;"}"> |
89 | 92 | <span style="font-size: 0.8rem;"> |
90 | 93 | {$isTimerEnabled ? $timeLeft : ""} |
91 | 94 | </span> |
|
94 | 97 | </div> |
95 | 98 |
|
96 | 99 | <div class="col-4"> |
97 | | - <button on:click={toggleShuffle} aria-label="shuffle playlist" type="button" class="btn btn-dark w-100"> |
98 | | - <i class="fa-solid fa-shuffle" style="{$isShuffledEnabled ? "color: #5bbd99;" : "color:white;"}"></i> |
| 100 | + <button on:click={toggleShuffle} aria-label="shuffle playlist" type="button" class="btn w-100"> |
| 101 | + <i class="fa-solid fa-shuffle" style="{$isShuffledEnabled ? "color: #1CC558;" : "color:white;"}"></i> |
99 | 102 | </button> |
100 | 103 | </div> |
101 | 104 | <div class="col-4"> |
102 | | - <button on:click={toggleLoop} aria-label="repeat song" type="button" class="btn btn-dark w-100"> |
103 | | - <i class="fa-solid fa-repeat" style="{$isLoopingEnabled ? "color: #5bbd99;" : "color:white;"}"></i> |
| 105 | + <button on:click={toggleLoop} aria-label="repeat song" type="button" class="btn w-100"> |
| 106 | + <i class="fa-solid fa-repeat" style="{$isLoopingEnabled ? "color: #1CC558;" : "color:white;"}"></i> |
104 | 107 | </button> |
105 | 108 | </div> |
106 | 109 | </div> |
|
120 | 123 | img { |
121 | 124 | height: 10rem; |
122 | 125 | object-fit: contain; |
123 | | - border-color: #5bbd99 !important; |
| 126 | + border-color: #1CC558 !important; |
124 | 127 | } |
125 | 128 |
|
126 | 129 | p{ |
|
131 | 134 | } |
132 | 135 |
|
133 | 136 | i{ |
134 | | - color: #5bbd99; |
| 137 | + color: #1CC558; |
135 | 138 | font-weight: bolder; |
136 | 139 | } |
137 | 140 |
|
|
140 | 143 | } |
141 | 144 |
|
142 | 145 | .modal-footer button { |
143 | | - border-color: #5bbd99 !important; |
144 | | - background-color: #343a40 !important; |
| 146 | + border-color: #1CC558 !important; |
| 147 | + background-color: #343a4000 !important; |
145 | 148 | } |
146 | 149 |
|
| 150 | +
|
147 | 151 | input[type="range"]::-webkit-slider-thumb { |
148 | | - background-color: #5bbd99; |
| 152 | + background-color: #1CC558; |
| 153 | +} |
| 154 | +
|
| 155 | +input[type="range"]::-webkit-slider-runnable-track { |
| 156 | + background-color: #ACACAC; |
149 | 157 | } |
| 158 | +
|
| 159 | +.modal-content { |
| 160 | + background-color: #121212 !important; |
| 161 | + color: white; |
| 162 | + } |
| 163 | +
|
| 164 | + .modal-body { |
| 165 | + padding: 1rem; |
| 166 | + } |
| 167 | +
|
| 168 | + .form-range { |
| 169 | + color: #1CC558; |
| 170 | + } |
150 | 171 | </style> |
0 commit comments