Nightshift Posted January 13, 2025 Posted January 13, 2025 I have some very simple code with SplitText: document.fonts.ready.then(() => { const texts = document.querySelectorAll("[text-animation]"); if (!texts) return; let splitText; function runSplit() { splitText = new SplitText("[text-animation]", { types: "lines", linesClass: "line", }); } runSplit(); }); For some reason, SplitText seems to be creating multiple nested ".line" divs, I've also noticed the same behaviour when using words. The only CSS applied to the text is color and font size. Any idea on why this may be happening?
Solution PointC Posted January 13, 2025 Solution Posted January 13, 2025 You'd want type: "lines" in the config. You currently have "types" so it looks like SplitText is back to the default of characters, words and lines. Happy tweening. 3
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now