@linear_non/stellar-kit 2.1.3 → 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/index.js +2 -2
- package/package.json +1 -1
- package/plugins/SplitText.js +20 -12
package/index.js
CHANGED
|
@@ -3,9 +3,9 @@ import { Mouse, Resize, Raf, Scroll } from "./events"
|
|
|
3
3
|
import kitStore from "./kitStore"
|
|
4
4
|
import { sniffer } from "./utils"
|
|
5
5
|
|
|
6
|
-
export function setupKit({ isSmooth = sniffer.isDesktop } = {}) {
|
|
6
|
+
export function setupKit({ isSmooth = sniffer.isDesktop, isLocked = false } = {}) {
|
|
7
7
|
kitStore.flags.isSmooth = isSmooth
|
|
8
|
-
kitStore.flags.isLocked =
|
|
8
|
+
kitStore.flags.isLocked = isLocked
|
|
9
9
|
|
|
10
10
|
kitStore.resize = new Resize()
|
|
11
11
|
kitStore.raf = new Raf()
|
package/package.json
CHANGED
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
|