LW7: Add lw7 graphic to ticket username page

This commit is contained in:
Francesco Sansalvadore committed 2023-03-06 09:19:32 +01:00
1 parent 8e2033e4b8
commit 109f71f792
4 files changed
+71 -38

No files matched your search

@@ -0,0 +1,41 @@
import { motion, useScroll, useTransform } from 'framer-motion'
import Image from 'next/image'
export default function LW7BgGraphic() {
const { scrollYProgress } = useScroll()
const graphicsScale = useTransform(
scrollYProgress,
// Map scrollYProgress from these values:
[0, 0.5],
// Into these scale values:
[1, 1.8]
)
const graphicsY = useTransform(
scrollYProgress,
// Map scrollYProgress from these values:
[0, 0.5],
// Into these values:
[0, 120]
)
return (
<div className="mt-8 relative h-[640px] overflow-hidden before:content[' '] before:absolute before:bottom-0 before:h-[400px] before:z-20 before:w-full before:bg-gradient-to-t before:from-[#1C1C1C] before:via-[#1C1C1C40] before:to-transparent">
<motion.div
className="absolute bottom-0 w-full h-full mt-40"
style={{
scale: graphicsScale,
y: graphicsY,
willChange: 'transform',
}}
>
<Image
src="/images/launchweek/seven/lw-7-bg.png"
loading="eager"
layout="fill"
objectFit="cover"
/>
</motion.div>
</div>
)
}
@@ -4,13 +4,13 @@ import LabelBadge from '../LabelBadge'
import LaunchWeekPrizeCard from './LaunchWeekPrizeCard'
import { motion } from 'framer-motion'
export default function LaunchWeekPrizeSection() {
export default function LaunchWeekPrizeSection({ className }: { className?: string }) {
const finalAnimationState = { y: 0, opacity: 1 }
return (
<div>
<div className={[className].join(' ')}>
<div className="">
<div className="text-center relative z-10 text-white -mt-60">
<div className="text-center relative z-10 text-white">
<motion.div
className="max-w-[38rem] mx-auto px-4 flex flex-col items-center gap-4"
initial={{ y: -20, opacity: 0 }}
+3 -18
View File
@@ -15,6 +15,7 @@ import { LaunchWeekLogoHeader } from '~/components/LaunchWeek/LaunchSection/Laun
import { UserData } from '~/components/LaunchWeek/Ticket/hooks/use-conf-data'
import TicketBrickWall from '~/components/LaunchWeek/LaunchSection/TicketBrickWall'
import Image from 'next/image'
import LW7BgGraphic from '../../components/LaunchWeek/LW7BgGraphic'
interface Props {
users: UserData[]
@@ -127,29 +128,13 @@ export default function TicketHome({ users }: Props) {
</a>
</div>
</SectionContainer>
<div className="mt-8 relative h-[640px] overflow-hidden before:content[' '] before:absolute before:bottom-0 before:h-[400px] before:z-20 before:w-full before:bg-gradient-to-t before:from-[#1C1C1C] before:via-[#1C1C1C40] before:to-transparent">
<motion.div
className="absolute bottom-0 w-full h-full mt-40"
style={{
scale: graphicsScale,
y: graphicsY,
willChange: 'transform',
}}
>
<Image
src="/images/launchweek/seven/lw-7-bg.png"
loading="eager"
layout="fill"
objectFit="cover"
/>
</motion.div>
</div>
<LW7BgGraphic />
</div>
{/* TODO: set gold gradient if ticket is gold */}
<div className="bg-lw7-gradient absolute inset-0 z-0" />
</div>
<LaunchWeekPrizeSection />
<LaunchWeekPrizeSection className="-mt-60" />
{users && <TicketBrickWall users={users} />}
</div>
@@ -13,6 +13,7 @@ import LaunchWeekPrizeSection from '~/components/LaunchWeek/LaunchSection/Launch
import { LaunchWeekLogoHeader } from '~/components/LaunchWeek/LaunchSection/LaunchWeekLogoHeader'
import TicketBrickWall from '~/components/LaunchWeek/LaunchSection/TicketBrickWall'
import { UserData } from '~/components/LaunchWeek/Ticket/hooks/use-conf-data'
import LW7BgGraphic from '../../../components/LaunchWeek/LW7BgGraphic'
interface Props {
user: UserData
@@ -62,23 +63,29 @@ export default function TicketShare({ user, users }: Props) {
}}
/>
<DefaultLayout>
<div className="bg-lw7 -mt-20 pt-12">
<SectionContainer className="flex flex-col !pb-1 items-center lg:pt-32 gap-24">
<LaunchWeekLogoHeader />
<TicketContainer
supabase={supabase}
session={null}
defaultUserData={{
username: username || undefined,
name: name || '',
ticketNumber,
golden,
referrals,
}}
sharePage
/>
</SectionContainer>
<LaunchWeekPrizeSection />
<div className="bg-[#1C1C1C] -mt-20">
<div className="relative bg-lw7 pt-20">
<div className="relative z-10">
<SectionContainer className="flex flex-col !pb-1 items-center lg:pt-32 gap-24">
<LaunchWeekLogoHeader />
<TicketContainer
supabase={supabase}
session={null}
defaultUserData={{
username: username || undefined,
name: name || '',
ticketNumber,
golden,
referrals,
}}
sharePage
/>
</SectionContainer>
<LW7BgGraphic />
</div>
<div className="bg-lw7-gradient absolute inset-0 z-0" />
</div>
<LaunchWeekPrizeSection className="-mt-60" />
<TicketBrickWall users={users} />
</div>
</DefaultLayout>