Skip to content

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

lw7: fix ticket mobile frame layout and add navigation between pages

Francesco Sansalvadorea9f1833e76ef
diff --git a/apps/www/components/LaunchWeek/LaunchSection/TicketBrickWall.tsx b/apps/www/components/LaunchWeek/LaunchSection/TicketBrickWall.tsx
index 37e95b867c9..74d1293d9b5 100644
--- a/apps/www/components/LaunchWeek/LaunchSection/TicketBrickWall.tsx
+++ b/apps/www/components/LaunchWeek/LaunchSection/TicketBrickWall.tsx
@@ -1,4 +1,6 @@
+import Link from 'next/link'
import React from 'react'
+import { Button } from 'ui'
import { useMobileViewport } from '../../../hooks/useMobileViewport'
import { UserData } from '../Ticket/hooks/use-conf-data'
import { TicketBrickWallRow } from './TicketBrickWallRow'
@@ -14,13 +16,13 @@ export default function TicketBrickWall({ users }: Props) {
return (
<div className="relative pt-28 pb-20 md:pt-40">
<div className="mx-auto bg-[#1C1C1C]">
- <div className="max-w-[38rem] mx-auto">
+ <div className="max-w-[38rem] mb-8 mx-auto">
<h2 className="radial-gradient-text-scale-500 text-center">
Explore the unique tickets generated by our community
</h2>
</div>
<div
- className="grid py-12 relative
+ className="grid py-4 relative
before:content-[' '] before:absolute before:inset-0 before:right-auto before:w-1/4 before:bg-gradient-to-r before:from-[#1C1C1C] before:to-[#1C1C1C00] before:z-10 before:pointer-events-none
after:content-[' '] after:absolute after:inset-0 after:left-auto after:w-1/4 after:bg-gradient-to-l after:from-[#1C1C1C] after:to-[#1C1C1C00] after:z-10 after:pointer-events-none
"
@@ -32,6 +34,13 @@ export default function TicketBrickWall({ users }: Props) {
<TicketBrickWallRow users={users.slice(isMobile ? 5 : 7, isMobile ? 11 : 14)} reverse />
{isMobile && <TicketBrickWallRow users={users.slice(11, 17)} />}
</div>
+ <div className="w-full mt-2 lg:mt-4 mx-auto flex justify-center">
+ <Link href="/launch-week/tickets">
+ <Button as="a" type="outline" size="medium">
+ View all tickets
+ </Button>
+ </Link>
+ </div>
</div>
</div>
)
diff --git a/apps/www/components/LaunchWeek/ReferralIndicator.tsx b/apps/www/components/LaunchWeek/ReferralIndicator.tsx
index d6ecf434969..34e178cdb19 100644
--- a/apps/www/components/LaunchWeek/ReferralIndicator.tsx
+++ b/apps/www/components/LaunchWeek/ReferralIndicator.tsx
@@ -7,15 +7,15 @@ export default function ReferralIndicator() {
return (
<div className="bg-[#EAEAEA75] rounded-full mt-4 flex w-full">
- <span
+ <div
className={[
'bg-gradient-to-l from-[#A141E4] to-[#6300F569] rounded-full pl-4 pr-6 py-1.5 text-xs',
winningChances === 2 ? 'w-1/2' : '',
winningChances === 3 ? 'w-full bg-gradient-to-l from-[#E4B641] to-[#F5BF0069]' : '',
].join(' ')}
>
- {winningChances}x chance
- </span>
+ <span style={{ textShadow: '0 1px 1px rgba(0, 0, 0,0.5)' }}>{winningChances}x chance</span>
+ </div>
</div>
)
}
diff --git a/apps/www/components/LaunchWeek/Ticket/ActualTicket.tsx b/apps/www/components/LaunchWeek/Ticket/ActualTicket.tsx
index 35fd4eb70f0..4eb43cbde06 100644
--- a/apps/www/components/LaunchWeek/Ticket/ActualTicket.tsx
+++ b/apps/www/components/LaunchWeek/Ticket/ActualTicket.tsx
@@ -10,6 +10,7 @@ import { UserData } from './hooks/use-conf-data'
import ReferralIndicator from '../ReferralIndicator'
import useWinningChances from './hooks/useWinningChances'
import { SITE_URL } from '~/lib/constants'
+import { useMobileViewport } from '../../../hooks/useMobileViewport'
type TicketGenerationState = 'default' | 'loading'
@@ -32,6 +33,7 @@ export default function Ticket({
bgImageId,
referrals,
}: Props) {
+ const isMobile = useMobileViewport(1023)
const [ticketGenerationState, setTicketGenerationState] =
useState<TicketGenerationState>('default')
const divRef = useRef<HTMLDivElement>(null)
@@ -40,8 +42,8 @@ export default function Ticket({
return (
<div
className={[
- `relative w-full max-w-[700px] lg:max-w-[1100px] flex flex-col items-center lg:grid lg:grid-cols-12 gap-4 lg:gap-8 p-2 rounded-3xl lg:items-stretch h-auto backdrop-blur"`,
- styles['ticket-hero'],
+ `relative w-full max-w-[700px] lg:max-w-[1100px] flex flex-col items-center lg:grid lg:grid-cols-12 gap-4 lg:gap-8 lg:p-2 rounded-3xl backdrop-blur lg:items-stretch h-auto"`,
+ !isMobile && styles['ticket-hero'],
].join(' ')}
id="wayfinding--ticket-visual-wrapper-container"
>
@@ -76,20 +78,12 @@ export default function Ticket({
</div>
<div
ref={divRef}
- className="flex flex-col !w-full h-full justify-center gap-6 col-span-full lg:col-span-4 mt-4 lg:pr-8 max-h-[400px]"
+ className={[
+ 'flex flex-col !w-full h-full justify-center gap-6 col-span-full p-2 pt-4 lg:p-0 lg:col-span-4 mt-1 lg:m-0 lg:pr-8 max-h-[400px] rounded-3xl backdrop-blur lg:backdrop-blur-none',
+ isMobile && styles['ticket-hero'],
+ ].join(' ')}
>
- <div
- className={`
- text-scale-1200
- flex flex-col
- w-full
- items-center
- text-white
- text-center lg:text-left
- lg:items-start
- gap-3
- `}
- >
+ <div className="text-scale-1200 flex flex-col w-full items-center text-white text-center lg:text-left lg:items-start gap-2 lg:gap-3">
<h1
className={cn(
styleUtils.appear,
@@ -102,13 +96,13 @@ export default function Ticket({
{name ? (
<>
{winningChances === 1 && (
- <span className="text-2xl tracking-[0.02rem] font-medium leading-7 block">
+ <span className="text-2xl tracking-[0.02rem] leading-7 block">
You're <span className="gradient-text-purple-800">in the draw!</span> <br />
Now make it gold.
</span>
)}
{winningChances === 2 && (
- <span className="text-2xl tracking-[0.02rem] font-medium leading-7 block">
+ <span className="text-2xl tracking-[0.02rem] leading-7 block">
You've <span className="gradient-text-purple-800">doubled</span> your{' '}
<br className="hidden lg:inline" />
chance!
@@ -117,21 +111,21 @@ export default function Ticket({
</span>
)}
{winningChances === 3 && (
- <span className="text-2xl tracking-[0.02rem] font-medium leading-7 block">
+ <span className="text-2xl tracking-[0.02rem] leading-7 block">
You're <span className={styles['gold-text']}>gold</span>!<br />
- You've maxed your <br /> chances of winning!
+ You've maxed your <br className="hidden lg:inline" /> chances of winning!
</span>
)}
</>
) : (
- <span className="text-2xl font-medium leading-7 block">
+ <span className="text-2xl leading-7 block">
Generate your ticket. <br />
Win the <span className="gradient-text-purple-800">SupaKeyboard</span>.
</span>
)}
</>
) : (
- <span className="font-medium tracking-[-0.02px] leading-7 block">
+ <span className="tracking-[-0.02px] leading-7 block">
{name ? name : username}'s <br className="hidden lg:inline" />
unique ticket
</span>
@@ -142,28 +136,20 @@ export default function Ticket({
{!sharePage ? (
<>
{golden ? (
- <>
- <p>
- You got a Golden ticket. This means you're in, and you also won a Supabase
- sticker pack!
- </p>
- </>
+ <p>
+ You got a Golden ticket. This means you're in, and you also won a Supabase
+ sticker pack!
+ </p>
+ ) : username ? (
+ <p>
+ Why stop there? Increase your chances of winning by sharing your unique ticket.
+ Get sharing!
+ </p>
) : (
- <>
- {username ? (
- <>
- <p>
- Why stop there? Increase your chances of winning by sharing your unique
- ticket. Get sharing!
- </p>
- </>
- ) : (
- <p>
- We have some fantastic swag up for grabs, including 3 limited-edition
- mechanical keyboards that you won't want to miss.
- </p>
- )}
- </>
+ <p>
+ We have some fantastic swag up for grabs, including 3 limited-edition mechanical
+ keyboards that you won't want to miss.
+ </p>
)}
</>
) : (
@@ -173,7 +159,7 @@ export default function Ticket({
keyboard that you won't want to miss.
</p>
- <div className="mt-4 lg:mt-8 rounded-md bg-[#E6E8EB] py-1 px-3 border border-[#bbbbbb] text-xs mb-1 transition-all ease-out hover:bg-[#dfe1e3]">
+ <div className="mt-4 lg:mt-8 rounded-full bg-[#E6E8EB] py-1 px-3 -mb-3 border border-[#bbbbbb] text-xs transition-all ease-out hover:bg-[#dfe1e3]">
<a
href={`${SITE_URL}`}
className={`flex items-center justify-center gap-2 text-[#2e2e2e]`}
diff --git a/apps/www/components/LaunchWeek/Ticket/TicketActions.tsx b/apps/www/components/LaunchWeek/Ticket/TicketActions.tsx
index b13d5d50bf0..8da419b73b3 100644
--- a/apps/www/components/LaunchWeek/Ticket/TicketActions.tsx
+++ b/apps/www/components/LaunchWeek/Ticket/TicketActions.tsx
@@ -2,7 +2,6 @@ import { useEffect, useRef, useState } from 'react'
import { SITE_URL, TWEET_TEXT, TWEET_TEXT_GOLDEN } from '~/lib/constants'
import { IconCheckCircle } from 'ui'
import useConfData from '~/components/LaunchWeek/Ticket//hooks/use-conf-data'
-import LoadingDots from './loading-dots'
import { useParams } from '~/hooks/useParams'
import TicketForm from './TicketForm'
@@ -25,11 +24,7 @@ export default function TicketActions({
const [loading, setLoading] = useState(false)
const downloadLink = useRef<HTMLAnchorElement>()
const permalink = (medium: string) =>
- encodeURIComponent(
- `${SITE_URL}/tickets/${username}?utm_source=lw7-ticket&utm_medium=${medium}&utm_campaign=launch-week-7&utm_content=${username}${
- golden ? `&golden=true` : ''
- }`
- )
+ encodeURIComponent(`${SITE_URL}/tickets/${username}${golden ? `?golden=true` : ''}`)
const text = encodeURIComponent(golden ? TWEET_TEXT_GOLDEN : TWEET_TEXT)
const { userData } = useConfData()
const tweetUrl = `https://twitter.com/intent/tweet?url=${permalink(
diff --git a/apps/www/components/LaunchWeek/Ticket/ticket.module.css b/apps/www/components/LaunchWeek/Ticket/ticket.module.css
index b9a2c55b00e..aa126cb7070 100644
--- a/apps/www/components/LaunchWeek/Ticket/ticket.module.css
+++ b/apps/www/components/LaunchWeek/Ticket/ticket.module.css
@@ -1,7 +1,4 @@
.ticket-hero {
- /* transform: translate3d(0, 0, 100px); */
- /* box-shadow: 0px 4px 20px rgba(123, 123, 123, 0.25); */
- /* background: linear-gradient(0deg, #d6a1d0 -100%, #9e44ef 200%); */
background: #c58cd2;
background: linear-gradient(
137.46deg,
@@ -13,17 +10,6 @@
inset 0 0.5px 0px 0.5px rgba(255, 255, 255, 0.14), inset 0 -3px 0 -2px rgba(255, 255, 255, 0.08),
0px 4px 20px rgba(118, 7, 170, 0.15);
}
-/* .ticket-hero:before {
- content: ' ';
- position: absolute;
- z-index: -10;
- inset: -1px;
- border-radius: 24px;
- background: linear-gradient(30deg, #ffffff50 0%, #9e44ef 100%);
- box-shadow: 0px 4px 20px rgba(118, 7, 170, 0.15);
- transform: translate3d(0, 0, -1px);
- transform-style: preserve-3d;
-} */
.hero {
line-height: 1.15;
@@ -36,10 +22,6 @@
@media (min-width: 768px) {
.hero {
line-height: 1;
- /* font-weight: 800; */
- /* max-width: 800px; */
- /* margin-left: auto;
- margin-right: auto; */
}
}
@@ -150,7 +132,6 @@
}
.ticket-visual-wrapper {
- /* border-radius: calc(16px * var(--size)); */
width: 100%;
}
diff --git a/apps/www/pages/launch-week/launchWeek.css b/apps/www/pages/launch-week/launchWeek.css
index 57ee92ae94f..4267766deb3 100644
--- a/apps/www/pages/launch-week/launchWeek.css
+++ b/apps/www/pages/launch-week/launchWeek.css
@@ -9,11 +9,22 @@
.bg-lw7-gradient {
/* background: radial-gradient(72.03% 66.03% at 50% 69.72%, #3fcf8e 0%, transparent 100%); */
- background: radial-gradient(72.03% 66.03% at 50% 69.72%, #dbb8bf 0%, transparent 100%);
+ background: radial-gradient(80% 65% at 50% 95%, #dbb8bf 0%, transparent 100%);
}
.bg-lw7-gradient.gold {
- background: radial-gradient(72.03% 66.03% at 50% 69.72%, #ffd132 0%, transparent 100%);
+ background: radial-gradient(80% 65% at 50% 95%, #ffd132 0%, transparent 100%);
+}
+
+@media (min-width: 768px) {
+ .bg-lw7-gradient {
+ /* background: radial-gradient(72.03% 66.03% at 50% 69.72%, #3fcf8e 0%, transparent 100%); */
+ background: radial-gradient(72.03% 66.03% at 50% 69.72%, #dbb8bf 0%, transparent 100%);
+ }
+
+ .bg-lw7-gradient.gold {
+ background: radial-gradient(72.03% 70% at 50% 75%, #ffd132 0%, transparent 100%);
+ }
}
.opacity-pulse {
diff --git a/apps/www/pages/launch-week/tickets/index.tsx b/apps/www/pages/launch-week/tickets/index.tsx
index fb82e4b9dc5..cc3b0d57c3f 100644
--- a/apps/www/pages/launch-week/tickets/index.tsx
+++ b/apps/www/pages/launch-week/tickets/index.tsx
@@ -12,6 +12,8 @@ import LW7BgGraphic from '../../../components/LaunchWeek/LW7BgGraphic'
import CTABanner from '../../../components/CTABanner'
import { debounce } from 'lodash'
import TicketsGrid from '../../../components/LaunchWeek/Ticket/TicketsGrid'
+import { Button } from 'ui'
+import Link from 'next/link'
interface Props {
users: UserData[]
@@ -64,7 +66,6 @@ export default function TicketsPage({ users }: Props) {
setIsLoading(true)
setOffset((prev) => prev + 1)
const { data: users } = await loadUsers(offset, PAGE_COUNT)
- console.log(`loaded users (offset ${offset}): `, users)
setLoadedUsers((prevUsers) => [...prevUsers, ...(users as any[])])
if ((users as any[]).length < PAGE_COUNT) setIsLast(true)
setIsLoading(false)
@@ -135,6 +136,13 @@ export default function TicketsPage({ users }: Props) {
Mark your calendars for April 16th and join us on Discord for Launch Week 7's
final day to find out if you're one of the lucky winners. Get sharing!
</p>
+ <div className="mt-1">
+ <Link href="/launch-week">
+ <Button as="a" type="outline" size="medium">
+ Get your ticket now
+ </Button>
+ </Link>
+ </div>
</motion.div>
</div>
<div ref={ref}>