Skip to content

The Postgres development platform. Supabase gives you a dedicated Postgres database to build your web, mobile, and AI applications.

LW7: polish ticket details

Francesco Sansalvadore27b0b623169b
diff --git a/apps/www/components/LaunchWeek/LaunchSection/TicketBrickWall.tsx b/apps/www/components/LaunchWeek/LaunchSection/TicketBrickWall.tsx
index ad5fe5db6c5..841653778f0 100644
--- a/apps/www/components/LaunchWeek/LaunchSection/TicketBrickWall.tsx
+++ b/apps/www/components/LaunchWeek/LaunchSection/TicketBrickWall.tsx
@@ -12,7 +12,7 @@ interface Props {
export default function TicketBrickWall({ users }: Props) {
return (
- <div className="relative">
+ <div className="relative py-36">
<div
className={[
'absolute top-[196px] w-[475px] h-[420px] z-10 left-[-130px] rotate-90',
diff --git a/apps/www/components/LaunchWeek/Ticket/ActualTicket.tsx b/apps/www/components/LaunchWeek/Ticket/ActualTicket.tsx
index 1793212fcb1..ba8c20579bf 100644
--- a/apps/www/components/LaunchWeek/Ticket/ActualTicket.tsx
+++ b/apps/www/components/LaunchWeek/Ticket/ActualTicket.tsx
@@ -1,6 +1,5 @@
import cn from 'classnames'
-import Tilt from 'vanilla-tilt'
-import { useRef, useEffect, useState } from 'react'
+import { useRef, useState } from 'react'
import styles from './ticket.module.css'
import styleUtils from './utils.module.css'
import TicketVisual from './TicketVisual'
@@ -33,40 +32,26 @@ export default function Ticket({
bgImageId,
referrals,
}: Props) {
- const ticketRef = useRef<HTMLDivElement>(null)
const [ticketGenerationState, setTicketGenerationState] =
useState<TicketGenerationState>('default')
const divRef = useRef<HTMLDivElement>(null)
const winningChances = useWinningChances()
- useEffect(() => {
- if (ticketRef.current && !window.matchMedia('(pointer: coarse)').matches) {
- Tilt.init(ticketRef.current, {
- glare: false,
- max: 4,
- 'max-glare': 0.1,
- 'full-page-listening': true,
- })
- }
- }, [ticketRef])
-
return (
<div
className="w-full max-w-[800px] xl:max-w-[1100px] flex flex-col items-center xl:grid xl:grid-cols-12 gap-4 xl:gap-8 p-2 bg-[#a988d748] rounded-2xl xl:items-stretch h-auto"
id="wayfinding--ticket-visual-wrapper-container"
>
<div
- className={cn(styles['ticket-visual-wrapper'], 'flex items-stretch col-span-8')}
+ className={cn(styles['ticket-visual-wrapper'], 'flex-1 col-span-8')}
id="wayfinding--ticket-visual-wrapper"
>
<div
- ref={ticketRef}
className={cn(
styles['ticket-visual'],
styleUtils.appear,
styleUtils['appear-fourth'],
- username ? 'h-[400px]' : 'h-[395px]',
- 'relative flex flex-col gap-2 w-full h-full rounded-xl'
+ 'relative flex flex-col gap-2 w-full h-fit rounded-xl'
)}
id="wayfinding--ticket-visual-outer-container"
>
@@ -85,23 +70,6 @@ export default function Ticket({
</div>
)}
</div>
- {!sharePage && (
- <>
- {username ? (
- <div className="flex flex-col gap-6 py-4 mx-3">
- {/* <div>
- <TicketCopy username={username} />
- </div> */}
- {/* <div className={`flex flex-col xl:flex-row gap-3 items-center justify-center`}>
- <TicketActions username={username} golden={golden} />
- </div> */}
- </div>
- ) : (
- <></>
- // <div className={styles['ticket-actions-placeholder']} />
- )}
- </>
- )}
</div>
<div
ref={divRef}
diff --git a/apps/www/components/LaunchWeek/Ticket/TicketHeader.tsx b/apps/www/components/LaunchWeek/Ticket/TicketHeader.tsx
index 286be3ab0ce..13c190544f9 100644
--- a/apps/www/components/LaunchWeek/Ticket/TicketHeader.tsx
+++ b/apps/www/components/LaunchWeek/Ticket/TicketHeader.tsx
@@ -7,7 +7,7 @@ interface Props {
export default function TicketHeader({ size }: Props) {
return (
<div className="flex w-full justify-center pt-4" id="wayfinding--ticket-header">
- <div className="flex flex-col xs:flex-row gap-1 justify-center items-center xs:gap-5">
+ <div className="flex flex-col md:flex-row gap-1 justify-center items-center md:gap-5">
<img
className={size === 'small' ? 'w-[165px]' : 'w-[224px]'}
src={`/images/launchweek/ticket-header-logo.png`}
diff --git a/apps/www/components/LaunchWeek/Ticket/TicketNumber.tsx b/apps/www/components/LaunchWeek/Ticket/TicketNumber.tsx
index 1645b572c63..27aad7e0ea1 100644
--- a/apps/www/components/LaunchWeek/Ticket/TicketNumber.tsx
+++ b/apps/www/components/LaunchWeek/Ticket/TicketNumber.tsx
@@ -15,7 +15,7 @@ export default function TicketNumber({ number, size }: Props) {
<div
className={[
'flex flex-col md:flex-row items-center justify-center w-full text-center',
- size === 'small' ? 'text-[20px]' : 'text-[30px] md:text-[42px] ',
+ size === 'small' ? 'text-[20px]' : 'text-[34px] md:text-[42px] ',
].join(' ')}
id="wayfinding--ticket-number-inner"
>
@@ -85,8 +85,8 @@ export default function TicketNumber({ number, size }: Props) {
</div>
<div
className={[
- 'md:absolute py-8 md:w-[max-content] leading-[1] bg-clip-text md:transform md:rotate-90 md:origin-center bg-gradient-to-r from-white via-white',
- size === 'small' ? 'md:px-12' : 'md:px-24',
+ 'md:absolute px-12 py-8 md:w-[max-content] leading-[1] md:transform md:rotate-90 md:origin-center bg-gradient-to-r from-[#F8F9FA] via-[#F8F9FA] to-[#F8F9FA60] bg-clip-text text-transparent text-center',
+ size === 'small' ? 'md:px-12' : 'xs:px-24',
].join(' ')}
>
№ {prefix}
diff --git a/apps/www/components/LaunchWeek/Ticket/TicketProfile.tsx b/apps/www/components/LaunchWeek/Ticket/TicketProfile.tsx
index 2937a807991..09c6fd09f54 100644
--- a/apps/www/components/LaunchWeek/Ticket/TicketProfile.tsx
+++ b/apps/www/components/LaunchWeek/Ticket/TicketProfile.tsx
@@ -68,9 +68,7 @@ export default function TicketProfile({
<div
className={`${cn(styles.skeleton, styles.wrapper, {
[styles.show]: ticketGenerationState === 'loading',
- })} text-2xl sm:text-4xl bg-gradient-to-r ${
- golden ? 'to-[#ffe8af]' : 'to-slate-900'
- } from-white via-white bg-clip-text text-transparent text-center`}
+ })} text-2xl sm:text-4xl bg-gradient-to-r from-[#F8F9FA] via-[#F8F9FA] to-[#F8F9FA60] bg-clip-text text-transparent text-center`}
>
{name || username || 'Your Name'}
<p>{name && <p className="gradient-text-scale-100 text-sm">@{username}</p>}</p>
diff --git a/apps/www/components/LaunchWeek/Ticket/TicketVisual.tsx b/apps/www/components/LaunchWeek/Ticket/TicketVisual.tsx
index 07e5aad52f7..c3f668d3c29 100644
--- a/apps/www/components/LaunchWeek/Ticket/TicketVisual.tsx
+++ b/apps/www/components/LaunchWeek/Ticket/TicketVisual.tsx
@@ -1,13 +1,12 @@
import styles from './ticket-visual.module.css'
import TicketProfile from './TicketProfile'
import TicketNumber from './TicketNumber'
-import TicketMono from './ticket-mono'
-import TicketMonoMobile from './ticket-mono-mobile'
-import { useRouter } from 'next/router'
+// import TicketMono from './ticket-mono'
+// import TicketMonoMobile from './ticket-mono-mobile'
+import Tilt from 'vanilla-tilt'
import useConfData from '~/components/LaunchWeek/Ticket/hooks/use-conf-data'
import TicketHeader from './TicketHeader'
-import { useState } from 'react'
-import { SupabaseClient } from '@supabase/supabase-js'
+import { useEffect, useRef, useState } from 'react'
import Image from 'next/image'
type TicketGenerationState = 'default' | 'loading'
@@ -33,34 +32,50 @@ export default function TicketVisual({
golden = false,
}: Props) {
const { session } = useConfData()
- // golden = true
-
- const router = useRouter()
- const basePath = router.basePath
- const [supabase, setSupabase] = useState<SupabaseClient | null>(null)
const [imageIsLoading, setImageIsLoading] = useState(true)
- // const randomNumber = Math.floor(Math.random() * 200) + 1
- // const goldRandomNumber = Math.floor(Math.random() * 56) + 1
+ const ticketRef = useRef<HTMLDivElement>(null)
const storageBaseFilepath = `https://obuldanrptloktxcffvn.supabase.co/storage/v1/object/public/images/lw7/tickets_bg`
- const goldenImageId = Math.floor(bgImageId! / 56)
+
+ const ticketBg = {
+ regular: {
+ image: `${storageBaseFilepath}/_jpg/reg_bg_${bgImageId}.jpg`,
+ overlay: `/images/launchweek/seven/ticket-overlay-reg.png`,
+ },
+ gold: {
+ image: `${storageBaseFilepath}/golden/_jpg/gold_bg_${bgImageId}.jpg`,
+ overlay: `/images/launchweek/seven/ticket-overlay-gold.png`,
+ },
+ }
+
+ useEffect(() => {
+ if (ticketRef.current && !window.matchMedia('(pointer: coarse)').matches) {
+ Tilt.init(ticketRef.current, {
+ glare: false,
+ max: 4,
+ 'max-glare': 0.1,
+ 'full-page-listening': true,
+ })
+ }
+ }, [ticketRef])
return (
<div
+ ref={ticketRef}
className={[
styles.visual,
golden ? styles['visual--gold'] : '',
session ? styles['visual--logged-in'] : '',
- 'flex relative flex-col flex-1 justify-between rounded-2xl bg-black w-full h-full box-border before:rounded-2xl',
+ 'flex relative flex-col justify-between rounded-2xl w-full pt-0 md:pt-[50%] h-auto md:h-0 box-border before:rounded-2xl',
].join(' ')}
style={{
['--size' as string]: size,
}}
id="wayfinding--ticket-visual-inner-container"
>
- <div className="relative z-10 flex flex-col items-center justify-between w-full h-full flex-1 md:pr-[110px]">
+ <div className="relative md:absolute inset-0 z-10 flex flex-col items-center justify-between w-full h-full flex-1 md:pl-[6%] md:pr-[15%]">
{username && <TicketHeader />}
<div
- className="flex-1 w-full h-full md:h-auto flex md:pl-2 flex-col justify-center"
+ className="flex-1 w-full h-full md:h-auto flex py-14 md:py-4 flex-col justify-center"
id="wayfinding--TicketProfile-container"
>
<TicketProfile
@@ -74,41 +89,35 @@ export default function TicketVisual({
</div>
</div>
<TicketNumber number={ticketNumber} />
- <div className="hidden md:flex absolute inset-0" id="wayfinding--TicketMono-container">
+ {/* <div className="hidden md:flex absolute inset-0" id="wayfinding--TicketMono-container">
<TicketMono golden={golden} />
</div>
<div className="flex md:hidden absolute inset-0">
<TicketMonoMobile golden={golden} />
- </div>
+ </div> */}
<div
id="wayfinding--ticket-dynamic-bg-image"
className="absolute inset-0 z-0 rounded-2xl overflow-hidden"
>
- <Image
- src={
- golden
- ? `/images/launchweek/seven/ticket-overlay-gold.png`
- : `/images/launchweek/seven/ticket-overlay-reg.png`
- }
- layout="fill"
- objectFit="cover"
- placeholder="blur"
- blurDataURL="/images/blur.png"
- className="absolute inset-0 z-[1] rounded-xl"
- />
+ {username && (
+ <Image
+ src={golden ? ticketBg.gold.overlay : ticketBg.regular.overlay}
+ layout="fill"
+ objectFit="cover"
+ placeholder="blur"
+ blurDataURL="/images/blur.png"
+ className="absolute inset-0 z-[1] rounded-2xl"
+ />
+ )}
<Image
- src={
- golden
- ? `${storageBaseFilepath}/golden/_jpg/gold_bg_${goldenImageId}.jpg`
- : `${storageBaseFilepath}/_jpg/reg_bg_${bgImageId}.jpg`
- }
+ src={golden ? ticketBg.gold.image : ticketBg.regular.image}
layout="fill"
objectFit="cover"
placeholder="blur"
blurDataURL="/images/blur.png"
className={[
- 'duration-700 ease-in-out rounded-xl transform scale-105',
+ 'duration-700 ease-in-out rounded-2xl transform scale-105',
imageIsLoading ? 'grayscale blur-2xl scale-110' : 'grayscale-0 blur-0',
].join(' ')}
onLoadingComplete={() => setImageIsLoading(false)}
diff --git a/apps/www/components/LaunchWeek/Ticket/ticket-profile.module.css b/apps/www/components/LaunchWeek/Ticket/ticket-profile.module.css
index 1885b6e8e35..38f8073715f 100644
--- a/apps/www/components/LaunchWeek/Ticket/ticket-profile.module.css
+++ b/apps/www/components/LaunchWeek/Ticket/ticket-profile.module.css
@@ -135,16 +135,7 @@
.rounded,
.rounded.wrapper::before {
- width: 100px;
- height: 100px;
+ width: calc(110px * var(--size));
+ height: calc(110px * var(--size));
border-radius: 50% !important;
}
-
-@media (min-width: 768px) {
- .rounded,
- .rounded.wrapper::before {
- width: calc(110px * var(--size));
- height: calc(110px * var(--size));
- border-radius: 50% !important;
- }
-}
diff --git a/apps/www/components/LaunchWeek/Ticket/ticket-visual.module.css b/apps/www/components/LaunchWeek/Ticket/ticket-visual.module.css
index b13d1cce098..7f3bab6f014 100644
--- a/apps/www/components/LaunchWeek/Ticket/ticket-visual.module.css
+++ b/apps/www/components/LaunchWeek/Ticket/ticket-visual.module.css
@@ -7,29 +7,15 @@
-webkit-backdrop-filter: blur(2px);
backdrop-filter: blur(2px);
- /* background: linear-gradient(#fff000, var(--gold-secondary)); */
border: 1px solid #b07ada;
- /* animation: blank-svg-shadow 2s ease-in-out infinite alternate; */
animation: 2s ease-in-out infinite alternate;
- /* background-image: url('/images/launchweek/regular-ticket-background.png'); */
background-repeat: no-repeat;
background-size: contain;
}
.visual--gold {
- /* border: 10px solid;
- border-image-slice: 1;
- border-width: 2px;
- border-radius: 16px; */
- /* background-color: linear-gradient(#fff000, #dea513); */
background: radial-gradient(#fcdf9d, #dbb333);
- /* border: 1px solid rgba(255, 255, 0, 0.629); */
- /* animation: svg-shadow 2s ease-in-out infinite alternate; */
- /* background-image: url('/images/launchweek/seven/lw-7-bg.svg'); */
- /* background-image: url('/images/launchweek/gold-ticket-background.png'); */
- /* filter: drop-shadow(2.45223px 8.5828px 73.5669px #FFBD14); */
- /* border-image-source: linear-gradient(to left, var(--gold-secondary), var(--gold-accent)); */
}
.visual--gold::before {
@@ -40,32 +26,8 @@
background: radial-gradient(#fcdf9d, #dbb333);
border: 1px solid rgba(255, 255, 0, 0.629);
animation: opacity-pulse 2s ease-in-out infinite alternate;
- /* background-image: url('/images/launchweek/seven/lw-7-bg.svg'); */
- /* background-image: url('/images/launchweek/gold-ticket-background.png'); */
- /* filter: drop-shadow(2.45223px 8.5828px 73.5669px #FFBD14); */
- /* border-image-source: linear-gradient(to left, var(--gold-secondary), var(--gold-accent)); */
}
-/* .visual--logged-in {
- background-image: url('/images/launchweek/seven/lw-7-bg.svg');
- background-size: cover;
-} */
-
-@media (max-width: 768px) {
- .visual {
- background-size: cover;
-
- background-image: url('/images/launchweek/seven/lw-7-bg.svg');
- }
-
- .visual--gold {
- background-image: url('/images/launchweek/2x-gold-ticket-background.jpg');
- }
-}
-
-/* .svg-shadow {
-} */
-
@keyframes opacity-pulse {
from {
opacity: 0.5;
@@ -102,22 +64,18 @@
top: 0;
width: 100%;
height: 100%;
- /* padding: 46px 29px;/ */
}
.logo img {
- /* margin-top: 64px; */
margin-top: calc(64px * var(--size));
margin-left: calc(32px * var(--size));
margin-left: calc(32px * var(--size));
- /* width: 272px; */
width: calc(272px * var(--size));
}
@media (min-width: 768px) {
.logo img {
margin-top: calc(32px * var(--size));
- /* width: 280px; */
width: calc(280px * var(--size));
margin-left: calc(160px * var(--size));
}
@@ -148,13 +106,10 @@
display: flex;
flex-direction: column;
justify-content: flex-end;
- /* padding: calc(46px * var(--size)) calc(29px * var(--size)); */
}
@media (min-width: 768px) {
.info {
bottom: 0;
- /* padding: 0 calc(160px * var(--size)) calc(44px * var(--size))
- calc(63px * var(--size)); */
}
}