@braccato/core 2.0.0-beta.4 → 2.0.0-beta.6
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 +99 -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,9 @@ 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 */
|
|
127
|
+
--blyrics-line-hover-bg-color: rgb(255 255 255 / 0.1); /* the line's box, below */
|
|
128
|
+
--blyrics-line-hover-border-color: rgb(255 255 255 / 0.1);
|
|
126
129
|
--blyrics-line-hover-duration: 0.2s;
|
|
127
130
|
--blyrics-line-hover-easing: ease;
|
|
128
131
|
}
|
|
@@ -130,6 +133,102 @@ the line as it is:
|
|
|
130
133
|
|
|
131
134
|
Touch has no hover, so a tap never leaves a line looking hovered.
|
|
132
135
|
|
|
136
|
+
A few more properties stand in for rules that styled lines and words by state:
|
|
137
|
+
|
|
138
|
+
```css
|
|
139
|
+
.blyrics-container {
|
|
140
|
+
/* other lines while the pointer is over the lyrics or a reader scrolls */
|
|
141
|
+
--blyrics-line-opacity-browsing: 0.5;
|
|
142
|
+
/* distance lists like the opacity ones, applied to the line's colours */
|
|
143
|
+
--blyrics-line-saturate-after: 1 0.9 0.8;
|
|
144
|
+
--blyrics-line-brightness-before: 1 0.8;
|
|
145
|
+
}
|
|
146
|
+
|
|
147
|
+
.blyrics--word {
|
|
148
|
+
/* a sung word, while its line is still being sung */
|
|
149
|
+
--blyrics-word-past-opacity: 0.6;
|
|
150
|
+
/* word-synced words wait here until sung, then rise out of it over their duration */
|
|
151
|
+
--blyrics-word-rest-transform: translateY(3px);
|
|
152
|
+
--blyrics-word-rise-extra-duration: 0.2s;
|
|
153
|
+
--blyrics-word-rise-easing: ease;
|
|
154
|
+
}
|
|
155
|
+
|
|
156
|
+
.blyrics--line, .blyrics--translated {
|
|
157
|
+
/* text-shadow's syntax; drawn once with the line */
|
|
158
|
+
--blyrics-text-shadow: 0 0.3rem 0.5rem rgb(0 0 0 / 0.15);
|
|
159
|
+
/* while the line is sung (over its scale transition), and while it is hovered; none for none */
|
|
160
|
+
--blyrics-active-text-shadow: 0 0 1rem rgb(255 255 255 / 0.4);
|
|
161
|
+
--blyrics-line-hover-text-shadow: 0 0 0.5rem rgb(255 255 255 / 0.3);
|
|
162
|
+
}
|
|
163
|
+
|
|
164
|
+
.blyrics--line {
|
|
165
|
+
/* a box behind the line, over its whole box (padding included), with the line's border-radius */
|
|
166
|
+
--blyrics-line-bg-color: rgb(255 255 255 / 0.06);
|
|
167
|
+
/* a border inside the box's edge */
|
|
168
|
+
--blyrics-line-border-color: rgb(255 255 255 / 0.1);
|
|
169
|
+
--blyrics-line-border-width: 1px;
|
|
170
|
+
border-radius: 1rem;
|
|
171
|
+
}
|
|
172
|
+
```
|
|
173
|
+
|
|
174
|
+
The shadows, the box, the past opacity and the rest pose are read from each element, so selectors
|
|
175
|
+
scope them as they do colours: `[data-layout="stage"] > .blyrics--line` gives only the stage view's
|
|
176
|
+
lines a box, for instance. The box's corner is the line's `border-radius` as a length (a percentage
|
|
177
|
+
or an elliptical corner reads as square), and a line with nothing to draw, such as an empty blank
|
|
178
|
+
line, has no box. The browsing opacity and the distance lists are read from the container.
|
|
179
|
+
Each shadow is drawn once with the line and cross-fades with its state, so a sung or hovered shadow
|
|
180
|
+
eases in and out rather than moving from one offset to another.
|
|
181
|
+
|
|
182
|
+
Instrumental lines and the no-lyrics message, which themes restyled with `::before` and `::after`,
|
|
183
|
+
take these instead:
|
|
184
|
+
|
|
185
|
+
```css
|
|
186
|
+
.blyrics-container {
|
|
187
|
+
/* note (the default), dots (lit one after another in reading order), or text such as "♫" */
|
|
188
|
+
--blyrics-instrumental-icon: dots;
|
|
189
|
+
/* swells to this scale and back once a period while the instrumental plays */
|
|
190
|
+
--blyrics-instrumental-pulse-scale: 1.14;
|
|
191
|
+
--blyrics-instrumental-pulse-duration: 3s;
|
|
192
|
+
/* in place of the host's message when there are no lyrics, and text drawn above it */
|
|
193
|
+
--blyrics-no-lyrics-text: "No lyrics found";
|
|
194
|
+
--blyrics-no-lyrics-icon: "♫";
|
|
195
|
+
}
|
|
196
|
+
|
|
197
|
+
/* the no-lyrics icon is an element of its own, 4em by default */
|
|
198
|
+
.blyrics-no-lyrics-icon { font-size: 6rem; }
|
|
199
|
+
```
|
|
200
|
+
|
|
201
|
+
The wobble and the letter wave have a few more controls. A held word is one sung for longer than
|
|
202
|
+
`blyrics-long-word-threshold`, and with `blyrics-long-word-max-letters = 8;` one of at most 8
|
|
203
|
+
letters, so a long word like "everybody" is not one however long it is held.
|
|
204
|
+
`blyrics-letter-wave = long;` waves only held words; the rest move as one piece.
|
|
205
|
+
|
|
206
|
+
```css
|
|
207
|
+
.blyrics-container {
|
|
208
|
+
/* held words: the outermost letters move this far out at their crest, the rest in proportion */
|
|
209
|
+
--blyrics-letter-wave-spread: 0.04em;
|
|
210
|
+
/* held words that glow: each letter's glow up to 1 + this as bright at its crest */
|
|
211
|
+
--blyrics-letter-wave-glow: 0.8;
|
|
212
|
+
/* word (the default) or syllable: each syllable wobbles on its own, about its own centre */
|
|
213
|
+
--blyrics-word-wobble-scope: syllable;
|
|
214
|
+
/* the wobble lasts --blyrics-wobble-duration plus this many times the syllable's duration */
|
|
215
|
+
--blyrics-word-wobble-duration-ratio: 0.5;
|
|
216
|
+
/* any easing can be a linear() curve, such as a spring */
|
|
217
|
+
--blyrics-word-wobble-easing: linear(0, 0.6 20%, 1.08 40%, 0.98 65%, 1);
|
|
218
|
+
}
|
|
219
|
+
|
|
220
|
+
.blyrics--romanized {
|
|
221
|
+
/* the box behind romanization; transparent for none */
|
|
222
|
+
--blyrics-romanized-bg-color: transparent;
|
|
223
|
+
/* the box's padding and border-radius are the theme's own, as in the DOM renderer */
|
|
224
|
+
padding: 0;
|
|
225
|
+
}
|
|
226
|
+
```
|
|
227
|
+
|
|
228
|
+
The glow peak brightens a glow up to its colour fully opaque, so it shows on a translucent glow
|
|
229
|
+
colour such as the default. A word's text-shadow moves with the word, but not with each letter's
|
|
230
|
+
wave.
|
|
231
|
+
|
|
133
232
|
## How it works
|
|
134
233
|
|
|
135
234
|
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
|