@braccato/core 1.12.1 → 1.12.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +5 -1
- package/dist/README.md +5 -1
- package/dist/engine.js +3 -2
- package/dist/styles/lyrics.css +6 -0
- package/dist/view.js +3 -2
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -242,7 +242,8 @@ pair snaps at the halfway point instead of flowing.
|
|
|
242
242
|
|
|
243
243
|
Given `songwriters`, the view ends with `A, B & C` after the last line. It sits dim through the song,
|
|
244
244
|
and once the last line has ended it brightens and takes the scroll focus, the way Apple Music closes a
|
|
245
|
-
song.
|
|
245
|
+
song. The scroll never carries the last sung line out of view to do it, so a long list of writers
|
|
246
|
+
settles below that line rather than centred. Seeking back hands the focus to the lines again. Unsynced lyrics have no end, so their credits
|
|
246
247
|
show at full strength from the start.
|
|
247
248
|
|
|
248
249
|
| Custom property | Default | What it sets |
|
|
@@ -252,6 +253,9 @@ show at full strength from the start.
|
|
|
252
253
|
| `--blyrics-credits-opacity` | `0.2` | While the song plays. |
|
|
253
254
|
| `--blyrics-credits-focused-opacity` | `0.85` | Once the song has ended. |
|
|
254
255
|
|
|
256
|
+
The credits are a `p`, not a `div`, so rules a theme writes for the lines as `.blyrics-container > div`
|
|
257
|
+
(hover scaling, per-line opacity and blur) never reach them. Style them through `.blyrics-credits`.
|
|
258
|
+
|
|
255
259
|
The container carries `data-credits-focused` while the credits hold the focus. To hide them, a
|
|
256
260
|
stylesheet can set `.blyrics-credits { display: none; }`, which the scroll then ignores, or a theme can
|
|
257
261
|
declare `/* blyrics-hide-credits = true; */` so they are never built.
|
package/dist/README.md
CHANGED
|
@@ -242,7 +242,8 @@ pair snaps at the halfway point instead of flowing.
|
|
|
242
242
|
|
|
243
243
|
Given `songwriters`, the view ends with `A, B & C` after the last line. It sits dim through the song,
|
|
244
244
|
and once the last line has ended it brightens and takes the scroll focus, the way Apple Music closes a
|
|
245
|
-
song.
|
|
245
|
+
song. The scroll never carries the last sung line out of view to do it, so a long list of writers
|
|
246
|
+
settles below that line rather than centred. Seeking back hands the focus to the lines again. Unsynced lyrics have no end, so their credits
|
|
246
247
|
show at full strength from the start.
|
|
247
248
|
|
|
248
249
|
| Custom property | Default | What it sets |
|
|
@@ -252,6 +253,9 @@ show at full strength from the start.
|
|
|
252
253
|
| `--blyrics-credits-opacity` | `0.2` | While the song plays. |
|
|
253
254
|
| `--blyrics-credits-focused-opacity` | `0.85` | Once the song has ended. |
|
|
254
255
|
|
|
256
|
+
The credits are a `p`, not a `div`, so rules a theme writes for the lines as `.blyrics-container > div`
|
|
257
|
+
(hover scaling, per-line opacity and blur) never reach them. Style them through `.blyrics-credits`.
|
|
258
|
+
|
|
255
259
|
The container carries `data-credits-focused` while the credits hold the focus. To hide them, a
|
|
256
260
|
stylesheet can set `.blyrics-credits { display: none; }`, which the scroll then ignores, or a theme can
|
|
257
261
|
declare `/* blyrics-hide-credits = true; */` so they are never built.
|
package/dist/engine.js
CHANGED
|
@@ -2031,8 +2031,9 @@ export function tickView(engine, currentTime, options) {
|
|
|
2031
2031
|
// Make sure top of last active lyric is visible.
|
|
2032
2032
|
scrollPos = Math.min(scrollPos, lastActiveLyric.position);
|
|
2033
2033
|
const credits = engine.cachedCreditsItem;
|
|
2034
|
-
if (engine.creditsFocused && credits) {
|
|
2035
|
-
|
|
2034
|
+
if (engine.creditsFocused && credits && lastSungLine) {
|
|
2035
|
+
// Tall credits would otherwise carry the last line out of view while it is still being sung.
|
|
2036
|
+
scrollPos = Math.min(credits.position + credits.height / 2 - scrollPosOffset, lastSungLine.position);
|
|
2036
2037
|
}
|
|
2037
2038
|
// Past either end the browser clamps the write and reports nothing, leaving the view aiming
|
|
2038
2039
|
// at a position it never reached and re-aiming once per remaining line.
|
package/dist/styles/lyrics.css
CHANGED
|
@@ -240,7 +240,12 @@
|
|
|
240
240
|
}
|
|
241
241
|
|
|
242
242
|
.blyrics-container > .blyrics-credits {
|
|
243
|
+
box-sizing: border-box;
|
|
243
244
|
cursor: default;
|
|
245
|
+
margin: 0;
|
|
246
|
+
padding: var(--blyrics-padding) 0.25em;
|
|
247
|
+
transform: scale(var(--blyrics-scale));
|
|
248
|
+
transform-origin: left center;
|
|
244
249
|
}
|
|
245
250
|
|
|
246
251
|
.blyrics-credits {
|
|
@@ -250,6 +255,7 @@
|
|
|
250
255
|
}
|
|
251
256
|
|
|
252
257
|
.blyrics-credits__text {
|
|
258
|
+
display: block;
|
|
253
259
|
font-size: var(--blyrics-credits-font-size);
|
|
254
260
|
}
|
|
255
261
|
|
package/dist/view.js
CHANGED
|
@@ -45,10 +45,11 @@ function formatSongwriters(names) {
|
|
|
45
45
|
return names.length > 1 ? `${names.slice(0, -1).join(", ")} & ${names.at(-1)}` : (names[0] ?? "");
|
|
46
46
|
}
|
|
47
47
|
function buildCredits(doc, songwriters) {
|
|
48
|
-
|
|
48
|
+
// Not a div: themes style the lines as `.blyrics-container > div`, and none of that is meant for the credits.
|
|
49
|
+
const credits = doc.createElement("p");
|
|
49
50
|
credits.className = CREDITS_CLASS;
|
|
50
51
|
// The smaller size lives on an inner block so the credits keep the lines' em, and with it their inset.
|
|
51
|
-
const text = doc.createElement("
|
|
52
|
+
const text = doc.createElement("span");
|
|
52
53
|
text.className = CREDITS_TEXT_CLASS;
|
|
53
54
|
const names = doc.createElement("span");
|
|
54
55
|
names.className = CREDITS_NAMES_CLASS;
|