Giter Club home page Giter Club logo

Comments (9)

lukePeavey avatar lukePeavey commented on September 18, 2024 1

Yeah, I see what you mean. I'll take another look.

from splittype.

lukePeavey avatar lukePeavey commented on September 18, 2024

Hey I'd be happy to take a look at this...

Are you seeing a visible change in character spacing after the text is rendered?

from splittype.

lukePeavey avatar lukePeavey commented on September 18, 2024

Do you want me to reopen this?

from splittype.

helloganiel avatar helloganiel commented on September 18, 2024

Hello Luke, after reloading the page you can already see the change. Yes, it is quite visible, see this: https://streamable.com/atv8lo

from splittype.

lukePeavey avatar lukePeavey commented on September 18, 2024

Can you share the source code for this page? The text is split into lines, and the whole paragraph is wrapped as a single line element. This is usually a sign that split type is being called before the layout has rendered.

image

Are you using a react or something similar ?

from splittype.

helloganiel avatar helloganiel commented on September 18, 2024

No I am not using react, just webflow with codesandbox linked in.

Here you can preview my webflow site:

https://preview.webflow.com/preview/madebyblank?utm_medium=preview_link&utm_source=designer&utm_content=madebyblank&preview=f8e76df79c2cefaef02b3dde9996a0ce&pageId=62f39c2beafac58c606400d5&workflow=preview

and here is the code for splitting and animating with gsap:

let typeSplit = new SplitType("[text-split]", {
  types: "words, lines, chars",
  tagName: "span"
});

// Link timelines to scroll position
function createScrollTrigger(triggerElement, timeline) {
  // Play tl when scrolled into view (60% from top of screen)
  ScrollTrigger.create({
    trigger: triggerElement,
    start: "top 80%",
    onEnter: () => timeline.play()
  });
}

$("[words-slide-up]").each(function (index) {
  let tl = gsap.timeline({ paused: true });
  tl.from($(this).find(".word"), {
    rotation: 7,
    autoAlpha: 0,
    yPercent: 50,
    duration: 0.6,
    ease: "Expo.easeOut",
    stagger: { each: 0.066 }
  });
  createScrollTrigger($(this), tl);
});

from splittype.

lukePeavey avatar lukePeavey commented on September 18, 2024

This issue is most likely related to using SplitType within WebFlow.

Unfortunately i'm not really familiar with WebFlow. But you need to ensure that SplitType is executed after the page content is fully rendered. If WebFlow is applying dynamic styles to the content at run time, you would need to make sure that SplitType executes after those styles have been applied.

A few things you could try for debugging...

  • Remove all the animation code from your javascript, and just include the calls to splitType. See if the text is split into the correct html structure without a visible change.
  • Try wrapping your javascript in a setTimeout with a of a delay of few seconds.
  • Try wrapping your javascript in an event listener on window "load"
  • try disabling any other animations or transitions on the page

from splittype.

helloganiel avatar helloganiel commented on September 18, 2024

Thanks, I'll try everything, but the split type in the chars is moving the kerning, even if I fix the issue when loading after the content is fully rendered, doesn't it still look "bad"(kerning)?

from splittype.

lukePeavey avatar lukePeavey commented on September 18, 2024

I'm going to close this. Sorry I wasn't able to resolve this.

from splittype.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.