reuters-graphics/graphics-svelte-components

Long-term fixes to lottie-scroller

Opened this issue · 0 comments

  • It's not great that this is using window scroll events instead of IntersectionObserver. Ultimately, use svelte-scroller to handle the scroll detection. The progress binding is what you'd use to calculate the seconds that drive the video.
  • Vanilla rewrites of things like a simple debounce function -- this should just rely on lodash-es
  • I'm curious about the small animation. Does this basically mean you get two breakpoints? Should we plan for future where you might need more? Not sure.
  • Small performance improvement, but I noticed this uses the path config option to pass the lottie data to bodymovin. BUT if we used animationData and directly passed in the JSON data to this component we could save a step waiting for bodymovin to load it and set all the heights for the steps immediately. That'll also make it easy to implement with svelte-scroller if we go that route.
  • [] I'm curious how many types of layout this will support. Maybe in addition to widthRatio there are cases you'd want to set an explicit height?? Not sure...
  • [] Make container width adjustable with wide/wider/widest/fluid etc