Skip to content

Instantly share code, notes, and snippets.

View julianbenegas's full-sized avatar
💭
Working on BaseHub!

Julian Benegas julianbenegas

💭
Working on BaseHub!
View GitHub Profile
@julianbenegas
julianbenegas / get-tween-times.ts
Created May 9, 2023 20:06 — forked from justkahdri/get-tween-times.ts
Get partial tween start and end marks for the @bsmnt/scrollytelling Animation component
const getTweenTimes = (
totalStart: number,
totalEnd: number,
partialStart: number,
partialEnd: number
) => {
const start = (totalEnd - totalStart) * (partialStart / 100) + totalStart
const end = Math.min(
(totalEnd - totalStart) * (partialEnd / 100) + totalStart,
100