Skip to content

Commit 340ec13

Browse files
authored
Recenter illustration (#115)
1 parent 88a8565 commit 340ec13

File tree

1 file changed

+22
-10
lines changed

1 file changed

+22
-10
lines changed

src/hero-illustration/hero-illustration-bologna.tsx

Lines changed: 22 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -650,17 +650,19 @@ export const HeroIllustrationBologna = ({
650650

651651
const [scope, animate] = useAnimate();
652652
const snakeScaleX = useMotionValue(1);
653-
const snakeX = useMotionValue(400);
653+
const snakeX = useMotionValue(200);
654654
const snakeY = useMotionValue(600);
655655
const snakeTailX = useMotionValue(1300);
656656
const snakeTailY = useMotionValue(600);
657657
const snakeOpacity = useMotionValue(0);
658-
const cocktailX = useMotionValue(50);
658+
const cocktailX = useMotionValue(-150);
659659
const cocktailOpacity = useMotionValue(0);
660660
const nightTailOpacity = useMotionValue(0);
661661
const backgroundColor = useMotionValue(isNight ? "#151C28" : "#6A80EF");
662662

663-
const cocktailXEnd = -180;
663+
const snakeXEnd = -560;
664+
const snakeXEndNight = -520;
665+
const cocktailXEnd = -350;
664666

665667
const animateClouds = (enter: boolean, delay = 0.2) => {
666668
animate(
@@ -703,7 +705,11 @@ export const HeroIllustrationBologna = ({
703705
delay: 0,
704706
ease: "easeInOut",
705707
});
706-
animate(snakeX, -360, { duration: 2.4, delay: 0, ease: "easeInOut" });
708+
animate(snakeX, snakeXEnd, {
709+
duration: 2.4,
710+
delay: 0,
711+
ease: "easeInOut",
712+
});
707713
});
708714

709715
animateClouds(true);
@@ -713,7 +719,7 @@ export const HeroIllustrationBologna = ({
713719
nightTailOpacity.set(1);
714720
cocktailOpacity.set(1);
715721
snakeOpacity.set(1);
716-
snakeX.set(-360);
722+
snakeX.set(snakeXEndNight);
717723
snakeScaleX.set(-1);
718724

719725
animate(snakeY, -60, { duration: 0.5, delay: 1.4, ease: "linear" });
@@ -770,6 +776,12 @@ export const HeroIllustrationBologna = ({
770776
),
771777
]);
772778

779+
if (!isNight) {
780+
snakeX.set(snakeXEndNight);
781+
} else {
782+
snakeX.set(snakeXEnd);
783+
}
784+
773785
nightTailOpacity.set(isNight ? 0 : 1);
774786
cocktailOpacity.set(isNight ? 0 : 1);
775787
snakeScaleX.set(isNight ? 1 : -1);
@@ -805,9 +817,9 @@ export const HeroIllustrationBologna = ({
805817
<div className="landmark absolute -bottom-full flex justify-center min-w-full z-[5] left-1/2 -translate-x-1/2">
806818
<AnimatePresence>
807819
<motion.div
808-
className="relative left-[-550px] top-[-550px]"
820+
className="relative left-[-750px]"
809821
initial={{ top: 0 }}
810-
animate={{ top: -550 }}
822+
animate={{ top: -650 }}
811823
exit={{ top: 0 }}
812824
key={isNight ? "moon" : "sun"}
813825
transition={{ duration: 0.5 }}
@@ -844,12 +856,12 @@ export const HeroIllustrationBologna = ({
844856
<Cocktail />
845857
</motion.div>
846858

847-
<div className="relative z-20">
859+
<div className="relative z-20 -translate-x-[150px]">
848860
<Church onClick={toggle} />
849861
</div>
850862

851863
<motion.div
852-
className="night-tail absolute bottom-[275px] left-[180px] min-w-full flex justify-center z-30 pointer-events-none"
864+
className="night-tail absolute bottom-[285px] left-[-80px] min-w-full flex justify-center z-30 pointer-events-none"
853865
style={{
854866
opacity: nightTailOpacity,
855867
}}
@@ -862,7 +874,7 @@ export const HeroIllustrationBologna = ({
862874

863875
<motion.div
864876
className="landmark two-towers absolute -bottom-full min-w-full flex justify-center z-30 left-1/2 -translate-x-1/2 pointer-events-none"
865-
animate={{ x: "-50%", translateX: 550 }}
877+
animate={{ x: "-50%", translateX: 360 }}
866878
>
867879
<div>
868880
<TwoTowers />

0 commit comments

Comments
 (0)