Skip to content

Commit

Permalink
attempt removechild fix
Browse files Browse the repository at this point in the history
  • Loading branch information
connorrothschild committed Dec 9, 2021
1 parent a569f87 commit b60f02a
Showing 1 changed file with 58 additions and 52 deletions.
110 changes: 58 additions & 52 deletions src/lib/Transition.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -18,65 +18,71 @@
subtitle = document.querySelectorAll(".transition-subtitle");
content = document.querySelectorAll(".transition-content");
content.forEach((d) => {
gsap.set(d, { opacity: 0 });
gsap.fromTo(
d,
{ opacity: startingOpacity },
{ opacity: 1, duration: 0.5, delay: 0.5 }
);
});
if (content.length > 0) {
content.forEach((d) => {
gsap.set(d, { opacity: 0 });
gsap.fromTo(
d,
{ opacity: startingOpacity },
{ opacity: 1, duration: 0.5, delay: 0.5 }
);
});
}
if (title.length > 0) {
title.forEach((d) => {
gsap.set(d, { opacity: 0 });
gsap.fromTo(
d,
{ opacity: startingOpacity },
{ opacity: 1, duration: 1.5 }
);
title.forEach((d) => {
gsap.set(d, { opacity: 0 });
gsap.fromTo(
d,
{ opacity: startingOpacity },
{ opacity: 1, duration: 1.5 }
);
const titleSplit = new SplitText(d, {
type: "lines,words,chars",
});
const titleSplit = new SplitText(d, {
type: "lines,words,chars",
gsap.fromTo(
titleSplit[split],
{ y: "100%", opacity: startingOpacity, rotation: 0 },
{
y: 0,
opacity: 1,
rotation: 0,
stagger: stagger,
duration: 0.5,
ease: "power2.out",
}
);
});
}
gsap.fromTo(
titleSplit[split],
{ y: "100%", opacity: startingOpacity, rotation: 0 },
{
y: 0,
opacity: 1,
rotation: 0,
stagger: stagger,
duration: 0.5,
ease: "power2.out",
}
);
});
if (subtitle.length > 0) {
subtitle.forEach((d) => {
gsap.set(d, { opacity: startingOpacity });
gsap.fromTo(
d,
{ opacity: startingOpacity },
{ opacity: 1, duration: 1.5 }
);
subtitle.forEach((d) => {
gsap.set(d, { opacity: startingOpacity });
gsap.fromTo(
d,
{ opacity: startingOpacity },
{ opacity: 1, duration: 1.5 }
);
const subtitleSplit = new SplitText(d, {
type: "lines,words,chars",
});
const subtitleSplit = new SplitText(d, {
type: "lines,words,chars",
gsap.fromTo(
subtitleSplit["words"],
{ y: "100%", opacity: startingOpacity },
{
y: 0,
opacity: 1,
stagger: 0.02,
duration: 0.5,
ease: "backwards",
}
);
});
gsap.fromTo(
subtitleSplit["words"],
{ y: "100%", opacity: startingOpacity },
{
y: 0,
opacity: 1,
stagger: 0.02,
duration: 0.5,
ease: "backwards",
}
);
});
}
}
import { sleep } from "../scripts/utils.js";
Expand Down

0 comments on commit b60f02a

Please sign in to comment.