Skip to content

Commit 8885e2d

Browse files
committed
css marquee!
1 parent 2abaa8b commit 8885e2d

File tree

4 files changed

+54
-13
lines changed

4 files changed

+54
-13
lines changed

site/_data/assets.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"/assets/css/gateway.css": "558fd0916ec1160dd874e3a4499b30d0",
3-
"/assets/css/main.css": "f767f4ae6d863eca48b37780c1cda0df",
3+
"/assets/css/main.css": "5b77ac14d53462a4272b201156617bc4",
44
"/assets/css/vendor/highlightjs.css": "44f1ebb2c86da2cd1cfc99a04977bb60",
55
"/assets/css/vendor/katex.min.css": "90c433df0c910af1ccb27d8a5c2614c6",
66
"/assets/fonts/Minecraft-Bold.otf": "fe455a095e420be3e0f6ce1badaa5f08",
@@ -83,6 +83,6 @@
8383
"/assets/images/tooltip/background.png": "85a491c275a660ac4fa3f9a0fb3a8af1",
8484
"/assets/images/tooltip/frame.png": "8ac3e4872380ae7b9a289b6a75bc9fe4",
8585
"/assets/js/gate.js": "0deb7516f40b0134d4a6a07a50e9d8b4",
86-
"/assets/js/main.js": "a29effc1164e44ef3184bf121b15b2e4",
86+
"/assets/js/main.js": "4505ef9bbe452a9b4e3eb7c26c379a1d",
8787
"/assets/js/tooltip.js": "945863fc42b3bd7d8798c034dafe1f14"
8888
}

site/_includes/index.vto

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -87,7 +87,16 @@
8787
<a href="https://listenbrainz.org/user/igalaxy/" target="_blank">
8888
<div id="now-playing">
8989
<img id="now-playing-art" src="data:image/gif;base64,R0lGODlhAQABAIAAAAAAAP///yH5BAEAAAAALAAAAAABAAEAAAIBRAA7" width="16" height="16">
90-
<marquee id="now-playing-text" scrolldelay="200"><span id="now-playing-track"></span><span id="now-playing-artist"></span></marquee>
90+
<div id="now-playing-text" class="marquee">
91+
<p class="marquee-content">
92+
<span class="now-playing-track"></span>
93+
<span class="now-playing-artist"></span>
94+
</p>
95+
<p class="marquee-content" aria-hidden="true">
96+
<span class="now-playing-track"></span>
97+
<span class="now-playing-artist"></span>
98+
</p>
99+
</div>
91100
</div>
92101
</a>
93102
<ul id="today">

site/assets/css/main.css

Lines changed: 36 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -254,6 +254,36 @@ noscript {
254254
opacity: 1;
255255
}
256256

257+
@keyframes scroll {
258+
from {
259+
transform: translateX(0);
260+
}
261+
to {
262+
transform: translateX(calc(-100% - var(--gap)));
263+
}
264+
}
265+
266+
.marquee {
267+
--gap: 1rem;
268+
display: flex;
269+
overflow: hidden;
270+
user-select: none;
271+
gap: var(--gap);
272+
white-space: nowrap;
273+
}
274+
275+
.marquee-content {
276+
flex-shrink: 0;
277+
display: flex;
278+
justify-content: space-around;
279+
min-width: 100%;
280+
animation: scroll 10s linear infinite;
281+
}
282+
283+
.marquee:hover .marquee-content {
284+
animation-play-state: paused;
285+
}
286+
257287
#main-header {
258288
display: flex;
259289
height: 150px;
@@ -375,8 +405,9 @@ noscript {
375405
}
376406
#now-playing-text {
377407
flex-grow: 1;
378-
#now-playing-track {
408+
.now-playing-track {
379409
font-style: italic;
410+
margin-right: 0.8em;
380411
}
381412
}
382413
}
@@ -611,11 +642,10 @@ img {
611642
text-decoration-style: solid;
612643
}
613644

614-
a[href]:not(:where(/* exclude hash only links */
615-
[href^="#"], /* exclude javascript only links */
616-
[href^="javascript:" i], /* exclude relative but not double slash only links */
617-
[href^="/"]:not([href^="//"]), /* domains to exclude */
618-
[href*="//wii.mom"], [data-no-style])):after {
645+
a[href]:not(:where(/* exclude hash only links */ [href^="#"],
646+
/* exclude javascript only links */ [href^="javascript:" i],
647+
/* exclude relative but not double slash only links */ [href^="/"]:not([href^="//"]),
648+
/* domains to exclude */ [href*="//wii.mom"], [data-no-style])):after {
619649
content: " ";
620650
display: inline-block;
621651
width: 14px;

site/assets/js/main.js

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -195,10 +195,12 @@ document.getElementById("avatar-image").src = avatars[Math.floor(Math.random() *
195195
if (data.track_metadata.mbid_mapping.caa_release_mbid != undefined) {
196196
document.getElementById("now-playing-art").src = track.art;
197197
}
198-
document.getElementById("now-playing-track").textContent = track.track_name;
199-
document.getElementById("now-playing-artist").textContent = ` by ${track.artist_name} - ${
200-
Math.floor(track.seconds_since_listened / 60)
201-
} minutes ago`;
198+
for (t of document.getElementsByClassName("now-playing-track")) {
199+
t.textContent = track.track_name;
200+
}
201+
for (a of document.getElementsByClassName("now-playing-artist")) {
202+
a.textContent = `by ${track.artist_name} - ${Math.floor(track.seconds_since_listened / 60)} minutes ago`;
203+
}
202204
})();
203205

204206
(async () => {

0 commit comments

Comments
 (0)