@braccato/core 2.0.0-beta.4 → 2.0.0-beta.5
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 +80 -0
- package/package.json +1 -1
- package/pkg/braccato_core_rs.js +15 -0
- package/pkg/braccato_core_rs_bg.wasm +0 -0
package/README.md
CHANGED
|
@@ -123,6 +123,7 @@ the line as it is:
|
|
|
123
123
|
--blyrics-line-hover-opacity: 1; /* over the distance opacity */
|
|
124
124
|
--blyrics-line-hover-blur: 0; /* over the distance blur; px, rem or blur(…) */
|
|
125
125
|
--blyrics-line-hover-scale: 1.04; /* over --blyrics-scale / --blyrics-active-scale */
|
|
126
|
+
--blyrics-line-hover-color: white; /* the words' inactive colour; the sung part keeps its own */
|
|
126
127
|
--blyrics-line-hover-duration: 0.2s;
|
|
127
128
|
--blyrics-line-hover-easing: ease;
|
|
128
129
|
}
|
|
@@ -130,6 +131,85 @@ the line as it is:
|
|
|
130
131
|
|
|
131
132
|
Touch has no hover, so a tap never leaves a line looking hovered.
|
|
132
133
|
|
|
134
|
+
A few more properties stand in for rules that styled lines and words by state:
|
|
135
|
+
|
|
136
|
+
```css
|
|
137
|
+
.blyrics-container {
|
|
138
|
+
/* other lines while the pointer is over the lyrics or a reader scrolls */
|
|
139
|
+
--blyrics-line-opacity-browsing: 0.5;
|
|
140
|
+
/* distance lists like the opacity ones, applied to the line's colours */
|
|
141
|
+
--blyrics-line-saturate-after: 1 0.9 0.8;
|
|
142
|
+
--blyrics-line-brightness-before: 1 0.8;
|
|
143
|
+
}
|
|
144
|
+
|
|
145
|
+
.blyrics--word {
|
|
146
|
+
/* a sung word, while its line is still being sung */
|
|
147
|
+
--blyrics-word-past-opacity: 0.6;
|
|
148
|
+
/* word-synced words wait here until sung, then rise out of it over their duration */
|
|
149
|
+
--blyrics-word-rest-transform: translateY(3px);
|
|
150
|
+
--blyrics-word-rise-extra-duration: 0.2s;
|
|
151
|
+
--blyrics-word-rise-easing: ease;
|
|
152
|
+
}
|
|
153
|
+
|
|
154
|
+
.blyrics--line, .blyrics--translated {
|
|
155
|
+
/* text-shadow's syntax; drawn once with the line, the same in every state */
|
|
156
|
+
--blyrics-text-shadow: 0 0.3rem 0.5rem rgb(0 0 0 / 0.15);
|
|
157
|
+
}
|
|
158
|
+
```
|
|
159
|
+
|
|
160
|
+
The shadow, the past opacity and the rest pose are read from each element, so selectors scope them
|
|
161
|
+
as they do colours. The browsing opacity and the distance lists are read from the container.
|
|
162
|
+
|
|
163
|
+
Instrumental lines and the no-lyrics message, which themes restyled with `::before` and `::after`,
|
|
164
|
+
take these instead:
|
|
165
|
+
|
|
166
|
+
```css
|
|
167
|
+
.blyrics-container {
|
|
168
|
+
/* note (the default), dots (lit one after another in reading order), or text such as "♫" */
|
|
169
|
+
--blyrics-instrumental-icon: dots;
|
|
170
|
+
/* swells to this scale and back once a period while the instrumental plays */
|
|
171
|
+
--blyrics-instrumental-pulse-scale: 1.14;
|
|
172
|
+
--blyrics-instrumental-pulse-duration: 3s;
|
|
173
|
+
/* in place of the host's message when there are no lyrics, and text drawn above it */
|
|
174
|
+
--blyrics-no-lyrics-text: "No lyrics found";
|
|
175
|
+
--blyrics-no-lyrics-icon: "♫";
|
|
176
|
+
}
|
|
177
|
+
|
|
178
|
+
/* the no-lyrics icon is an element of its own, 4em by default */
|
|
179
|
+
.blyrics-no-lyrics-icon { font-size: 6rem; }
|
|
180
|
+
```
|
|
181
|
+
|
|
182
|
+
The wobble and the letter wave have a few more controls. A held word is one sung for longer than
|
|
183
|
+
`blyrics-long-word-threshold`, and with `blyrics-long-word-max-letters = 8;` one of at most 8
|
|
184
|
+
letters, so a long word like "everybody" is not one however long it is held.
|
|
185
|
+
`blyrics-letter-wave = long;` waves only held words; the rest move as one piece.
|
|
186
|
+
|
|
187
|
+
```css
|
|
188
|
+
.blyrics-container {
|
|
189
|
+
/* held words: the outermost letters move this far out at their crest, the rest in proportion */
|
|
190
|
+
--blyrics-letter-wave-spread: 0.04em;
|
|
191
|
+
/* held words that glow: each letter's glow up to 1 + this as bright at its crest */
|
|
192
|
+
--blyrics-letter-wave-glow: 0.8;
|
|
193
|
+
/* word (the default) or syllable: each syllable wobbles on its own, about its own centre */
|
|
194
|
+
--blyrics-word-wobble-scope: syllable;
|
|
195
|
+
/* the wobble lasts --blyrics-wobble-duration plus this many times the syllable's duration */
|
|
196
|
+
--blyrics-word-wobble-duration-ratio: 0.5;
|
|
197
|
+
/* any easing can be a linear() curve, such as a spring */
|
|
198
|
+
--blyrics-word-wobble-easing: linear(0, 0.6 20%, 1.08 40%, 0.98 65%, 1);
|
|
199
|
+
}
|
|
200
|
+
|
|
201
|
+
.blyrics--romanized {
|
|
202
|
+
/* the box behind romanization; transparent for none */
|
|
203
|
+
--blyrics-romanized-bg-color: transparent;
|
|
204
|
+
/* the box's padding and border-radius are the theme's own, as in the DOM renderer */
|
|
205
|
+
padding: 0;
|
|
206
|
+
}
|
|
207
|
+
```
|
|
208
|
+
|
|
209
|
+
The glow peak brightens a glow up to its colour fully opaque, so it shows on a translucent glow
|
|
210
|
+
colour such as the default. A word's text-shadow moves with the word, but not with each letter's
|
|
211
|
+
wave.
|
|
212
|
+
|
|
133
213
|
## How it works
|
|
134
214
|
|
|
135
215
|
The lines are laid out by the browser in an invisible copy of `@braccato/core`'s markup, inside the
|
package/package.json
CHANGED
package/pkg/braccato_core_rs.js
CHANGED
|
@@ -445,6 +445,9 @@ function __wbg_get_imports() {
|
|
|
445
445
|
__wbg_arcTo_a347b807c468785d: function() { return handleError(function (arg0, arg1, arg2, arg3, arg4, arg5) {
|
|
446
446
|
arg0.arcTo(arg1, arg2, arg3, arg4, arg5);
|
|
447
447
|
}, arguments); },
|
|
448
|
+
__wbg_arc_df3f7eb77e59876f: function() { return handleError(function (arg0, arg1, arg2, arg3, arg4, arg5) {
|
|
449
|
+
arg0.arc(arg1, arg2, arg3, arg4, arg5);
|
|
450
|
+
}, arguments); },
|
|
448
451
|
__wbg_attachShader_3ed301cc92db59f6: function(arg0, arg1, arg2) {
|
|
449
452
|
arg0.attachShader(arg1, arg2);
|
|
450
453
|
},
|
|
@@ -1229,6 +1232,18 @@ function __wbg_get_imports() {
|
|
|
1229
1232
|
__wbg_set_scrollTop_a01ea28563affafe: function(arg0, arg1) {
|
|
1230
1233
|
arg0.scrollTop = arg1;
|
|
1231
1234
|
},
|
|
1235
|
+
__wbg_set_shadowBlur_85cdec581d1dc1d5: function(arg0, arg1) {
|
|
1236
|
+
arg0.shadowBlur = arg1;
|
|
1237
|
+
},
|
|
1238
|
+
__wbg_set_shadowColor_b938633d4fa98064: function(arg0, arg1, arg2) {
|
|
1239
|
+
arg0.shadowColor = getStringFromWasm0(arg1, arg2);
|
|
1240
|
+
},
|
|
1241
|
+
__wbg_set_shadowOffsetX_d90df5fa6efe0d44: function(arg0, arg1) {
|
|
1242
|
+
arg0.shadowOffsetX = arg1;
|
|
1243
|
+
},
|
|
1244
|
+
__wbg_set_shadowOffsetY_244217183c1e23d9: function(arg0, arg1) {
|
|
1245
|
+
arg0.shadowOffsetY = arg1;
|
|
1246
|
+
},
|
|
1232
1247
|
__wbg_set_src_da602cd25f3603f8: function(arg0, arg1, arg2) {
|
|
1233
1248
|
arg0.src = getStringFromWasm0(arg1, arg2);
|
|
1234
1249
|
},
|
|
Binary file
|