tweak upcoming design, use bgpig on event pages

This commit is contained in:
elisejakob
2024-05-23 00:00:33 +02:00
parent 259307c550
commit f22b110bf0
8 changed files with 54 additions and 31 deletions

View File

@ -15,6 +15,7 @@ import { useInView } from "react-intersection-observer";
export const BgPig = ({
type,
color,
}: {
type:
| "logo"
@ -28,11 +29,16 @@ export const BgPig = ({
| "key"
| "chill"
| "peek";
color: "neufPink" | "white" | "goldenBeige";
}) => {
const { ref: observer, inView: IsInView } = useInView({ triggerOnce: false });
return (
<div className={styles.bgPigWrapper}>
<div className={`${styles.pig} ${styles.bgPig}`} data-inview={IsInView}>
<div
className={`${styles.pig} ${styles.bgPig}`}
style={{ "--color-pig": color }}
data-inview={IsInView}
>
{type === "logo" && <LogoPig />}
{type === "music" && <MusicPig />}
{type === "drink" && <DrinkPig />}

View File

@ -7,13 +7,16 @@
}
}
.bgPigWrapper {
--color-pig: var(--color-neufPink);
}
.bgPig {
position: fixed;
bottom: 0;
right: 0;
transform: translate(1vw, 20%);
z-index: 600;
--color-pig: var(--color-neufPink);
z-index: 1;
transition: opacity .6s ease;
&[data-inview=true] {
@ -23,6 +26,5 @@
.observer {
position: absolute;
bottom: -5rem;
right: 0;
}