@braccato/core 1.12.0 → 1.12.2
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 +3 -0
- package/dist/README.md +3 -0
- package/dist/constants.d.ts +1 -0
- package/dist/constants.js +1 -0
- package/dist/styles/lyrics.css +11 -2
- package/dist/view.js +8 -3
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -252,6 +252,9 @@ show at full strength from the start.
|
|
|
252
252
|
| `--blyrics-credits-opacity` | `0.2` | While the song plays. |
|
|
253
253
|
| `--blyrics-credits-focused-opacity` | `0.85` | Once the song has ended. |
|
|
254
254
|
|
|
255
|
+
The credits are a `p`, not a `div`, so rules a theme writes for the lines as `.blyrics-container > div`
|
|
256
|
+
(hover scaling, per-line opacity and blur) never reach them. Style them through `.blyrics-credits`.
|
|
257
|
+
|
|
255
258
|
The container carries `data-credits-focused` while the credits hold the focus. To hide them, a
|
|
256
259
|
stylesheet can set `.blyrics-credits { display: none; }`, which the scroll then ignores, or a theme can
|
|
257
260
|
declare `/* blyrics-hide-credits = true; */` so they are never built.
|
package/dist/README.md
CHANGED
|
@@ -252,6 +252,9 @@ show at full strength from the start.
|
|
|
252
252
|
| `--blyrics-credits-opacity` | `0.2` | While the song plays. |
|
|
253
253
|
| `--blyrics-credits-focused-opacity` | `0.85` | Once the song has ended. |
|
|
254
254
|
|
|
255
|
+
The credits are a `p`, not a `div`, so rules a theme writes for the lines as `.blyrics-container > div`
|
|
256
|
+
(hover scaling, per-line opacity and blur) never reach them. Style them through `.blyrics-credits`.
|
|
257
|
+
|
|
255
258
|
The container carries `data-credits-focused` while the credits hold the focus. To hide them, a
|
|
256
259
|
stylesheet can set `.blyrics-credits { display: none; }`, which the scroll then ignores, or a theme can
|
|
257
260
|
declare `/* blyrics-hide-credits = true; */` so they are never built.
|
package/dist/constants.d.ts
CHANGED
|
@@ -5,6 +5,7 @@ export declare const WORD_CLASS: "blyrics--word";
|
|
|
5
5
|
export declare const LETTER_CLASS: "blyrics--letter";
|
|
6
6
|
export declare const FOOTER_CLASS: "blyrics-footer";
|
|
7
7
|
export declare const CREDITS_CLASS: "blyrics-credits";
|
|
8
|
+
export declare const CREDITS_TEXT_CLASS: "blyrics-credits__text";
|
|
8
9
|
export declare const CREDITS_NAMES_CLASS: "blyrics-credits__names";
|
|
9
10
|
export declare const CURRENT_LYRICS_CLASS: "blyrics--active";
|
|
10
11
|
export declare const ANIMATING_CLASS: "blyrics--animating";
|
package/dist/constants.js
CHANGED
|
@@ -8,6 +8,7 @@ export const WORD_CLASS = "blyrics--word";
|
|
|
8
8
|
export const LETTER_CLASS = "blyrics--letter";
|
|
9
9
|
export const FOOTER_CLASS = "blyrics-footer";
|
|
10
10
|
export const CREDITS_CLASS = "blyrics-credits";
|
|
11
|
+
export const CREDITS_TEXT_CLASS = "blyrics-credits__text";
|
|
11
12
|
export const CREDITS_NAMES_CLASS = "blyrics-credits__names";
|
|
12
13
|
// -- Playback state --------------------------------------------
|
|
13
14
|
export const CURRENT_LYRICS_CLASS = "blyrics--active";
|
package/dist/styles/lyrics.css
CHANGED
|
@@ -240,17 +240,26 @@
|
|
|
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 {
|
|
247
252
|
color: var(--blyrics-ui-text-color);
|
|
248
|
-
font-size: var(--blyrics-credits-font-size);
|
|
249
253
|
opacity: var(--blyrics-credits-opacity);
|
|
250
254
|
transition: opacity 0.35s cubic-bezier(0.25, 1, 0.5, 1);
|
|
251
255
|
}
|
|
252
256
|
|
|
253
|
-
.blyrics-
|
|
257
|
+
.blyrics-credits__text {
|
|
258
|
+
display: block;
|
|
259
|
+
font-size: var(--blyrics-credits-font-size);
|
|
260
|
+
}
|
|
261
|
+
|
|
262
|
+
.blyrics-credits__text::before {
|
|
254
263
|
content: var(--blyrics-credits-label) " ";
|
|
255
264
|
}
|
|
256
265
|
|
package/dist/view.js
CHANGED
|
@@ -9,7 +9,7 @@
|
|
|
9
9
|
// This is also the one place outside the engine that writes engine view state, because building the
|
|
10
10
|
// lines is where those values are first knowable: the container, the records, the sync type, the
|
|
11
11
|
// size they were measured at, and the scrolls to swallow before the view has settled.
|
|
12
|
-
import { CREDITS_CLASS, CREDITS_NAMES_CLASS, LINE_CLASS, LYRICS_CLASS, RTL_CLASS } from "./constants.js";
|
|
12
|
+
import { CREDITS_CLASS, CREDITS_NAMES_CLASS, CREDITS_TEXT_CLASS, LINE_CLASS, LYRICS_CLASS, RTL_CLASS, } from "./constants.js";
|
|
13
13
|
import { setupLineCullObserver } from "./engine.js";
|
|
14
14
|
import { addSeekHandler, applyDirection, buildLineSyncedParts, createLyricsLine, deriveSyncType, disableRichsync, findNearestAgent, hideCredits, isNearestLyricRtl, newLineData, } from "./inject.js";
|
|
15
15
|
import { createInstrumentalElement } from "./instrumental.js";
|
|
@@ -45,13 +45,18 @@ 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;
|
|
51
|
+
// The smaller size lives on an inner block so the credits keep the lines' em, and with it their inset.
|
|
52
|
+
const text = doc.createElement("span");
|
|
53
|
+
text.className = CREDITS_TEXT_CLASS;
|
|
50
54
|
const names = doc.createElement("span");
|
|
51
55
|
names.className = CREDITS_NAMES_CLASS;
|
|
52
56
|
names.dir = "auto";
|
|
53
57
|
names.textContent = formatSongwriters(songwriters);
|
|
54
|
-
|
|
58
|
+
text.appendChild(names);
|
|
59
|
+
credits.appendChild(text);
|
|
55
60
|
return credits;
|
|
56
61
|
}
|
|
57
62
|
/**
|