Skip to content

Commit 8f6482e

Browse files
committed
- replace text play/pause symbols with svg icons
- cap `pauseResumeButton` size at `300px` on desktop - add glossy hover effect with pseudo-element - improve button shadows and transitions - implement `updateButtonIcon()` function for dynamic svg sizing
1 parent 3cc507e commit 8f6482e

File tree

1 file changed

+63
-18
lines changed

1 file changed

+63
-18
lines changed

tools/spotify_music_quiz_cards.html

Lines changed: 63 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -84,36 +84,64 @@
8484
}
8585

8686
#pauseResumeButton {
87-
width: 60vmin;
88-
height: 60vmin;
89-
font-size: 30vmin;
90-
padding-bottom: 4vmin;
87+
width: min(60vmin, 300px); /* Cap the max size on desktop */
88+
height: min(60vmin, 300px);
9189
border: none;
9290
border-radius: 50%;
93-
background: linear-gradient(145deg, #1DB954, #169c45);
94-
color: white;
91+
background: linear-gradient(145deg, #2FE075, #1DB954);
9592
cursor: pointer;
96-
transition: all 0.3s ease;
97-
box-shadow: 0 10px 20px rgba(29, 185, 84, 0.3);
93+
position: relative;
9894
display: flex;
9995
justify-content: center;
10096
align-items: center;
101-
font-weight: 900;
102-
text-shadow: 0 4px 8px rgba(0, 0, 0, 0.3), 0 8px 16px rgba(0, 0, 0, 0.2);
97+
transition: all 0.4s cubic-bezier(0.22, 1, 0.36, 1);
98+
box-shadow:
99+
0 2rem 4rem rgba(29, 185, 84, 0.2),
100+
0 1rem 2rem rgba(0, 0, 0, 0.1),
101+
inset 0 -2px 0 rgba(0, 0, 0, 0.1),
102+
inset 0 2px 0 rgba(255, 255, 255, 0.2);
103+
overflow: hidden;
104+
}
105+
106+
#pauseResumeButton::before {
107+
content: '';
108+
position: absolute;
109+
top: 0;
110+
left: 0;
111+
right: 0;
112+
bottom: 0;
113+
border-radius: 50%;
114+
background: linear-gradient(145deg, rgba(255, 255, 255, 0.2), transparent);
115+
opacity: 0;
116+
transition: opacity 0.3s ease;
103117
}
104118

105119
#pauseResumeButton:hover {
106-
transform: scale(1.02);
107-
box-shadow: 0 15px 30px rgba(29, 185, 84, 0.4);
120+
transform: translateY(-4px);
121+
background: linear-gradient(145deg, #34F07E, #1FCC5E);
122+
box-shadow:
123+
0 3rem 5rem rgba(29, 185, 84, 0.25),
124+
0 1.5rem 3rem rgba(0, 0, 0, 0.15),
125+
inset 0 -2px 0 rgba(0, 0, 0, 0.1),
126+
inset 0 2px 0 rgba(255, 255, 255, 0.2);
127+
}
128+
129+
#pauseResumeButton:hover::before {
130+
opacity: 1;
108131
}
109132

110133
#pauseResumeButton:active {
111-
transform: scale(0.98);
112-
box-shadow: 0 5px 15px rgba(29, 185, 84, 0.2);
134+
transform: translateY(2px);
135+
background: linear-gradient(145deg, #1DB954, #1AA54C);
136+
box-shadow:
137+
0 1rem 2rem rgba(29, 185, 84, 0.15),
138+
0 0.5rem 1rem rgba(0, 0, 0, 0.1),
139+
inset 0 -1px 0 rgba(0, 0, 0, 0.1),
140+
inset 0 1px 0 rgba(255, 255, 255, 0.1);
113141
}
114142

115-
#pauseResumeButton .play {
116-
padding-left: 4vmin;
143+
#pauseResumeButton svg {
144+
filter: drop-shadow(0 4px 8px rgba(0, 0, 0, 0.2));
117145
}
118146

119147
#player {
@@ -199,7 +227,7 @@
199227

200228
<div id="player" class="hidden">
201229
<div class="button-container">
202-
<button id="pauseResumeButton"><span class="pause">||</span></button>
230+
<button id="pauseResumeButton"><span class="play"></span></button>
203231
<a href="https://www.gptgames.dev/tools/spotify_qr_scanner" class="scan-button">
204232
Scan for next song
205233
</a>
@@ -256,7 +284,23 @@ <h2 class="text-xl font-bold mb-4">Create QR Codes from Playlist</h2>
256284
playerInstance.resume();
257285
}
258286
isPlaying = !isPlaying;
259-
pauseResumeButton.innerHTML = isPlaying ? '<span class="pause">||</span>' : '<span class="play">▷</span>';
287+
updateButtonIcon();
288+
}
289+
290+
function updateButtonIcon() {
291+
const size = Math.min(window.innerWidth, window.innerHeight) * 0.4; // 40% of viewport
292+
const button = document.getElementById('pauseResumeButton');
293+
294+
if (isPlaying) {
295+
button.innerHTML = `<svg width="${size}" height="${size}" viewBox="0 0 24 24">
296+
<rect x="6" y="4" width="4" height="16" fill="white"/>
297+
<rect x="14" y="4" width="4" height="16" fill="white"/>
298+
</svg>`;
299+
} else {
300+
button.innerHTML = `<svg width="${size}" height="${size}" viewBox="0 0 24 24">
301+
<path d="M8 5v14l11-7z" fill="white"/>
302+
</svg>`;
303+
}
260304
}
261305

262306
function getUrlParameter(name) {
@@ -343,6 +387,7 @@ <h2 class="text-xl font-bold mb-4">Create QR Codes from Playlist</h2>
343387
document.getElementById('songCount').textContent = e.target.value;
344388
});
345389
document.getElementById('createQRButton').onclick = showPlaylistModal;
390+
updateButtonIcon();
346391
});
347392

348393
async function processPlaylist() {

0 commit comments

Comments
 (0)