@linear_non/stellar-kit 2.1.4 → 2.1.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/package.json +1 -1
- package/plugins/Observer.js +2 -0
- package/plugins/SplitText.js +20 -12
package/package.json
CHANGED
package/plugins/Observer.js
CHANGED
|
@@ -7,6 +7,7 @@ const DEFAULTS = {
|
|
|
7
7
|
start: "top bottom",
|
|
8
8
|
end: "bottom top",
|
|
9
9
|
scrub: false,
|
|
10
|
+
once: true,
|
|
10
11
|
markers: false,
|
|
11
12
|
}
|
|
12
13
|
|
|
@@ -21,6 +22,7 @@ export default class Observer extends Emitter {
|
|
|
21
22
|
start: this.opts.start,
|
|
22
23
|
end: this.opts.end,
|
|
23
24
|
scrub: this.opts.scrub,
|
|
25
|
+
once: this.opts.once,
|
|
24
26
|
markers: this.opts.markers,
|
|
25
27
|
onEnter: self => this.emit("enter", self, this),
|
|
26
28
|
onLeave: self => this.emit("leave", self, this),
|
package/plugins/SplitText.js
CHANGED
|
@@ -24,18 +24,26 @@ export const splitText = data => {
|
|
|
24
24
|
if (filter == "chars") classes.charsClass = `char-${i} chr-++`
|
|
25
25
|
})
|
|
26
26
|
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
27
|
+
document.fonts.ready
|
|
28
|
+
.then(() => {
|
|
29
|
+
console.log("--FONT READY--")
|
|
30
|
+
|
|
31
|
+
const splitText = new SplitText(el, {
|
|
32
|
+
type: dataset.toString(),
|
|
33
|
+
...classes,
|
|
34
|
+
})
|
|
35
|
+
|
|
36
|
+
splits.push(splitText)
|
|
37
|
+
|
|
38
|
+
if (splitted == totalSplits) {
|
|
39
|
+
setTimeout(() => {
|
|
40
|
+
emitter.emit(EVENTS.APP_SPLITTEXT_READY, splits)
|
|
41
|
+
}, 0) // Use a small delay to ensure the event listener is set up
|
|
42
|
+
}
|
|
43
|
+
})
|
|
44
|
+
.catch(error => {
|
|
45
|
+
console.error("Error loading fonts:", error)
|
|
46
|
+
})
|
|
39
47
|
})
|
|
40
48
|
|
|
41
49
|
return emitter
|