The Postgres development platform. Supabase gives you a dedicated Postgres database to build your web, mobile, and AI applications.
TypeScript aialternativeauthdatabasedenoembeddingsexamplefirebasenextjsoauth2pgvectorpostgispostgrespostgresqlpostgrestrealtimesupabasevectorswebsockets
LW7: Optimize performance
Francesco Sansalvadore8e2033e4b812
diff --git a/apps/www/components/LaunchWeek/LaunchSection/LaunchWeekLogoHeader.tsx b/apps/www/components/LaunchWeek/LaunchSection/LaunchWeekLogoHeader.tsxindex c2c472c0007..6c690cf662c 100644--- a/apps/www/components/LaunchWeek/LaunchSection/LaunchWeekLogoHeader.tsx+++ b/apps/www/components/LaunchWeek/LaunchSection/LaunchWeekLogoHeader.tsx@@ -1,16 +1,20 @@import classNames from 'classnames'import styleUtils from '~/components/LaunchWeek/Ticket/utils.module.css'import Image from 'next/image'+import { motion } from 'framer-motion'export function LaunchWeekLogoHeader() {return (<div className="flex flex-col gap-3 items-center justify-center xl:justify-start">- <div+ <motion.divclassName={classNames(styleUtils.appear,styleUtils['appear-first'],'flex flex-col justify-center gap-3')}+ initial={{ y: -20, opacity: 0 }}+ animate={{ y: 0, opacity: 1 }}+ transition={{ ease: 'circOut', delay: 0.2, duration: 0.8 }}><h1 className="flex gap-[24px] justify-center font-normal uppercase text-[32px] items-center"><span className="tracking-[4px] text-white">Launch week</span>@@ -19,7 +23,7 @@ export function LaunchWeekLogoHeader() {</span></h1><p className="text-white text-sm text-center">April 3rd – 7th at 6 AM PT | 9 AM ET</p>- </div>+ </motion.div></div>)}diff --git a/apps/www/components/LaunchWeek/LaunchSection/LaunchWeekPrizeCard.tsx b/apps/www/components/LaunchWeek/LaunchSection/LaunchWeekPrizeCard.tsxindex b1525346f30..d870adfd931 100644--- a/apps/www/components/LaunchWeek/LaunchSection/LaunchWeekPrizeCard.tsx+++ b/apps/www/components/LaunchWeek/LaunchSection/LaunchWeekPrizeCard.tsx@@ -1,23 +1,49 @@import Image from 'next/image'import React from 'react'+import { motion } from 'framer-motion'++type animateFromType = 'left' | 'right' | 'up' | 'down' | 'opacityOnly'export default function LaunchWeekPrizeCard({imageUrl,imageWrapperClassName,content,className,+ animateFrom,}: {imageUrl: stringimageWrapperClassName?: stringcontent: anyclassName?: string+ animateFrom?: animateFromType}) {+ const finalState = { x: 0, y: 0, opacity: 1 }++ function getAnimationFrom(animationDirection: animateFromType) {+ switch (animationDirection) {+ case 'left':+ return { x: -20, opacity: 0 }+ case 'up':+ return { y: -20, opacity: 0 }+ case 'right':+ return { x: 20, opacity: 0 }+ case 'down':+ return { y: 20, opacity: 0 }+ case 'opacityOnly':+ return { opacity: 0 }+ }+ }+return (- <div+ <motion.divclassName={['relative p-[1px] bg-gradient-to-b from-[#484848] to-[#1C1C1C] rounded-lg overflow-hidden shadow-lg',className && className,].join(' ')}+ initial={animateFrom ? getAnimationFrom(animateFrom) : finalState}+ whileInView={finalState}+ viewport={{ once: true, margin: '-50px' }}+ transition={{ type: 'spring', bounce: 0, delay: 0.5 }}><div className="relative h-full flex flex-col bg-[#1C1C1C] rounded-lg overflow-hidden"><div@@ -30,6 +56,6 @@ export default function LaunchWeekPrizeCard({</div><div className="p-4">{content && content}</div></div>- </div>+ </motion.div>)}diff --git a/apps/www/components/LaunchWeek/LaunchSection/LaunchWeekPrizeSection.tsx b/apps/www/components/LaunchWeek/LaunchSection/LaunchWeekPrizeSection.tsxindex c944cd2fa92..8328caaac7d 100644--- a/apps/www/components/LaunchWeek/LaunchSection/LaunchWeekPrizeSection.tsx+++ b/apps/www/components/LaunchWeek/LaunchSection/LaunchWeekPrizeSection.tsx@@ -2,13 +2,22 @@ import Image from 'next/image'import React from 'react'import LabelBadge from '../LabelBadge'import LaunchWeekPrizeCard from './LaunchWeekPrizeCard'+import { motion } from 'framer-motion'export default function LaunchWeekPrizeSection() {+ const finalAnimationState = { y: 0, opacity: 1 }+return (<div><div className=""><div className="text-center relative z-10 text-white -mt-60">- <div className="max-w-[38rem] mx-auto px-4 flex flex-col items-center gap-4">+ <motion.div+ className="max-w-[38rem] mx-auto px-4 flex flex-col items-center gap-4"+ initial={{ y: -20, opacity: 0 }}+ whileInView={finalAnimationState}+ viewport={{ once: true, margin: '-150px' }}+ transition={{ type: 'spring', bounce: 0, delay: 0.2 }}+ ><div className="w-[40px] h-[40px] rounded-sm bg-[#32313F] flex items-center justify-center"><svgwidth="21"@@ -38,7 +47,6 @@ export default function LaunchWeekPrizeSection() {</defs></svg></div>- {/* <Image src="/images/launchweek/seven/lw7-seven.svg" width={40} height={40} /> */}<h2 className="text-4xl">Get your <span className="gradient-text-pink-500">winning ticket</span></h2>@@ -46,7 +54,7 @@ export default function LaunchWeekPrizeSection() {Mark your calendars for April 9th and join us on Discord for Launch Week 7's final dayto find out if you're one of the lucky winners. Get sharing!</p>- </div>+ </motion.div></div><div className="px-4 pt-24"><div className="grid grid-cols-1 md:grid-cols-2 col-span-2 lg:grid-cols-5 gap-4 max-w-7xl mx-auto text-white">@@ -54,6 +62,7 @@ export default function LaunchWeekPrizeSection() {imageUrl="/images/launchweek/seven/keyboard.jpg"imageWrapperClassName="h-[40vw] lg:max-h-[360px]"className="col-span-2 lg:col-span-3"+ animateFrom="left"content={<><h3 className="gradient-text-purple-500 font-mono uppercase font-medium">@@ -85,6 +94,7 @@ export default function LaunchWeekPrizeSection() {Supa T-shirt <LabelBadge text="10 shirts" /></h3>}+ animateFrom="up"/><LaunchWeekPrizeCardimageUrl="/images/launchweek/seven/socks.jpg"@@ -94,11 +104,13 @@ export default function LaunchWeekPrizeSection() {Supa Socks <LabelBadge text="5 pairs" /></h3>}+ animateFrom="right"/></div><LaunchWeekPrizeCardimageUrl="/images/launchweek/seven/stickers.jpg"imageWrapperClassName="h-[40vw] lg:max-h-[175px] lg:h-auto"+ animateFrom="down"content={<h3 className="text-sm flex items-center gap-4">Launch Week 7 Limited Edition Sticker Pack <LabelBadge text="20 packs" />diff --git a/apps/www/pages/launch-week/index.tsx b/apps/www/pages/launch-week/index.tsxindex 661a0852231..1522a58de42 100644--- a/apps/www/pages/launch-week/index.tsx+++ b/apps/www/pages/launch-week/index.tsx@@ -36,7 +36,6 @@ export default function TicketHome({ users }: Props) {const isLauchWeekPage = pathname.includes('launch-week')const ticketNumber = query.ticketNumber?.toString()const { scrollYProgress } = useScroll()- const [scrollY, setScrollY] = useState(0)const defaultUserData = {id: query.id?.toString(),@@ -73,28 +72,19 @@ export default function TicketHome({ users }: Props) {document.body.className = isDarkMode ? 'dark bg-[#121212]' : 'light bg-[#fff]'}, [isDarkMode])- scrollYProgress.onChange((number) => setScrollY(number))-- const gradientOpacity = useTransform(- scrollYProgress,- // Map scrollYProgress from these values:- [0.01, 0.2],- // Into these opacity values:- [0.2, 1]- )const graphicsScale = useTransform(scrollYProgress,// Map scrollYProgress from these values:[0, 0.5],// Into these scale values:- [1, 1.5]+ [1, 1.8])const graphicsY = useTransform(scrollYProgress,// Map scrollYProgress from these values:[0, 0.5],// Into these values:- [0, 80]+ [0, 120])return (@@ -139,11 +129,16 @@ export default function TicketHome({ users }: Props) {</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 transform scale-125"- style={{ scale: graphicsScale, y: graphicsY, willChange: 'transform' }}+ 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.svg"+ src="/images/launchweek/seven/lw-7-bg.png"+ loading="eager"layout="fill"objectFit="cover"/>@@ -151,13 +146,7 @@ export default function TicketHome({ users }: Props) {</div></div>{/* TODO: set gold gradient if ticket is gold */}- <motion.div- className={[- 'bg-lw7-gradient absolute inset-0 z-0',- scrollY < 0.01 && 'gradient-pulse',- ].join(' ')}- style={{ opacity: gradientOpacity }}- />+ <div className="bg-lw7-gradient absolute inset-0 z-0" /></div><LaunchWeekPrizeSection />diff --git a/apps/www/pages/launch-week/launchWeek.css b/apps/www/pages/launch-week/launchWeek.cssindex 0a74bbee576..aaaea80d556 100644--- a/apps/www/pages/launch-week/launchWeek.css+++ b/apps/www/pages/launch-week/launchWeek.css@@ -11,10 +11,6 @@background: radial-gradient(72.03% 66.03% at 50% 69.72%, #3fcf8e 0%, transparent 100%);}-.gradient-pulse {- animation: gradient-pulse 1s ease-in-out infinite alternate both;-}-.glass-tile-gradient {position: absolute;@@ -39,12 +35,3 @@transform: translate3D(0, 5px, 0);}}--@keyframes gradient-pulse {- 0% {- opacity: 0;- }- 100% {- opacity: 0.5;- }-}diff --git a/apps/www/public/images/launchweek/seven/lw-7-bg.png b/apps/www/public/images/launchweek/seven/lw-7-bg.pngnew file mode 100644index 00000000000..285707ad369Binary files /dev/null and b/apps/www/public/images/launchweek/seven/lw-7-bg.png differ