The Postgres development platform. Supabase gives you a dedicated Postgres database to build your web, mobile, and AI applications.
TypeScript aialternativeauthdatabasedenoembeddingsexamplefirebasenextjsoauth2pgvectorpostgispostgrespostgresqlpostgrestrealtimesupabasevectorswebsockets
chore: remove lw14 tickets (#36030)
Kevin Grünebergfb03d0414a51
diff --git a/apps/www/app/api-v2/ticket-og/route.tsx b/apps/www/app/api-v2/ticket-og/route.tsxdeleted file mode 100644index 478376b7179..00000000000--- a/apps/www/app/api-v2/ticket-og/route.tsx+++ /dev/null@@ -1,446 +0,0 @@-import React from 'react'-import { ImageResponse } from '@vercel/og'-import { createClient } from '@supabase/supabase-js'-import { themes } from '~/components/LaunchWeek/14/utils/ticketThemes'--export const runtime = 'edge' // 'nodejs' is the default-export const dynamic = 'force-dynamic' // defaults to auto-export const fetchCache = 'force-no-store'-export const revalidate = 0--const corsHeaders = {- 'Access-Control-Allow-Origin': '*',- 'Access-Control-Allow-Headers': 'authorization, x-client-info, apikey, content-type',-}--const SUPABASE_URL = process.env.NEXT_PUBLIC_SUPABASE_URL--const STORAGE_URL = `${SUPABASE_URL}/storage/v1/object/public/images/launch-week/lw14`--// Load custom font-// const FONT_URL = `${STORAGE_URL}/assets/font/Nippo-Regular.otf`-// const MONO_FONT_URL = `${STORAGE_URL}/assets/font/DepartureMono-Regular.otf`--const FONT_URL = '/fonts/launchweek/14/Nippo-Regular.otf'-const MONO_FONT_URL = '/fonts/launchweek/14/DepartureMono-Regular.otf'--const LW_TABLE = 'tickets'-const LW_MATERIALIZED_VIEW = 'tickets_view'--const usernameToLines = (username: string): string[] => {- const maxLineLength = 14-- const nonBreakingReplacements = [- { regexp: new RegExp(' ', 'g'), replacement: '\u00A0' }, // Space → Non-breaking space- { regexp: new RegExp('-', 'g'), replacement: '\u2011' }, // Hyphen → Non-breaking hyphen- { regexp: new RegExp('/', 'g'), replacement: '\u2060\u002F\u2060' }, // Slash with word joiners- { regexp: new RegExp('\\.', 'g'), replacement: '\u2024' }, // One dot leader (alternative to period)- ]- const allowList = [...nonBreakingReplacements.map((x) => x.regexp), new RegExp('\\w', 'g')]- .map((x) => x.source.replace('-', '\\-'))- .join('|')- const allowRegexp = new RegExp(`[^${allowList}]`, 'g')- const allowdUsername = username.replace(allowRegexp, '')- // Split only by spaces, keeping hyphenated words together- const words = allowdUsername.split(' ')- const lines: string[] = []- let currentLine = ''-- // First try to break at word boundaries (spaces only)- for (const word of words) {- // If adding this word would exceed the line length and we already have content- if (- currentLine.length + (currentLine ? 1 : 0) + word.length > maxLineLength &&- currentLine.length > 0- ) {- // Add current line to lines array and start a new line- lines.push(currentLine)- currentLine = word- } else {- // Add word to current line with a space if needed- currentLine = currentLine ? `${currentLine} ${word}` : word- }- }-- // Add the last line if it has content- if (currentLine) {- lines.push(currentLine)- }-- // If we still have too few lines but some are too long, split them by character- // but try to avoid splitting at hyphens- let finalLines: string[] = []- for (const line of lines) {- if (line.length > maxLineLength) {- // For long words, try to find good break points- let remainingText = line- while (remainingText.length > 0) {- if (remainingText.length <= maxLineLength) {- finalLines.push(remainingText)- break- }-- // Try to find a good break point that's not a hyphen- let breakPoint = maxLineLength-- // Look for a hyphen in the potential break area (a few chars before maxLineLength)- const searchArea = remainingText.substring(Math.max(0, breakPoint - 5), breakPoint + 1)- const hyphenPos = searchArea.indexOf('-')-- // If we found a hyphen, adjust the break point to keep the hyphenated word together- if (hyphenPos >= 0) {- // Calculate the actual position in the original string- const actualHyphenPos = Math.max(0, breakPoint - 5) + hyphenPos-- // If hyphen is near the beginning, include the whole hyphenated word on next line- if (actualHyphenPos < maxLineLength / 2) {- breakPoint = actualHyphenPos- }- // If hyphen is near the end, include the whole hyphenated word on this line- else {- // Find the end of the hyphenated word- const spaceAfterHyphen = remainingText.indexOf(' ', actualHyphenPos)- if (spaceAfterHyphen > 0 && spaceAfterHyphen - actualHyphenPos < 10) {- // If the rest of the hyphenated word is reasonably short, keep it together- breakPoint = spaceAfterHyphen- }- }- }-- finalLines.push(remainingText.substring(0, breakPoint))- remainingText = remainingText.substring(breakPoint).trim()- }- } else {- finalLines.push(line)- }- }-- // Limit to 3 lines maximum- if (finalLines.length > 3) {- finalLines = finalLines.slice(0, 2)- // Truncate the last line if needed and add ellipsis- let lastLine = finalLines[2] || ''- if (lastLine.length > 8) {- lastLine = lastLine.slice(0, 8) + '...'- }- finalLines.push(lastLine)- }-- finalLines = finalLines.map((line, index) => {- let result = line- nonBreakingReplacements.forEach(({ regexp, replacement }) => {- result = result.replace(regexp, replacement)- })-- if (index < finalLines.length - 1) {- result = result.padEnd(maxLineLength, '\u00A0')- }- return result- })-- // Ensure we don't have more than 3 lines- return finalLines.slice(0, 3)-}--export async function GET(req: Request, res: Response) {- const url = new URL(req.url)-- // Just here to silence snyk false positives- // Verify that req.url is from an allowed domain- const username = url.searchParams.get('username') ?? url.searchParams.get('amp;username')- const userAgent = req.headers.get('user-agent')-- const font = fetch(new URL(FONT_URL, url)).then((res) => res.arrayBuffer())- const mono_font = fetch(new URL(MONO_FONT_URL, url)).then((res) => res.arrayBuffer())-- try {- if (!username) throw new Error('missing username param')-- const supabaseAdminClient = createClient(- process.env.NEXT_PUBLIC_SUPABASE_URL as string,- process.env.LIVE_SUPABASE_COM_SERVICE_ROLE_KEY as string- )-- // Track social shares- if (userAgent?.toLocaleLowerCase().includes('twitter')) {- await supabaseAdminClient- .from(LW_TABLE)- .update({ shared_on_twitter: 'now' })- .eq('launch_week', 'lw14')- .eq('username', username)- .is('shared_on_twitter', null)- } else if (userAgent?.toLocaleLowerCase().includes('linkedin')) {- await supabaseAdminClient- .from(LW_TABLE)- .update({ shared_on_linkedin: 'now' })- .eq('launch_week', 'lw14')- .eq('username', username)- .is('shared_on_linkedin', null)- }-- // Get ticket data- const { data: user, error } = await supabaseAdminClient- .from(LW_MATERIALIZED_VIEW)- .select(- 'id, name, metadata, shared_on_twitter, shared_on_linkedin, platinum, secret, role, company, location, ticket_number'- )- .eq('launch_week', 'lw14')- .eq('username', username)- .maybeSingle()-- if (error) console.log('Failed to fetch user. Inner error:', error.message)- if (!user) throw new Error(error?.message ?? 'user not found')-- const {- name,- secret,- platinum: isPlatinum,- shared_on_twitter: sharedOnTwitter,- shared_on_linkedin: sharedOnLinkedIn,- ticket_number,- } = user-- const platinum = isPlatinum ?? (!!sharedOnTwitter && !!sharedOnLinkedIn) ?? false- const platinumSecret = platinum && secret-- const seatCode = (466561 + (ticket_number || 0)).toString(36).toUpperCase()-- // Generate image and upload to storage.- const ticketType = secret- ? platinum- ? 'platinumSecret'- : 'secret'- : platinum- ? 'platinum'- : 'regular'-- const STYLING_CONFIG = () => ({- TICKET_FOREGROUND: themes()[ticketType].TICKET_FOREGROUND,- })-- const TICKET_THEME = {- regular: {- color: 'rgb(239, 239, 239)',- background: 'transparent',- },- secret: {- color: 'rgba(44, 244, 148)',- background: 'rgba(44, 244, 148, 0.2)',- },- platinum: {- color: 'rgba(255, 199, 58)',- background: 'rgba(255, 199, 58, 0.2)',- },- platinumSecret: {- color: 'rgba(255, 199, 58)',- background: 'rgba(255, 199, 58, 0.2)',- },- }-- const fontData = await font- const monoFontData = await mono_font-- const OG_WIDTH = 1200- const OG_HEIGHT = 628- const USERNAME_BOTTOM = 435-- const BACKGROUND = () => ({- regular: {- BACKGROUND_IMG: new URL(`/images/launchweek/14/og-14-regular.png`, url).href,- },- platinum: {- BACKGROUND_IMG: new URL(`/images/launchweek/14/og-14-platinum.png`, url).href,- },- platinumSecret: {- BACKGROUND_IMG: new URL(`/images/launchweek/14/og-14-platinum-secret.png`, url).href,- },- secret: {- BACKGROUND_IMG: new URL(`/images/launchweek/14/og-14-secret.png`, url).href,- },- })-- const NOISE = new URL('/images/launchweek/14/noise-pattern.png', url).href-- const computeBackgroundWidth = (letters: number) => {- return 100 + (letters * 40 + (letters - 1) * 12)- }- const lines = usernameToLines(name ?? username)-- const secretStyles = {- background: 'linear-gradient(0deg, rgb(18 18 18 / 0.5) 50%, transparent 50%)',- backgroundSize: '100% 6px, 0px 100%',- }-- const testStyles = {- background: 'red',- backgroundSize: '100% 6px, 0px 100%',- }-- const secretTextStyles = {- textShadow: '0 0 15px rgba(52,211,153,0.8)',- }-- const platinumSecretTextStyles = {- textShadow: '0 0 15px rgba(255,199,58,0.8)',- }-- const generatedTicketImage = new ImageResponse(- (- <>- <div- style={{- width: '1200px',- height: '628px',- position: 'relative',- fontFamily: '"Nippo-Regular"',- overflow: 'hidden',- color: STYLING_CONFIG().TICKET_FOREGROUND,- display: 'flex',- flexDirection: 'column',- justifyContent: 'space-between',- }}- >- {/* Background */}- <img- width="1204"- height="634"- style={{- position: 'absolute',- top: '-2px',- left: '-2px',- bottom: '-2px',- right: '-2px',- backgroundSize: 'cover',- backgroundColor: STYLING_CONFIG().TICKET_FOREGROUND,- }}- src={BACKGROUND()[ticketType].BACKGROUND_IMG}- />- {/* Seat number */}- <div- style={{- transform: 'rotate(-90deg)',- fontFamily: '"Nippo-Regular"',- fontSize: '82px',- position: 'absolute',- color: TICKET_THEME[ticketType].color,- top: 70,- right: 135,- ...(secret ? secretTextStyles : {}),- ...(platinumSecret ? platinumSecretTextStyles : {}),- }}- >- {seatCode}- </div>-- {/* Render each username line */}- {lines.map((line, index) => (- <div- key={index}- style={{- display: 'flex',- position: 'absolute',- bottom: USERNAME_BOTTOM - index * 80,- paddingLeft: '93px',- paddingRight: 0,- left: 27,- height: '61px',- width: `${computeBackgroundWidth(line.length)}px`,- backgroundColor: TICKET_THEME[ticketType].background,- }}- >- <p- style={{- fontFamily: '"DepartureMono-Regular"',- margin: '0',- color: TICKET_THEME[ticketType].color,- padding: '0',- fontSize: '82px',- lineHeight: '56px',- display: 'flex',- ...(secret ? secretTextStyles : {}),- ...(platinumSecret ? platinumSecretTextStyles : {}),- }}- >- {line}- </p>- </div>- ))}-- {secret && (- <div- style={{- position: 'absolute',- top: '0px',- left: '0px',- right: '0px',- bottom: '0px',- ...secretStyles,- }}- />- )}-- {secret && (- <img- src={NOISE}- style={{- position: 'absolute',- top: 0,- left: 0,- right: 0,- bottom: 0,- opacity: '0.1',- }}- />- )}- </div>- </>- ),- {- width: OG_WIDTH,- height: OG_HEIGHT,- fonts: [- {- name: 'Nippo-Regular',- data: fontData,- style: 'normal',- },- {- name: 'DepartureMono-Regular',- data: monoFontData,- style: 'normal',- },- ],- headers: {- 'content-type': 'image/png',- 'cache-control': 'public, max-age=31536000, s-maxage=31536000, no-transform, immutable',- 'cdn-cache-control': 'max-age=31536000',- },- }- )-- // [Note] Uncomment only for local testing to return the image directly and skip storage upload.- // return generatedTicketImage-- // Upload image to storage.- const { error: storageError } = await supabaseAdminClient.storage- .from('images')- .upload(`launch-week/lw14/og/${ticketType}/${username}.png`, generatedTicketImage.body!, {- contentType: 'image/png',- // cacheControl: `${60 * 60 * 24 * 7}`,- cacheControl: `0`,- // Update cached og image, people might need to update info- upsert: true,- })-- if (storageError) throw new Error(`storageError: ${storageError.message}`)-- const NEW_TIMESTAMP = new Date()-- return await fetch(`${STORAGE_URL}/og/${ticketType}/${username}.png?t=${NEW_TIMESTAMP}`)- } catch (error: any) {- return new Response(JSON.stringify({ error: error.message }), {- headers: { ...corsHeaders, 'Content-Type': 'application/json' },- status: 400,- })- }-}diff --git a/apps/www/components/LaunchWeek/14/LwView.tsx b/apps/www/components/LaunchWeek/14/LwView.tsxdeleted file mode 100644index 26dd67446bd..00000000000--- a/apps/www/components/LaunchWeek/14/LwView.tsx+++ /dev/null@@ -1,93 +0,0 @@-import Image from 'next/image'-import { ActionButton } from '~/components/LaunchWeek/14/ActionButton'-import {- TicketHeader,- TicketHeaderClaim,- TicketHeaderDate,- TicketHeaderRemainingTime,-} from '~/components/LaunchWeek/14/Header'-import TicketCanvas from '~/components/LaunchWeek/14/TicketCanvas'-import {- TicketClaim,- TicketClaimButtons,- TicketClaimContent,- TicketClaimMessage,-} from '~/components/LaunchWeek/14/TicketClaim'-import TicketCopy from '~/components/LaunchWeek/14/TicketCopy'-import { TicketLayout, TicketLayoutCanvas } from '~/components/LaunchWeek/14/TicketLayout'-import TicketShare from '~/components/LaunchWeek/14/TicketShare'-import { Tunnel } from '~/components/LaunchWeek/14/Tunnel'-import { TicketShareLayout } from '~/components/LaunchWeek/14/TicketShareLayout'-import { useRegistration } from '~/components/LaunchWeek/14/hooks/use-registration'-import useConfData from './hooks/use-conf-data'-import { cn } from 'ui'--const dates = [new Date('2025-03-31T07:00:00.000-08:00')]--export const LwView = () => {- const [state] = useConfData()- const register = useRegistration()-- return (- <TicketLayout>- <TicketHeader hidden={true}>- <TicketHeaderRemainingTime targetDate={dates[0]} />- <TicketHeaderClaim />- <TicketHeaderDate />- </TicketHeader>- <TicketLayoutCanvas narrow={true}>- <TicketCanvas narrow={true} onUpgradeToSecret={register.upgradeTicket} />- {state.claimFormState === 'visible' && (- <TicketClaim>- <div className="flex flex-col md:flex-row gap-12 lg:gap-2 grow w-full min-w-full max-w-full pt-16 md:pt-32 md:px-6 lg:px-0 lg:py-0 items-center">- <div className='flex flex-col gap-2 w-full grow justify-center font-["Departure_Mono"]'>- <h1 className="text-4xl uppercase tracking-wide pointer-events-none">- <span className="flex gap-1 items-center">- <Image- src="/images/launchweek/14/logo-pixel-small-dark.png"- width="18"- height="20"- className="w-auto h-5 invert dark:invert-0"- alt=""- />- Supabase- </span>- LaunchWeek 14- <span className="block mt-2 text-foreground-lighter">MAR 31 — APR 04</span>- </h1>- <span className="block mt-2 text-foreground-lighter">7 AM PT</span>- </div>- <div className="flex flex-row gap-2 z-10 w-full grow justify-start lg:justify-end">- <TicketClaimContent>- <TicketClaimButtons>- <ActionButton variant="primary" icon="T" onClick={() => register.signIn()}>- CLAIM YOUR TICKET- </ActionButton>- </TicketClaimButtons>- <TicketClaimMessage />- </TicketClaimContent>- </div>- </div>- </TicketClaim>- )}- {state.ticketVisibility && (- <>- <TicketShareLayout narrow>- <TicketCopy />- <TicketShare />- </TicketShareLayout>- </>- )}-- <div- className={cn(- 'w-full absolute bottom-[50%] md:bottom-[25%] lg:-bottom-8 xl:-bottom-16 left-0 right-0 -z-20 overflow-hidden flex justify-center',- { ['hidden']: state.claimFormState === 'visible' }- )}- >- <Tunnel />- </div>- </TicketLayoutCanvas>- </TicketLayout>- )-}diff --git a/apps/www/components/LaunchWeek/14/Releases/LWStickyNav.tsx b/apps/www/components/LaunchWeek/14/Releases/LWStickyNav.tsxindex ed5415c0d2b..48964126ce5 100644--- a/apps/www/components/LaunchWeek/14/Releases/LWStickyNav.tsx+++ b/apps/www/components/LaunchWeek/14/Releases/LWStickyNav.tsx@@ -150,14 +150,6 @@ const LWXStickyNav: FC = () => {<ArrowUpRight className="w-4 h-5 text-foreground-muted hidden sm:inline-block" /></Link></li>- <li className="hidden sm:block">- <Link- href="#ticket"- className="p-1 transition-colors hover:text-foreground pointer-events-auto"- >- Ticket- </Link>- </li></div></ul></div>diff --git a/apps/www/components/LaunchWeek/14/TicketCanvas.tsx b/apps/www/components/LaunchWeek/14/TicketCanvas.tsxdeleted file mode 100644index dc84059be6a..00000000000--- a/apps/www/components/LaunchWeek/14/TicketCanvas.tsx+++ /dev/null@@ -1,122 +0,0 @@-import { cn } from 'ui'-import { useThreeJS } from './helpers'-import { useCallback, useEffect, useRef } from 'react'-import SceneRenderer from './utils/SceneRenderer'-import TicketScene from './scenes/TicketScene'-import useConfData from './hooks/use-conf-data'--interface TicketCanvasProps {- className?: string- onUpgradeToSecret?: () => void- narrow: boolean-}--const TicketCanvas = ({ className, onUpgradeToSecret, narrow }: TicketCanvasProps) => {- const sceneRef = useRef<TicketScene | null>(null)- const initQueue = useRef<{ init: Promise<void>; renderer: SceneRenderer }[]>([])- const onUpgradeToSecretRef = useRef(onUpgradeToSecret)- const [state, dispatch] = useConfData()- const userData = state.userTicketData- const initialSceneDataRef = useRef({- visible: state.ticketVisibility,- secret: state.userTicketData.secret,- platinum: state.userTicketData.platinum,- narrow: narrow,- user: {- id: state.userTicketData.id,- name: state.userTicketData.name ?? state.userTicketData.username,- ticketNumber: state.userTicketData.ticket_number,- },- })-- const setup = useCallback(- (container: HTMLElement) => {- const uuid = Math.random().toString(36).substring(7)-- const sceneRenderer = new SceneRenderer(container, initQueue.current, uuid)-- const initPromise = sceneRenderer.init(async () => {- dispatch({ type: 'TICKET_LOADING_START' })- const scene = new TicketScene({- defaultVisible: initialSceneDataRef.current.visible,- defaultSecret: initialSceneDataRef.current.secret,- defaultPlatinum: initialSceneDataRef.current.platinum,- narrow: initialSceneDataRef.current.narrow,- user: initialSceneDataRef.current.user,- onSeatChartButtonClicked: () => {- scene.showBackSide()- scene.upgradeToSecret()- onUpgradeToSecretRef.current?.()- },- onGoBackButtonClicked: () => {- scene.showFrontSide()- },- })-- await sceneRenderer.activateScene(scene, true)-- sceneRef.current = scene-- dispatch({ type: 'TICKET_LOADING_SUCCESS' })- })-- initQueue.current.push({ init: initPromise, renderer: sceneRenderer })-- return sceneRenderer- },- [dispatch]- )-- useEffect(() => {- async function updateTicket() {- if (sceneRef.current) {- sceneRef.current.setVisible(state.ticketVisibility)- sceneRef.current.setTicketNumber(state.userTicketData.ticket_number ?? 0)- sceneRef.current.setUserName(- state.userTicketData.name ?? state.userTicketData.username ?? ''- )-- if (state.userTicketData.secret) await sceneRef.current.upgradeToSecret()- if (state.userTicketData.platinum) await sceneRef.current.upgradeToPlatinum()-- sceneRef.current.reloadTextures()- }- }-- if (sceneRef.current) {- void updateTicket()- }- }, [- narrow,- state.ticketVisibility,- state.userTicketData.name,- state.userTicketData.platinum,- state.userTicketData.secret,- state.userTicketData.ticket_number,- state.userTicketData.username,- ])-- useEffect(() => {- onUpgradeToSecretRef.current = onUpgradeToSecret- }, [onUpgradeToSecret])-- const { containerRef } = useThreeJS(setup)- return (- <div- className={cn(- 'absolute sm:inset-0 flex justify-center items-center overflow-hidden w-full h-full z-0',- className- )}- >- <div- ref={containerRef}- className="w-full h-full"- onClick={(e) => {- sceneRef.current?.click(e.nativeEvent)- }}- />- </div>- )-}--export default TicketCanvasdiff --git a/apps/www/components/LaunchWeek/14/TicketClaim.tsx b/apps/www/components/LaunchWeek/14/TicketClaim.tsxdeleted file mode 100644index 011a49021d1..00000000000--- a/apps/www/components/LaunchWeek/14/TicketClaim.tsx+++ /dev/null@@ -1,29 +0,0 @@-import { ReactNode } from 'react'-import useConfData from './hooks/use-conf-data'--export const TicketClaim = ({ children, narrow }: { children: ReactNode; narrow?: boolean }) => {- return <div className={'flex px-6'}>{children}</div>-}--export const TicketClaimContent = ({ children }: { children?: ReactNode }) => {- return <div className="grid gap-6 content-center">{children}</div>-}--export const TicketClaimMessage = () => {- const [state] = useConfData()- return (- <div className="grid justify-center gap-3 md:px-16">- <div className='md:text-center md:justify-center text-foreground-lighter md:text-sm font-["Departure_Mono"] leading-normal [text-shadow:_0px_0px_4px_rgb(255_255_255_/_0.25)] text-sm text-balance max-w-[310px] md:max-w-[400px] uppercase'>- Share your ticket for a chance to win swag- </div>- </div>- )-}--export const TicketClaimButtons = ({ children }: { children?: ReactNode }) => {- return (- <div className="inline-flex md:justify-center md:items-center gap-2.5 flex-wrap">- {children}- </div>- )-}diff --git a/apps/www/components/LaunchWeek/14/TicketCopy.tsx b/apps/www/components/LaunchWeek/14/TicketCopy.tsxdeleted file mode 100644index 30bafa922c0..00000000000--- a/apps/www/components/LaunchWeek/14/TicketCopy.tsx+++ /dev/null@@ -1,40 +0,0 @@-import { useState, useRef } from 'react'-import { LW14_URL } from '~/lib/constants'-import { Check, Copy } from 'lucide-react'-import useConfData from './hooks/use-conf-data'-import { cn } from 'ui'--export default function TicketCopy({ className }: { className?: string }) {- const [state] = useConfData()- const userData = state.userTicketData- const { username } = userData- const [copied, setCopied] = useState(false)- const buttonRef = useRef<HTMLButtonElement>(null)- const displayUrl = `.../launch-week/tickets/${username}`- const link = `${LW14_URL}/tickets/${username}`-- return (- <button- type="button"- name="Copy"- ref={buttonRef}- onClick={() => {- navigator.clipboard.writeText(link).then(() => {- setCopied(true)- setTimeout(() => {- setCopied(false)- }, 2000)- })- }}- className={cn(- 'font-mono w-full px-2 lg:px-3.5 !pr-1 py-1 rounded-md bg-alternative-200 border flex gap-2 relative text-foreground-light hover:text-foreground text-xs pointer-events-auto justify-between items-center hover:border-stronger transition-all',- className- )}- >- <span className="truncate">{displayUrl}</span>- <div className="w-6 min-w-6 h-6 flex items-center justify-center flex-shrink-0 border border-strong rounded bg-muted hover:bg-selection hover:border-stronger">- {copied ? <Check size={14} strokeWidth={3} /> : <Copy size={14} strokeWidth={1.5} />}- </div>- </button>- )-}diff --git a/apps/www/components/LaunchWeek/14/TicketLayout.tsx b/apps/www/components/LaunchWeek/14/TicketLayout.tsxdeleted file mode 100644index 8ba23e6b2fe..00000000000--- a/apps/www/components/LaunchWeek/14/TicketLayout.tsx+++ /dev/null@@ -1,23 +0,0 @@-import { ReactNode } from 'react'-import { cn } from 'ui'-import SectionContainerWithCn from '~/components/Layouts/SectionContainerWithCn'--export const TicketLayout = ({ children }: { children: ReactNode }) => {- return (- <SectionContainerWithCn id="ticket" className="lw-nav-anchor font-mono z-20 relative px-0">- {children}- </SectionContainerWithCn>- )-}--export const TicketLayoutCanvas = ({ children, narrow }: { children: ReactNode; narrow: true }) => {- return (- <div- className={cn('relative w-full h-[650px] lg:h-auto lg:aspect-[1.5841584158]', {- ['h-[530px] lg:aspect-[2.3] xl:aspect-[2.9473684211]']: narrow,- })}- >- {children}- </div>- )-}diff --git a/apps/www/components/LaunchWeek/14/TicketShare.tsx b/apps/www/components/LaunchWeek/14/TicketShare.tsxdeleted file mode 100644index 61712dab331..00000000000--- a/apps/www/components/LaunchWeek/14/TicketShare.tsx+++ /dev/null@@ -1,111 +0,0 @@-import { useBreakpoint } from 'common'-import dayjs from 'dayjs'-import { Check } from 'lucide-react'-import { useTheme } from 'next-themes'-import Link from 'next/link'-import { useEffect, useRef, useState } from 'react'-import { Button } from 'ui'-import useConfData from './hooks/use-conf-data'-import {- LW14_TWEET_TEXT,- LW14_TWEET_TEXT_PLATINUM,- LW14_TWEET_TEXT_SECRET,- LW14_URL,-} from '~/lib/constants'-import supabase from './supabase'--export default function TicketShare() {- const { resolvedTheme } = useTheme()- const [state] = useConfData()- const userData = state.userTicketData- const { platinum, username, metadata, secret: hasSecretTicket } = userData- const [_imgReady, setImgReady] = useState(false)- const [_loading, setLoading] = useState(false)- const isLessThanMd = useBreakpoint()- const downloadLink = useRef<HTMLAnchorElement>()- const link = `${LW14_URL}/tickets/${username}?t=${dayjs(new Date()).format('DHHmmss')}`- const permalink = encodeURIComponent(link)- const text = hasSecretTicket- ? LW14_TWEET_TEXT_SECRET- : platinum- ? LW14_TWEET_TEXT_PLATINUM- : LW14_TWEET_TEXT- const encodedText = encodeURIComponent(text)- const tweetUrl = `https://twitter.com/intent/tweet?url=${permalink}&text=${encodedText}`- const linkedInUrl = `https://www.linkedin.com/sharing/share-offsite/?url=${permalink}&text=${encodedText}`- const downloadUrl = `/api-v2/ticket-og?username=${encodeURIComponent(username ?? '')}`- const TICKETS_TABLE = 'tickets'-- useEffect(() => {- setImgReady(false)-- const img = new Image()-- img.src = downloadUrl- img.onload = () => {- setImgReady(true)- setLoading(false)- if (downloadLink.current) {- downloadLink.current.click()- downloadLink.current = undefined- }- }- }, [downloadUrl])-- const handleShare = async (social: 'twitter' | 'linkedin') => {- setTimeout(async () => {- if (social === 'twitter') {- await supabase- .from(TICKETS_TABLE)- .update({- shared_on_twitter: 'now',- metadata: { ...metadata, theme: resolvedTheme, hasSharedSecret: hasSecretTicket },- })- .eq('launch_week', 'lw14')- .eq('username', username)- } else if (social === 'linkedin') {- await supabase- .from(TICKETS_TABLE)- .update({- shared_on_linkedin: 'now',- metadata: { ...metadata, theme: resolvedTheme, hasSharedSecret: hasSecretTicket },- })- .eq('launch_week', 'lw14')- .eq('username', username)- }-- if (userData.shared_on_linkedin && userData.shared_on_twitter) {- await fetch(`/api-v2/ticket-og?username=${username}&platinum=true`)- }- })- }-- return (- <div className='flex flex-row flex-wrap justify-stretch w-full gap-2 pointer-events-auto font-["Departure_Mono"]'>- <Button- onClick={() => handleShare('twitter')}- type={userData.shared_on_twitter ? 'secondary' : 'default'}- icon={userData.shared_on_twitter && <Check strokeWidth={2} />}- size={isLessThanMd ? 'tiny' : 'small'}- className="px-2 lg:px-3.5 h-[28px] lg:h-[34px] uppercase flex-1 w-full"- asChild- >- <Link href={tweetUrl} target="_blank">- {userData.shared_on_twitter ? 'Shared on Twitter' : 'Share on Twitter'}- </Link>- </Button>- <Button- onClick={() => handleShare('linkedin')}- type={userData.shared_on_linkedin ? 'secondary' : 'default'}- icon={userData.shared_on_linkedin && <Check strokeWidth={2} />}- size={isLessThanMd ? 'tiny' : 'small'}- className="px-2 lg:px-3.5 h-[28px] lg:h-[34px] uppercase flex-1 w-full"- asChild- >- <Link href={linkedInUrl} target="_blank">- {userData.shared_on_linkedin ? 'Shared on Linkedin' : 'Share on Linkedin'}- </Link>- </Button>- </div>- )-}diff --git a/apps/www/components/LaunchWeek/14/TicketShareLayout.tsx b/apps/www/components/LaunchWeek/14/TicketShareLayout.tsxdeleted file mode 100644index d03964e6305..00000000000--- a/apps/www/components/LaunchWeek/14/TicketShareLayout.tsx+++ /dev/null@@ -1,51 +0,0 @@-import { ReactNode } from 'react'-import { cn } from 'ui'-import useLw14ConfData from './hooks/use-conf-data'--export const TicketShareLayout = ({- children,- narrow,-}: {- children?: ReactNode- narrow?: boolean-}) => {- const [{ userTicketData }] = useLw14ConfData()-- const userName = userTicketData.name ?? userTicketData.username- let userWelcomeText = userName ? <span>, {userName}!</span> : '!'-- return (- <div- className={cn(- 'absolute lg:relative lg:flex lg:flex-col lg:max-w-[450px] xl:max-w-[500px] lg:h-full left-0 right-0 grid justify-center gap-2 md:px-5 lg:px-0 px-6',- narrow- ? 'top-[280px] md:top-[360px] lg:top-0 lg:left-0 lg:right-auto lg:justify-center'- : 'top-[250px] xs:top-[290px] md:top-auto md:bottom-10 xl:bottom-16 2xl:bottom-20'- )}- >- {narrow && (- <>- {/* <Image- src={logo}- alt="LW logo"- className="size-12 hidden lg:block"- width="48"- height="48"- /> */}- <div className='uppercase text-3xl lg:text-4xl py-4 text-left font-["Departure_Mono"]'>- Good to see you{userWelcomeText}- </div>- </>- )}- <div- className={cn(- 'text-xs pb-2 font-["Departure_Mono"] uppercase text-foreground-lighter',- narrow ? 'text-left' : 'text-center'- )}- >- Share your ticket for a chance to win swag- </div>- {children}- </div>- )-}diff --git a/apps/www/components/LaunchWeek/14/effects/crt-shader.ts b/apps/www/components/LaunchWeek/14/effects/crt-shader.tsdeleted file mode 100644index 9a4cefe9972..00000000000--- a/apps/www/components/LaunchWeek/14/effects/crt-shader.ts+++ /dev/null@@ -1,89 +0,0 @@-export const CRTShader = {- uniforms: {- tDiffuse: { value: null },- time: { value: 0 },- scanlineIntensity: { value: 0.6 },- scanlineCount: { value: 360 },- vignetteIntensity: { value: 0.5 },- noiseIntensity: { value: 0.01 },- flickerIntensity: { value: 0.01 },- rgbShiftAmount: { value: 0.0 },- // Add intensity control- intensity: { value: 1.0 },- },- vertexShader: `- varying vec2 vUv;- void main() {- vUv = uv;- gl_Position = projectionMatrix * modelViewMatrix * vec4(position, 1.0);- }- `,- fragmentShader: `- uniform sampler2D tDiffuse;- uniform float time;- uniform float scanlineIntensity;- uniform float scanlineCount;- uniform float vignetteIntensity;- uniform float noiseIntensity;- uniform float flickerIntensity;- uniform float rgbShiftAmount;- uniform float intensity;-- varying vec2 vUv;-- // Random function- // https://stackoverflow.com/a/10625698- float random(vec2 st) {- return fract(sin(dot(st.xy, vec2(12.9898, 78.233))) * 43758.5453123);- }-- void main() {- // Get original color- vec4 originalColor = texture2D(tDiffuse, vUv);-- // Skip effects if intensity is zero- if (intensity <= 0.0) {- gl_FragColor = originalColor;- return;- }-- // Scale effect parameters by intensity- float activeRGBShift = rgbShiftAmount * intensity;- float activeScanlineIntensity = scanlineIntensity * intensity;- float activeVignetteIntensity = vignetteIntensity * intensity;- float activeNoiseIntensity = noiseIntensity * intensity;- float activeFlickerIntensity = flickerIntensity * intensity;-- // RGB shift effect - more subtle to preserve detail- vec2 shiftR = vec2(activeRGBShift, 0.0);- vec2 shiftG = vec2(0.0, activeRGBShift);-- float r = texture2D(tDiffuse, vUv + shiftR).r;- float g = texture2D(tDiffuse, vUv + shiftG).g;- float b = texture2D(tDiffuse, vUv).b;-- vec4 shiftedColor = vec4(r, g, b, originalColor.a);-- // Scanline effect - thicker and more pronounced- float scanlineFreq = scanlineCount * 0.7; // Reduce frequency for thicker lines- float scanline = sin(vUv.y * scanlineFreq * 3.14159) * 0.5 + 0.5;- scanline = pow(scanline, 0.7) * activeScanlineIntensity * 1.5; // Increase intensity and make lines thicker with lower power-- // Apply scanline as a multiplicative overlay with stronger effect- vec4 scanlineColor = mix(shiftedColor, shiftedColor * (1.0 - scanline), activeScanlineIntensity * 1.2);-- // Vignette effect- vec2 center = vec2(0.5, 0.5);- float dist = distance(vUv, center);- float vignette = smoothstep(0.3, 0.85, dist) * activeVignetteIntensity;-- // Apply vignette as the final overlay effect- vec4 finalColor = scanlineColor * (1.0 - vignette * 0.7);-- // Blend between original and effect based on intensity- vec4 final = mix(originalColor, finalColor, intensity);- final.a = originalColor.a;- gl_FragColor = final;- }- `,-}diff --git a/apps/www/components/LaunchWeek/14/effects/glitch.ts b/apps/www/components/LaunchWeek/14/effects/glitch.tsdeleted file mode 100644index 703c8ee1dad..00000000000--- a/apps/www/components/LaunchWeek/14/effects/glitch.ts+++ /dev/null@@ -1,112 +0,0 @@-import {- DataTexture,- FloatType,- MathUtils,- RedFormat,- ShaderMaterial,- UniformsUtils,- WebGLRenderer,- WebGLRenderTarget,-} from 'three'-import { Pass, FullScreenQuad } from 'three/examples/jsm/postprocessing/Pass'-import { DigitalGlitch } from 'three/examples/jsm/shaders/DigitalGlitch'--class GlitchPass extends Pass {- uniforms: typeof DigitalGlitch.uniforms- heightMap: DataTexture- material: ShaderMaterial- fsQuad: FullScreenQuad- goWild: boolean- curF: number- randX: number- intensity: number-- constructor(dt_size = 64) {- super()-- const shader = DigitalGlitch-- this.uniforms = UniformsUtils.clone(shader.uniforms)-- this.heightMap = this.generateHeightmap(dt_size)-- this.uniforms['tDisp'].value = this.heightMap-- this.material = new ShaderMaterial({- uniforms: this.uniforms,- vertexShader: shader.vertexShader,- fragmentShader: shader.fragmentShader,- })-- this.fsQuad = new FullScreenQuad(this.material)-- this.goWild = false- this.curF = 0- this.randX = 0- this.generateTrigger()- this.intensity = 0- }-- render(renderer: WebGLRenderer, writeBuffer: WebGLRenderTarget, readBuffer: WebGLRenderTarget) {- this.uniforms['tDiffuse'].value = readBuffer.texture- this.uniforms['seed'].value = Math.random() //default seeding- this.uniforms['byp'].value = 0-- if (this.curF % this.randX < this.randX / 10) {- this.uniforms['amount'].value = 0 * this.intensity- this.uniforms['angle'].value = Math.PI- this.uniforms['distortion_x'].value = MathUtils.randFloat(0, 0.05) * this.intensity- this.uniforms['distortion_y'].value = MathUtils.randFloat(0, 0.05) * this.intensity- this.uniforms['seed_x'].value = MathUtils.randFloat(-0.05, 0.05) * this.intensity- this.uniforms['seed_y'].value = MathUtils.randFloat(-0.05, 0.05) * this.intensity- this.curF = 0- }-- this.curF++-- if (this.renderToScreen) {- renderer.setRenderTarget(null)- this.fsQuad.render(renderer)- } else {- renderer.setRenderTarget(writeBuffer)- if (this.clear) renderer.clear()- this.fsQuad.render(renderer)- }- }-- generateTrigger() {- this.randX = MathUtils.randInt(200, 240)- }-- generateHeightmap(dt_size: number) {- const data_arr = new Float32Array(dt_size * dt_size)- const length = dt_size * dt_size-- for (let i = 0; i < length; i++) {- const val = MathUtils.randFloat(0, 1)- data_arr[i] = val- }-- const texture = new DataTexture(data_arr, dt_size, dt_size, RedFormat, FloatType)- texture.needsUpdate = true- return texture- }-- setIntensity(amount: number) {- this.intensity = amount < 0.01 ? 0 : amount / 4- }-- enable(value: boolean) {- this.uniforms['byp'].value = value ? 0 : 1- }-- dispose() {- this.material.dispose()-- this.heightMap.dispose()-- this.fsQuad.dispose()- }-}--export { GlitchPass }diff --git a/apps/www/components/LaunchWeek/14/effects/helpers.ts b/apps/www/components/LaunchWeek/14/effects/helpers.tsdeleted file mode 100644index ae8d59d8793..00000000000--- a/apps/www/components/LaunchWeek/14/effects/helpers.ts+++ /dev/null@@ -1,238 +0,0 @@-export const shared = `-vec3 mod289(vec3 x) {- return x - floor(x * (1.0 / 289.0)) * 289.0;-}--vec4 mod289(vec4 x) {- return x - floor(x * (1.0 / 289.0)) * 289.0;-}--vec4 permute(vec4 x)-{- return mod289(((x*34.0)+1.0)*x);-}--vec4 taylorInvSqrt(vec4 r)-{- return 1.79284291400159 - 0.85373472095314 * r;-}--`--export const simplexNoise3d = `-//-// Description : Array and textureless GLSL 2D/3D/4D simplex-// noise functions.-// Author : Ian McEwan, Ashima Arts.-// Maintainer : ijm-// Lastmod : 20110822 (ijm)-// License : Copyright (C) 2011 Ashima Arts. All rights reserved.-// Distributed under the MIT License. See LICENSE file.-// https://github.com/ashima/webgl-noise-//--float snoise3D(vec3 v)- {- const vec2 C = vec2(1.0/6.0, 1.0/3.0) ;- const vec4 D = vec4(0.0, 0.5, 1.0, 2.0);--// First corner- vec3 i = floor(v + dot(v, C.yyy) );- vec3 x0 = v - i + dot(i, C.xxx) ;--// Other corners- vec3 g = step(x0.yzx, x0.xyz);- vec3 l = 1.0 - g;- vec3 i1 = min( g.xyz, l.zxy );- vec3 i2 = max( g.xyz, l.zxy );-- // x0 = x0 - 0.0 + 0.0 * C.xxx;- // x1 = x0 - i1 + 1.0 * C.xxx;- // x2 = x0 - i2 + 2.0 * C.xxx;- // x3 = x0 - 1.0 + 3.0 * C.xxx;- vec3 x1 = x0 - i1 + C.xxx;- vec3 x2 = x0 - i2 + C.yyy; // 2.0*C.x = 1/3 = C.y- vec3 x3 = x0 - D.yyy; // -1.0+3.0*C.x = -0.5 = -D.y--// Permutations- i = mod289(i);- vec4 p = permute( permute( permute(- i.z + vec4(0.0, i1.z, i2.z, 1.0 ))- + i.y + vec4(0.0, i1.y, i2.y, 1.0 ))- + i.x + vec4(0.0, i1.x, i2.x, 1.0 ));--// Gradients: 7x7 points over a square, mapped onto an octahedron.-// The ring size 17*17 = 289 is close to a multiple of 49 (49*6 = 294)- float n_ = 0.142857142857; // 1.0/7.0- vec3 ns = n_ * D.wyz - D.xzx;-- vec4 j = p - 49.0 * floor(p * ns.z * ns.z); // mod(p,7*7)-- vec4 x_ = floor(j * ns.z);- vec4 y_ = floor(j - 7.0 * x_ ); // mod(j,N)-- vec4 x = x_ *ns.x + ns.yyyy;- vec4 y = y_ *ns.x + ns.yyyy;- vec4 h = 1.0 - abs(x) - abs(y);-- vec4 b0 = vec4( x.xy, y.xy );- vec4 b1 = vec4( x.zw, y.zw );-- //vec4 s0 = vec4(lessThan(b0,0.0))*2.0 - 1.0;- //vec4 s1 = vec4(lessThan(b1,0.0))*2.0 - 1.0;- vec4 s0 = floor(b0)*2.0 + 1.0;- vec4 s1 = floor(b1)*2.0 + 1.0;- vec4 sh = -step(h, vec4(0.0));-- vec4 a0 = b0.xzyw + s0.xzyw*sh.xxyy ;- vec4 a1 = b1.xzyw + s1.xzyw*sh.zzww ;-- vec3 p0 = vec3(a0.xy,h.x);- vec3 p1 = vec3(a0.zw,h.y);- vec3 p2 = vec3(a1.xy,h.z);- vec3 p3 = vec3(a1.zw,h.w);--//Normalise gradients- vec4 norm = taylorInvSqrt(vec4(dot(p0,p0), dot(p1,p1), dot(p2, p2), dot(p3,p3)));- p0 *= norm.x;- p1 *= norm.y;- p2 *= norm.z;- p3 *= norm.w;--// Mix final noise value- vec4 m = max(0.6 - vec4(dot(x0,x0), dot(x1,x1), dot(x2,x2), dot(x3,x3)), 0.0);- m = m * m;- return 42.0 * dot( m*m, vec4( dot(p0,x0), dot(p1,x1),- dot(p2,x2), dot(p3,x3) ) );- }--#pragma glslify: export(snoise)-`-export const periodicNoise3d = `-//-// GLSL textureless classic 3D noise "cnoise",-// with an RSL-style periodic variant "pnoise".-// Author: Stefan Gustavson ([email protected])-// Version: 2011-10-11-//-// Many thanks to Ian McEwan of Ashima Arts for the-// ideas for permutation and gradient selection.-//-// Copyright (c) 2011 Stefan Gustavson. All rights reserved.-// Distributed under the MIT license. See LICENSE file.-// https://github.com/ashima/webgl-noise-//---vec3 fade(vec3 t) {- return t*t*t*(t*(t*6.0-15.0)+10.0);-}--// Classic Perlin noise, periodic variant-float pnoise3D(vec3 P, vec3 rep)-{- vec3 Pi0 = mod(floor(P), rep); // Integer part, modulo period- vec3 Pi1 = mod(Pi0 + vec3(1.0), rep); // Integer part + 1, mod period- Pi0 = mod289(Pi0);- Pi1 = mod289(Pi1);- vec3 Pf0 = fract(P); // Fractional part for interpolation- vec3 Pf1 = Pf0 - vec3(1.0); // Fractional part - 1.0- vec4 ix = vec4(Pi0.x, Pi1.x, Pi0.x, Pi1.x);- vec4 iy = vec4(Pi0.yy, Pi1.yy);- vec4 iz0 = Pi0.zzzz;- vec4 iz1 = Pi1.zzzz;-- vec4 ixy = permute(permute(ix) + iy);- vec4 ixy0 = permute(ixy + iz0);- vec4 ixy1 = permute(ixy + iz1);-- vec4 gx0 = ixy0 * (1.0 / 7.0);- vec4 gy0 = fract(floor(gx0) * (1.0 / 7.0)) - 0.5;- gx0 = fract(gx0);- vec4 gz0 = vec4(0.5) - abs(gx0) - abs(gy0);- vec4 sz0 = step(gz0, vec4(0.0));- gx0 -= sz0 * (step(0.0, gx0) - 0.5);- gy0 -= sz0 * (step(0.0, gy0) - 0.5);-- vec4 gx1 = ixy1 * (1.0 / 7.0);- vec4 gy1 = fract(floor(gx1) * (1.0 / 7.0)) - 0.5;- gx1 = fract(gx1);- vec4 gz1 = vec4(0.5) - abs(gx1) - abs(gy1);- vec4 sz1 = step(gz1, vec4(0.0));- gx1 -= sz1 * (step(0.0, gx1) - 0.5);- gy1 -= sz1 * (step(0.0, gy1) - 0.5);-- vec3 g000 = vec3(gx0.x,gy0.x,gz0.x);- vec3 g100 = vec3(gx0.y,gy0.y,gz0.y);- vec3 g010 = vec3(gx0.z,gy0.z,gz0.z);- vec3 g110 = vec3(gx0.w,gy0.w,gz0.w);- vec3 g001 = vec3(gx1.x,gy1.x,gz1.x);- vec3 g101 = vec3(gx1.y,gy1.y,gz1.y);- vec3 g011 = vec3(gx1.z,gy1.z,gz1.z);- vec3 g111 = vec3(gx1.w,gy1.w,gz1.w);-- vec4 norm0 = taylorInvSqrt(vec4(dot(g000, g000), dot(g010, g010), dot(g100, g100), dot(g110, g110)));- g000 *= norm0.x;- g010 *= norm0.y;- g100 *= norm0.z;- g110 *= norm0.w;- vec4 norm1 = taylorInvSqrt(vec4(dot(g001, g001), dot(g011, g011), dot(g101, g101), dot(g111, g111)));- g001 *= norm1.x;- g011 *= norm1.y;- g101 *= norm1.z;- g111 *= norm1.w;-- float n000 = dot(g000, Pf0);- float n100 = dot(g100, vec3(Pf1.x, Pf0.yz));- float n010 = dot(g010, vec3(Pf0.x, Pf1.y, Pf0.z));- float n110 = dot(g110, vec3(Pf1.xy, Pf0.z));- float n001 = dot(g001, vec3(Pf0.xy, Pf1.z));- float n101 = dot(g101, vec3(Pf1.x, Pf0.y, Pf1.z));- float n011 = dot(g011, vec3(Pf0.x, Pf1.yz));- float n111 = dot(g111, Pf1);-- vec3 fade_xyz = fade(Pf0);- vec4 n_z = mix(vec4(n000, n100, n010, n110), vec4(n001, n101, n011, n111), fade_xyz.z);- vec2 n_yz = mix(n_z.xy, n_z.zw, fade_xyz.y);- float n_xyz = mix(n_yz.x, n_yz.y, fade_xyz.x);- return 2.2 * n_xyz;-}--#pragma glslify: export(pnoise)-`--export const blendSoftLight = `-// The MIT License (MIT) Copyright (c) 2015 Matt DesLauriers-//-// Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:-//-// The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.-//-// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.--vec3 blendSoftLight(vec3 base, vec3 blend) {- return mix(- sqrt(base) * (2.0 * blend - 1.0) + 2.0 * base * (1.0 - blend),- 2.0 * base * blend + base * base * (1.0 - 2.0 * blend),- step(base, vec3(0.5))- );-}-`--export const luma = `-// This software is released under the MIT license:-//-// Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:-//-// The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.-//-// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.--float luma(vec3 color) {- return dot(color, vec3(0.299, 0.587, 0.114));-}--float luma(vec4 color) {- return dot(color.rgb, vec3(0.299, 0.587, 0.114));-}-`diff --git a/apps/www/components/LaunchWeek/14/effects/hud-shader.ts b/apps/www/components/LaunchWeek/14/effects/hud-shader.tsdeleted file mode 100644index b0cb8c1c8e2..00000000000--- a/apps/www/components/LaunchWeek/14/effects/hud-shader.ts+++ /dev/null@@ -1,132 +0,0 @@-import { blendSoftLight, luma, periodicNoise3d, shared, simplexNoise3d } from './helpers'--export const HUDShader = {- vertexShader: `-precision mediump float;--varying vec2 vUv;--void main() {- vUv = uv;- gl_Position = projectionMatrix * modelViewMatrix * vec4(position, 1.0);-}-`,- fragmentShader: `- uniform sampler2D tDiffuse;- uniform vec2 resolution;- uniform float vignetteRadius;- uniform float vignetteSmoothness;- uniform float time;-- varying vec2 vUv;- varying vec2 screenPosition;-- ${shared}- ${periodicNoise3d}- ${simplexNoise3d}- ${blendSoftLight}- ${luma}-- // grain function- // The MIT License (MIT) Copyright (c) 2015 Matt DesLauriers- // Permission is hereby granted, free of charge, to any person obtaining a copy- // of this software and associated documentation files (the "Software"), to deal- // in the Software without restriction, including without limitation the rights- // to use, copy, modify, merge, publish, distribute, sublicense, and/or sell- // copies of the Software, and to permit persons to whom the Software is- // furnished to do so, subject to the following conditions:- //- // The above copyright notice and this permission notice shall be included in all- // copies or substantial portions of the Software.- //- // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR- // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,- // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE- // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER- // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,- // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE- // SOFTWARE.-- float grain(vec2 texCoord, vec2 resolution, float frame, float multiplier) {- vec2 mult = texCoord * resolution;- float offset = snoise3D(vec3(mult / multiplier, frame));- float n1 = pnoise3D(vec3(mult, offset), vec3(1.0/texCoord * resolution, 1.0));- return n1 / 2.0 + 0.5;- }-- float grain(vec2 texCoord, vec2 resolution, float frame) {- return grain(texCoord, resolution, frame, 2.5);- }-- float grain(vec2 texCoord, vec2 resolution) {- return grain(texCoord, resolution, 0.0);- }-- // Vignette function- // MIT License- //- // Copyright (c) 2017 Tyler Lindberg- //- // Permission is hereby granted, free of charge, to any person obtaining a copy- // of this software and associated documentation files (the "Software"), to deal- // in the Software without restriction, including without limitation the rights- // to use, copy, modify, merge, publish, distribute, sublicense, and/or sell- // copies of the Software, and to permit persons to whom the Software is- // furnished to do so, subject to the following conditions:- //- // The above copyright notice and this permission notice shall be included in all- // copies or substantial portions of the Software.- //- // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR- // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,- // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE- // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER- // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,- // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE- // SOFTWARE.-- float vignette(vec2 uv, float radius, float smoothness) {- float diff = radius - distance(uv, vec2(0.5, 0.5));- return smoothstep(-smoothness, smoothness, diff);- }-- void main() {- // Sample the diffuse texture to get base color with alpha-- vec4 blackBase = vec4(0.0, 0.0, 0.0, 1.0);-- float v = vignette(vUv, vignetteRadius, vignetteSmoothness);- float invertedVignette = 1.0 - v;-- float minAlpha = 0.3;- blackBase.a *= mix(minAlpha, 1.0, invertedVignette);-- vec4 textureColor = texture2D(tDiffuse, vUv);-- vec4 stackedColor = vec4(- mix(blackBase.rgb, textureColor.rgb, textureColor.a),- mix(blackBase.a, max(blackBase.a, textureColor.a), 0.8)- );-- float grainSize = 3.0 + 4.0 * sin(time);- vec3 g = vec3(grain(vUv, resolution / grainSize, time));-- vec3 noiseColor = blendSoftLight(vec3(0.2,0.2,0.2), g);-- float grainStrength = 0.02;- stackedColor = vec4(- mix(stackedColor.rgb, noiseColor, grainStrength),- stackedColor.a- );-- gl_FragColor = stackedColor;- }-`,- uniforms: {- tDiffuse: { value: null as any },- time: { value: 0.0 },- resolution: { value: [70.0, 100.0] }, // Adjusted for Lygia noise scale- vignetteSmoothness: { value: 0 },- vignetteRadius: { value: 1 },- },-}diff --git a/apps/www/components/LaunchWeek/14/effects/transparent-bloom.ts b/apps/www/components/LaunchWeek/14/effects/transparent-bloom.tsdeleted file mode 100644index b63fd6f11cb..00000000000--- a/apps/www/components/LaunchWeek/14/effects/transparent-bloom.ts+++ /dev/null@@ -1,437 +0,0 @@-/**- * ISC License- *- * Copyright 2021 mbalex99- *- * Permission to use, copy, modify, and/or distribute this software for any purpose with or without fee is hereby granted,- * provided that the above copyright notice and this permission notice appear in all copies.- *- * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE- * INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE- * FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM- * LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION,- * ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.- */--import {- AdditiveBlending,- Color,- LinearFilter,- MeshBasicMaterial,- RGBAFormat,- ShaderMaterial,- Texture,- UniformsUtils,- Vector2,- Vector3,- WebGLRenderer,- WebGLRenderTarget,-} from 'three'--import { Pass } from 'three/examples/jsm/postprocessing/Pass'--// typescript definitions doesn't have FullScreenQuad-//@ts-ignore-import { FullScreenQuad } from 'three/examples/jsm/postprocessing/Pass'--import { CopyShader } from 'three/examples/jsm/shaders/CopyShader.js'-import { LuminosityHighPassShader } from 'three/examples/jsm/shaders/LuminosityHighPassShader.js'--/**- * Thanks to https://github.com/mrdoob/three.js/issues/14104#issuecomment-429664412 for this fragmentShaderfix- *- * UnrealBloomPass is inspired by the bloom pass of Unreal Engine. It creates a- * mip map chain of bloom textures and blurs them with different radii. Because- * of the weighted combination of mips, and because larger blurs are done on- * higher mips, this effect provides good quality and performance.- *- * Reference:- * - https://docs.unrealengine.com/latest/INT/Engine/Rendering/PostProcessEffects/Bloom/- */-class TransparentBloomPass extends Pass {- strength: number- radius: number- threshold: number- resolution: Vector2- clearColor: Color- renderTargetsHorizontal: any[]- renderTargetsVertical: any[]- nMips: number- renderTargetBright: WebGLRenderTarget- highPassUniforms: any- materialHighPassFilter: ShaderMaterial- separableBlurMaterials: any[]- compositeMaterial: ShaderMaterial- bloomTintColors: Vector3[]- copyUniforms: any- materialCopy: ShaderMaterial- _oldClearColor: Color- oldClearAlpha: number- basic: MeshBasicMaterial- fsQuad: FullScreenQuad- static BlurDirectionX: any- static BlurDirectionY: any- constructor(resolution: Vector2, strength: number, radius: number, threshold: number) {- super()-- this.strength = strength !== undefined ? strength : 1- this.radius = radius- this.threshold = threshold- this.resolution =- resolution !== undefined ? new Vector2(resolution.x, resolution.y) : new Vector2(256, 256)-- // create color only once here, reuse it later inside the render function- this.clearColor = new Color(0, 0, 0)-- // render targets- const pars = {- minFilter: LinearFilter,- magFilter: LinearFilter,- format: RGBAFormat,- }- this.renderTargetsHorizontal = []- this.renderTargetsVertical = []- this.nMips = 5- let resx = Math.round(this.resolution.x / 2)- let resy = Math.round(this.resolution.y / 2)-- this.renderTargetBright = new WebGLRenderTarget(resx, resy, pars)- this.renderTargetBright.texture.name = 'UnrealBloomPass.bright'- this.renderTargetBright.texture.generateMipmaps = false-- for (let i = 0; i < this.nMips; i++) {- const renderTargetHorizonal = new WebGLRenderTarget(resx, resy, pars)-- renderTargetHorizonal.texture.name = 'UnrealBloomPass.h' + i- renderTargetHorizonal.texture.generateMipmaps = false-- this.renderTargetsHorizontal.push(renderTargetHorizonal)-- const renderTargetVertical = new WebGLRenderTarget(resx, resy, pars)-- renderTargetVertical.texture.name = 'UnrealBloomPass.v' + i- renderTargetVertical.texture.generateMipmaps = false-- this.renderTargetsVertical.push(renderTargetVertical)-- resx = Math.round(resx / 2)-- resy = Math.round(resy / 2)- }-- // luminosity high pass material-- if (LuminosityHighPassShader === undefined)- console.error('THREE.UnrealBloomPass relies on LuminosityHighPassShader')-- const highPassShader = LuminosityHighPassShader- this.highPassUniforms = UniformsUtils.clone(highPassShader.uniforms)-- this.highPassUniforms['luminosityThreshold'].value = threshold- this.highPassUniforms['smoothWidth'].value = 0.01-- this.materialHighPassFilter = new ShaderMaterial({- uniforms: this.highPassUniforms,- vertexShader: highPassShader.vertexShader,- fragmentShader: highPassShader.fragmentShader,- defines: {},- })-- // Gaussian Blur Materials- this.separableBlurMaterials = []- const kernelSizeArray = [3, 5, 7, 9, 11]- resx = Math.round(this.resolution.x / 2)- resy = Math.round(this.resolution.y / 2)-- for (let i = 0; i < this.nMips; i++) {- this.separableBlurMaterials.push(this.getSeperableBlurMaterial(kernelSizeArray[i]))-- this.separableBlurMaterials[i].uniforms['texSize'].value = new Vector2(resx, resy)-- resx = Math.round(resx / 2)-- resy = Math.round(resy / 2)- }-- // Composite material- this.compositeMaterial = this.getCompositeMaterial(this.nMips)- this.compositeMaterial.uniforms['blurTexture1'].value = this.renderTargetsVertical[0].texture- this.compositeMaterial.uniforms['blurTexture2'].value = this.renderTargetsVertical[1].texture- this.compositeMaterial.uniforms['blurTexture3'].value = this.renderTargetsVertical[2].texture- this.compositeMaterial.uniforms['blurTexture4'].value = this.renderTargetsVertical[3].texture- this.compositeMaterial.uniforms['blurTexture5'].value = this.renderTargetsVertical[4].texture- this.compositeMaterial.uniforms['bloomStrength'].value = strength- this.compositeMaterial.uniforms['bloomRadius'].value = 0.1- this.compositeMaterial.needsUpdate = true-- const bloomFactors = [1.0, 0.8, 0.6, 0.4, 0.2]- this.compositeMaterial.uniforms['bloomFactors'].value = bloomFactors- this.bloomTintColors = [- new Vector3(1, 1, 1),- new Vector3(1, 1, 1),- new Vector3(1, 1, 1),- new Vector3(1, 1, 1),- new Vector3(1, 1, 1),- ]- this.compositeMaterial.uniforms['bloomTintColors'].value = this.bloomTintColors-- // copy material- if (CopyShader === undefined) {- console.error('THREE.UnrealBloomPass relies on CopyShader')- }-- const copyShader = CopyShader-- this.copyUniforms = UniformsUtils.clone(copyShader.uniforms)- this.copyUniforms['opacity'].value = 1.0-- this.materialCopy = new ShaderMaterial({- uniforms: this.copyUniforms,- vertexShader: copyShader.vertexShader,- fragmentShader: copyShader.fragmentShader,- blending: AdditiveBlending,- depthTest: false,- depthWrite: false,- transparent: true,- })-- this.enabled = true- this.needsSwap = false-- this._oldClearColor = new Color()- this.oldClearAlpha = 1-- this.basic = new MeshBasicMaterial()-- this.fsQuad = new FullScreenQuad(undefined)- }-- dispose() {- for (let i = 0; i < this.renderTargetsHorizontal.length; i++) {- this.renderTargetsHorizontal[i].dispose()- }-- for (let i = 0; i < this.renderTargetsVertical.length; i++) {- this.renderTargetsVertical[i].dispose()- }-- this.renderTargetBright.dispose()- }-- setSize(width: number, height: number) {- let resx = Math.round(width / 2)- let resy = Math.round(height / 2)-- this.renderTargetBright.setSize(resx, resy)-- for (let i = 0; i < this.nMips; i++) {- this.renderTargetsHorizontal[i].setSize(resx, resy)- this.renderTargetsVertical[i].setSize(resx, resy)-- this.separableBlurMaterials[i].uniforms['texSize'].value = new Vector2(resx, resy)-- resx = Math.round(resx / 2)- resy = Math.round(resy / 2)- }- }-- render(- renderer: WebGLRenderer,- writeBuffer: any,- readBuffer: { texture: Texture },- deltaTime: any,- maskActive: any- ) {- renderer.getClearColor(this._oldClearColor)- this.oldClearAlpha = renderer.getClearAlpha()- const oldAutoClear = renderer.autoClear- renderer.autoClear = false-- renderer.setClearColor(this.clearColor, 0)-- if (maskActive) renderer.state.buffers.stencil.setTest(false)-- // Render input to screen-- if (this.renderToScreen) {- this.fsQuad.material = this.basic- this.basic.map = readBuffer.texture-- renderer.setRenderTarget(null)- renderer.clear()- this.fsQuad.render(renderer)- }-- // 1. Extract Bright Areas-- this.highPassUniforms['tDiffuse'].value = readBuffer.texture- this.highPassUniforms['luminosityThreshold'].value = this.threshold- this.fsQuad.material = this.materialHighPassFilter-- renderer.setRenderTarget(this.renderTargetBright)- renderer.clear()- this.fsQuad.render(renderer)-- // 2. Blur All the mips progressively-- let inputRenderTarget = this.renderTargetBright-- for (let i = 0; i < this.nMips; i++) {- this.fsQuad.material = this.separableBlurMaterials[i]-- this.separableBlurMaterials[i].uniforms['colorTexture'].value = inputRenderTarget.texture- this.separableBlurMaterials[i].uniforms['direction'].value =- TransparentBloomPass.BlurDirectionX- renderer.setRenderTarget(this.renderTargetsHorizontal[i])- renderer.clear()- this.fsQuad.render(renderer)-- this.separableBlurMaterials[i].uniforms['colorTexture'].value =- this.renderTargetsHorizontal[i].texture- this.separableBlurMaterials[i].uniforms['direction'].value =- TransparentBloomPass.BlurDirectionY- renderer.setRenderTarget(this.renderTargetsVertical[i])- renderer.clear()- this.fsQuad.render(renderer)-- inputRenderTarget = this.renderTargetsVertical[i]- }-- // Composite All the mips-- this.fsQuad.material = this.compositeMaterial- this.compositeMaterial.uniforms['bloomStrength'].value = this.strength- this.compositeMaterial.uniforms['bloomRadius'].value = this.radius- this.compositeMaterial.uniforms['bloomTintColors'].value = this.bloomTintColors-- renderer.setRenderTarget(this.renderTargetsHorizontal[0])- renderer.clear()- this.fsQuad.render(renderer)-- // Blend it additively over the input texture-- this.fsQuad.material = this.materialCopy- this.copyUniforms['tDiffuse'].value = this.renderTargetsHorizontal[0].texture-- if (maskActive) renderer.state.buffers.stencil.setTest(true)-- if (this.renderToScreen) {- renderer.setRenderTarget(null)- this.fsQuad.render(renderer)- } else {- renderer.setRenderTarget(readBuffer as any)- this.fsQuad.render(renderer)- }-- // Restore renderer settings-- renderer.setClearColor(this._oldClearColor, this.oldClearAlpha)- renderer.autoClear = oldAutoClear- }-- getSeperableBlurMaterial(kernelRadius: number) {- return new ShaderMaterial({- defines: {- KERNEL_RADIUS: kernelRadius,- SIGMA: kernelRadius,- },-- uniforms: {- colorTexture: { value: null },- texSize: { value: new Vector2(0.5, 0.5) },- direction: { value: new Vector2(0.5, 0.5) },- },-- vertexShader: `varying vec2 vUv;- void main() {- vUv = uv;- gl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );- }`,-- fragmentShader: `#include <common>- varying vec2 vUv;- uniform sampler2D colorTexture;- uniform vec2 texSize;- uniform vec2 direction;-- float gaussianPdf(in float x, in float sigma) {- return 0.39894 * exp( -0.5 * x * x/( sigma * sigma))/sigma;- }- void main() {\n\- vec2 invSize = 1.0 / texSize;\- float fSigma = float(SIGMA);\- float weightSum = gaussianPdf(0.0, fSigma);\- float alphaSum = 0.0;\- vec3 diffuseSum = texture2D( colorTexture, vUv).rgb * weightSum;\- for( int i = 1; i < KERNEL_RADIUS; i ++ ) {\- float x = float(i);\- float w = gaussianPdf(x, fSigma);\- vec2 uvOffset = direction * invSize * x;\- vec4 sample1 = texture2D( colorTexture, vUv + uvOffset);\- vec4 sample2 = texture2D( colorTexture, vUv - uvOffset);\- diffuseSum += (sample1.rgb + sample2.rgb) * w;\- alphaSum += (sample1.a + sample2.a) * w;\- weightSum += 2.0 * w;\- }\- gl_FragColor = vec4(diffuseSum/weightSum, alphaSum/weightSum);\n\- }`,- })- }-- getCompositeMaterial(nMips: number) {- return new ShaderMaterial({- defines: {- NUM_MIPS: nMips,- },-- uniforms: {- blurTexture1: { value: null },- blurTexture2: { value: null },- blurTexture3: { value: null },- blurTexture4: { value: null },- blurTexture5: { value: null },- dirtTexture: { value: null },- bloomStrength: { value: 1.0 },- bloomFactors: { value: null },- bloomTintColors: { value: null },- bloomRadius: { value: 0.0 },- },-- vertexShader: `varying vec2 vUv;- void main() {- vUv = uv;- gl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );- }`,-- fragmentShader: `varying vec2 vUv;- uniform sampler2D blurTexture1;- uniform sampler2D blurTexture2;- uniform sampler2D blurTexture3;- uniform sampler2D blurTexture4;- uniform sampler2D blurTexture5;- uniform sampler2D dirtTexture;- uniform float bloomStrength;- uniform float bloomRadius;- uniform float bloomFactors[NUM_MIPS];- uniform vec3 bloomTintColors[NUM_MIPS];-- float lerpBloomFactor(const in float factor) {- float mirrorFactor = 1.2 - factor;- return mix(factor, mirrorFactor, bloomRadius);- }-- void main() {- gl_FragColor = bloomStrength * ( lerpBloomFactor(bloomFactors[0]) * vec4(bloomTintColors[0], 1.0) * texture2D(blurTexture1, vUv) +- lerpBloomFactor(bloomFactors[1]) * vec4(bloomTintColors[1], 1.0) * texture2D(blurTexture2, vUv) +- lerpBloomFactor(bloomFactors[2]) * vec4(bloomTintColors[2], 1.0) * texture2D(blurTexture3, vUv) +- lerpBloomFactor(bloomFactors[3]) * vec4(bloomTintColors[3], 1.0) * texture2D(blurTexture4, vUv) +- lerpBloomFactor(bloomFactors[4]) * vec4(bloomTintColors[4], 1.0) * texture2D(blurTexture5, vUv) );- }`,- })- }-}--TransparentBloomPass.BlurDirectionX = new Vector2(1.0, 0.0)-TransparentBloomPass.BlurDirectionY = new Vector2(0.0, 1.0)--export { TransparentBloomPass as UnrealBloomPass, TransparentBloomPass }diff --git a/apps/www/components/LaunchWeek/14/helpers.ts b/apps/www/components/LaunchWeek/14/helpers.tsdeleted file mode 100644index b9bbb677ddd..00000000000--- a/apps/www/components/LaunchWeek/14/helpers.ts+++ /dev/null@@ -1,88 +0,0 @@-import { useRef, useEffect } from 'react'-import { GLTF, GLTFLoader } from 'three/examples/jsm/loaders/GLTFLoader.js'--/**- * Helper to simplifies controlling requestAnimationFrame- * @param callback Animation callback function- * @returns Object with start and stop functions- */-export const createThreeAnimation = (callback: (time?: number) => void) => {- const requestRef = { current: undefined } as { current: number | undefined }- const previousTimeRef = { current: undefined } as { current: number | undefined }-- const animate = (time: number) => {- if (previousTimeRef.current !== undefined) {- callback(time)- }- previousTimeRef.current = time- requestRef.current = requestAnimationFrame(animate)- }-- const start = () => {- requestRef.current = requestAnimationFrame(animate)- }-- const stop = () => {- if (requestRef.current) {- cancelAnimationFrame(requestRef.current)- }- }-- return { start, stop }-}--/**- * Helper function to load a GLTF model- * @param url URL of the GLTF model to load- * @returns Promise that resolves with the loaded model- */-export const loadGLTFModel = (url: string) => {- return new Promise<GLTF>((resolve, reject) => {- const loader = new GLTFLoader()- loader.load(- url,- (gltf) => {- resolve(gltf)- },- undefined,- (error) => reject(error)- )- })-}--/**- * Custom hook for Three.js setup and animation- * @param setupCallback Callback function for setting up the scene- * @returns Object with containerRef- */-export const useThreeJS = (- setupCallback: (container: HTMLElement) => {- cleanup: () => void- animate: (time?: number) => void- }-) => {- const containerRef = useRef<HTMLDivElement>(null)-- useEffect(() => {- if (!containerRef.current) return-- const container = containerRef.current- const renderer = setupCallback(container)-- // Set up animation loop- const { start, stop } = createThreeAnimation(renderer.animate.bind(renderer))- start()-- // Cleanup on unmount- return () => {- stop()- renderer.cleanup()- }- }, [setupCallback])-- return { containerRef }-}--export function colorObjToRgb(color: { rgb: number; alpha: number }) {- return `rgb(${(color.rgb >> 16) & 255} ${(color.rgb >> 8) & 255} ${(color.rgb >> 0) & 255} / ${color.alpha})`-}diff --git a/apps/www/components/LaunchWeek/14/scenes/TicketScene.ts b/apps/www/components/LaunchWeek/14/scenes/TicketScene.tsdeleted file mode 100644index af785a1b8f1..00000000000--- a/apps/www/components/LaunchWeek/14/scenes/TicketScene.ts+++ /dev/null@@ -1,1210 +0,0 @@-import * as THREE from 'three'-import { colorObjToRgb, loadGLTFModel } from '../helpers'-import SceneRenderer, { BaseScene } from '../utils/SceneRenderer'-import { RenderPass } from 'three/examples/jsm/postprocessing/RenderPass'-import { Camera, Euler, MathUtils, Scene, Vector3 } from 'three'-import { GlitchPass } from '../effects/glitch'-import { ShaderPass } from 'three/examples/jsm/postprocessing/ShaderPass'-import { FXAAShader } from 'three/examples/jsm/shaders/FXAAShader'-import { CRTShader } from '../effects/crt-shader'-import { OutputPass } from 'three/examples/jsm/postprocessing/OutputPass'-import { TransparentBloomPass } from '../effects/transparent-bloom'--interface TicketSceneState {- visible: boolean- secret: boolean- platinum: boolean- frontside: boolean- ticketNumber: number- narrow: boolean- texts: {- username: string- seatCode: string- date: string- }-}--interface TicketSceneOptions {- defaultVisible?: boolean- defaultSecret?: boolean- defaultPlatinum?: boolean- user: {- id?: string- name?: string- ticketNumber?: number- }- narrow?: boolean- onSeatChartButtonClicked?: () => void- onWebsiteButtonClicked?: () => void- onGoBackButtonClicked?: () => void-}--type AvailableTextures = (typeof TicketScene)['TEXTURE_NAMES'][number]--interface TextureDescriptor {- url: string- cachedData: THREE.Texture | null-}--class TicketScene implements BaseScene {- raycaster = new THREE.Raycaster()- sceneUrl = '/images/launchweek/14/ticket-model.glb'-- textureImages = {- basic: {- back: {- url: '/images/launchweek/14/back-basic-ticket-texture.png',- cachedData: null,- } as TextureDescriptor,- front: {- url: '/images/launchweek/14/front-basic-ticket-texture.png',- cachedData: null,- } as TextureDescriptor,-- bgColor: { rgb: 0x202020, alpha: 1 },- textColor: { rgb: 0xffffff, alpha: 1 },- textDimmedColor: { rgb: 0x515151, alpha: 1 },- textNeonColor: { rgb: 0xffffff, alpha: 1 },- textNeonDimmedColor: { rgb: 0x515151, alpha: 1 },- transparentBg: { rgb: 0x000000, alpha: 0 },- },- secret: {- back: {- url: '/images/launchweek/14/back-secret-ticket-texture.png',- cachedData: null,- } as TextureDescriptor,- front: {- url: '/images/launchweek/14/front-secret-ticket-texture.png',- cachedData: null,- } as TextureDescriptor,- seat: {- url: '',- cachedData: null,- } as TextureDescriptor,- bgColor: { rgb: 0x050505, alpha: 1 },- textColor: { rgb: 0xffffff, alpha: 1 },- textDimmedColor: { rgb: 0x515151, alpha: 1 },- textNeonColor: { rgb: 0x2cf494, alpha: 1 },- textNeonDimmedColor: { rgb: 0x12623b, alpha: 1 },- transparentBg: { rgb: 0x2cf494, alpha: 0.4 },- seatPath: new Path2D(- 'M0.824219 0.661133H41.2231C48.5923 0.661133 54.5703 6.63925 54.5703 14.0084V41.06C54.5703 48.4292 48.5923 54.4072 41.2231 54.4072H0.824219V0.661133Z'- ),- },- platinum: {- back: {- url: '/images/launchweek/14/back-platinum-ticket-texture.png',- cachedData: null,- } as TextureDescriptor,- front: {- url: '/images/launchweek/14/front-platinum-ticket-texture.png',- cachedData: null,- } as TextureDescriptor,-- bgColor: { rgb: 0x050505, alpha: 1 },- textColor: { rgb: 0xffc73a, alpha: 1 },- textDimmedColor: { rgb: 0xffc73a, alpha: 1 },- textNeonColor: { rgb: 0xffc73a, alpha: 1 },- textNeonDimmedColor: { rgb: 0xffc73a, alpha: 1 },- transparentBg: { rgb: 0xffc73a, alpha: 0.4 },- },- }-- typography = {- main: {- family: 'Departure Mono',- relativeSize: 100 / 1400,- },- ticketNumber: {- family: 'Nippo-Variable',- weight: 400,- relativeSize: 125 / 1400,- },- }-- texts = {- user: {- x: 367 / 2000,- y: 533 / 1400,- },- date: {- x: 1185 / 2000,- y: 255 / 1400,- },- ticketNumber: {- x: 368 / 2000,- y: 1077.69 / 1400,- },- ticketNumberBack: {- x: 368 / 2000,- y: 1070 / 1400,- },- seatStart: {- x: 561.89 / 2000,- y: 739.4 / 1400,- },- seatPositions: {- x: [- 0 / 2000,- 99.82 / 2000,- 199.77 / 2000,- 389.84 / 2000,- 488.05 / 2000,- 588.25 / 2000,- 688.43 / 2000,- 788.63 / 2000,- ],- y: [0 / 1400, 71.61 / 1400, 163.5 / 1400, 235.54 / 1400],- },- }-- fonts: ConstructorParameters<typeof FontFace>[] = [- [- 'Departure Mono',- 'url("/fonts/launchweek/14/DepartureMono-Regular.woff2") format("woff2")',- {- weight: '400',- style: 'normal',- },- ],- [- 'Nippo-Variable',- 'url("/fonts/launchweek/14/Nippo-Variable.woff2") format("woff2")',- {- weight: '400 700',- style: 'normal',- },- ],- ]-- state: TicketSceneState-- resolutions = {- 0: {- ticketPosition: new Vector3(0, 0, -1.6),- ticketScale: new Vector3(0.55, 0.55, 0.55),- },-- 480: {- ticketPosition: new Vector3(0, 0, -1.5),- ticketScale: new Vector3(0.65, 0.65, 0.65),- },-- 768: {- ticketPosition: new Vector3(0, 0, -0.5),- ticketScale: new Vector3(0.65, 0.65, 0.65),- },-- // 784: {- // ticketPosition: new Vector3(0, 0, -0.5),- // ticketScale: new Vector3(0.85, 0.85, 0.85),- // },-- 1024: {- ticketPosition: new Vector3(0, 0, -0.5),- ticketScale: new Vector3(1, 1, 1),- },- }-- narrowResolutions = {- 0: {- ticketPosition: new Vector3(0, 0, -1.6),- ticketScale: new Vector3(0.65, 0.65, 0.65),- },-- 480: {- ticketPosition: new Vector3(0, 0, -1.5),- ticketScale: new Vector3(0.65, 0.65, 0.65),- },-- 768: {- ticketPosition: new Vector3(0, 0, -0.5),- ticketScale: new Vector3(0.65, 0.65, 0.65),- },-- // 784: {- // ticketPosition: new Vector3(0, 0, -0.5),- // ticketScale: new Vector3(0.85, 0.85, 0.85),- // },-- 1024: {- ticketPosition: new Vector3(3.0, 0, 0),- ticketScale: new Vector3(1.2, 1.2, 1.2),- },-- 1280: {- ticketPosition: new Vector3(4.0, 0, 0),- ticketScale: new Vector3(1.4, 1.4, 1.4),- },- }-- private _internalState = {- naturalRotation: new Vector3(0, 0, Math.PI),- naturalPosition: new Vector3(0, 0, -0.5),- naturalScale: new Vector3(1, 1, 1),-- fontsLoaded: false,- loadedTextureType: null as 'basic' | 'secret' | 'platinum' | null,- effectsIntensity: 0,- }-- private _sceneConfig = {- camera: {- position: new Vector3(0, 10, 0),- rotation: new Euler(MathUtils.degToRad(-90), 0, 0),- fov: 30,- },- }-- private _sceneRenderer: SceneRenderer | null = null-- private _ticket: THREE.Scene | null = null- private _modelRenderPass: RenderPass | null = null- private static TEXTURE_NAMES = [- 'TicketFront',- 'TicketBack',- 'TicketEdge',- 'TicketFrontWebsiteButton',- 'TicketFrontSeatChartButton',- 'TicketBackGoBackButton',- 'TicketBackWebsiteButton',- ] as const- private static TEXTURE_PIXEL_DENSITY_FACTOR = 400- private texturePlaneMapping: { [key in AvailableTextures]?: 'back' | 'front' | 'edge' } = {- TicketFront: 'front',- TicketBack: 'back',- TicketEdge: 'edge',- TicketFrontWebsiteButton: 'front',- TicketFrontSeatChartButton: 'front',- TicketBackGoBackButton: 'back',- TicketBackWebsiteButton: 'back',- }-- private _textureCanvases: {- [key in AvailableTextures]?: { canvas: HTMLCanvasElement; context: CanvasRenderingContext2D }- } = {}-- private _namedMeshes: { [key in AvailableTextures]?: THREE.Mesh } = {}-- private _bloomPass: TransparentBloomPass | null = null- private _glitchPass: GlitchPass | null = null- private _crtPass: ShaderPass | null = null- private _effectsEnabled = false- private _fxaaPass: ShaderPass | null = null-- constructor(private options: TicketSceneOptions) {- this.state = {- visible: options.defaultVisible ?? false,- secret: options.defaultSecret || false,- platinum: options.defaultPlatinum || false,- frontside: true,- ticketNumber: options.user.ticketNumber || 0,- narrow: Boolean(options.narrow),- texts: {- username: options.user.name ?? '',- date: 'MAR 31—APR 4',- // Start assigning seats from A001- seatCode: (466561 + (options.user.ticketNumber || 0)).toString(36),- },- }- }-- getId(): string {- return 'TicketScene'- }-- async setup(context: SceneRenderer): Promise<Scene> {- this._sceneRenderer = context-- // Load fonts before loading the model- await this._loadFonts()- await this._preloadAllTextureSets()-- const resolutionDescriptor = this.getResolutionDescriptor(window.innerWidth)-- this._internalState.naturalPosition.set(- resolutionDescriptor.ticketPosition.x,- resolutionDescriptor.ticketPosition.y,- resolutionDescriptor.ticketPosition.z- )-- this._internalState.naturalScale.set(- resolutionDescriptor.ticketScale.x,- resolutionDescriptor.ticketScale.y,- resolutionDescriptor.ticketScale.z- )-- const gltf = await loadGLTFModel(this.sceneUrl)-- this._ticket = gltf.scene.getObjectByName('Plane') as unknown as Scene-- if (!this.state.visible) this._ticket.scale.set(0, 0, 0)- this._ticket.rotation.setFromVector3(this._internalState.naturalRotation)- this._ticket.position.set(- this._internalState.naturalPosition.x,- this._internalState.naturalPosition.y,- this._internalState.naturalPosition.z- )-- this._setCamera(context.camera)- this._modelRenderPass = new RenderPass(gltf.scene as unknown as Scene, context.camera)-- // Set up post-processing effects but keep them disabled initially- this._setupPostProcessingEffects(context)-- // Important: Don't set clear values for the render pass- // Let the renderer handle clearing-- // Set renderer clear color to make background transparent- context.renderer.setClearColor(0x000000, 0)-- // Keep everything in linear space until the end of the pipeline- // Don't set outputColorSpace here- context.renderer.autoClear = false-- // Add ambient light with increased intensity- const ambientLight = new THREE.AmbientLight(0xffffff, 1.0)- this._ticket.add(ambientLight)-- // Add directional light- const directionalLight = new THREE.DirectionalLight(0xffffff, 1.5)- directionalLight.position.set(5, 5, 5)- gltf.scene.add(directionalLight)-- // Add a point light to better illuminate the placeholder- const pointLight = new THREE.PointLight(0xffffff, 1.0)- pointLight.position.set(0, 0, 5)- this._ticket.add(pointLight)-- this._setupNamedObjects()- this._setupTextureCanvases()- await this._loadTextures()-- context.composer.addPass(this._modelRenderPass)-- this._fxaaPass = new ShaderPass(FXAAShader)- this._fxaaPass.material.uniforms['resolution'].value.x = 1 / (window.innerWidth * 2)- this._fxaaPass.material.uniforms['resolution'].value.y = 1 / (window.innerHeight * 2)-- // Add the effects passes but with zero intensity- if (this._glitchPass) context.composer.addPass(this._glitchPass)- if (this._crtPass) context.composer.addPass(this._crtPass)- if (this._bloomPass) context.composer.addPass(this._bloomPass)- context.composer.addPass(new OutputPass())-- context.composer.addPass(this._fxaaPass)-- return gltf.scene as unknown as Scene- }-- update(context: SceneRenderer, time?: number): void {- // Clear the renderer with transparent background before rendering- context.renderer.clear(true, true, true)-- const mainRenderPass = context.composer.passes[0]- if (mainRenderPass instanceof RenderPass) {- this._updateNaturalPosition()- this._updateTicketSize()- this._updateTicketPosition()- if (this._ticket) this._updateTicketToFollowMouse(this._ticket, time)- this._updatePasses(time)- }- }-- cleanup(): void {}-- resize(_ev: UIEvent): void {- const resolutionDescriptor = this.getResolutionDescriptor(window.innerWidth)-- this._internalState.naturalPosition.set(- resolutionDescriptor.ticketPosition.x,- resolutionDescriptor.ticketPosition.y,- resolutionDescriptor.ticketPosition.z- )-- this._internalState.naturalScale.set(- resolutionDescriptor.ticketScale.x,- resolutionDescriptor.ticketScale.y,- resolutionDescriptor.ticketScale.z- )-- if (this._sceneRenderer && this._fxaaPass) {- this._fxaaPass.material.uniforms['resolution'].value.x = 1 / (window.innerWidth * 2)- this._fxaaPass.material.uniforms['resolution'].value.y = 1 / (window.innerHeight * 2)- }-- return- }-- showFrontSide() {- this.state.frontside = true- }-- showBackSide() {- this.state.frontside = false- }-- async upgradeToSecret() {- this.state.secret = true- await this._loadTextures()- // Start enabling effects gradually- this._enableSecretEffects()- }-- async upgradeToPlatinum() {- this.state.platinum = true- await this._loadTextures()- }-- // In your click method- click(_e: MouseEvent) {- if (!this._sceneRenderer || !this._sceneRenderer.mousePositionState?.isWithinContainer) return-- const mousePosition = this._sceneRenderer.mousePositionState-- this.raycaster.setFromCamera(- new THREE.Vector2(mousePosition.containerX, mousePosition.containerY),- this._sceneRenderer.camera- )-- // Get all meshes to check for intersection- const meshes = Object.values(this._namedMeshes).filter(Boolean) as THREE.Mesh[]-- // Check for intersections- const intersects = this.raycaster.intersectObjects(meshes, false)- //- for (const intersect of intersects) {- const clickedMesh = intersect.object as THREE.Mesh-- // Handle click based on which mesh was clicked- if (clickedMesh === this._namedMeshes.TicketFrontWebsiteButton) {- this.options.onWebsiteButtonClicked?.()- // Add your action here- } else if (clickedMesh === this._namedMeshes.TicketFrontSeatChartButton) {- this.options.onSeatChartButtonClicked?.()- // Add your action here- } else if (clickedMesh === this._namedMeshes.TicketBackGoBackButton) {- this.options.onGoBackButtonClicked?.()- } else if (clickedMesh === this._namedMeshes.TicketBackWebsiteButton) {- this.options.onWebsiteButtonClicked?.()- // Add your action here- }- }- }-- setVisible(value: boolean) {- this.state.visible = value- }-- setTicketNumber(ticketNumber: number) {- this.state.ticketNumber = ticketNumber- this.state.texts.seatCode = (466561 + ticketNumber).toString(36)- }-- setUserName(name: string) {- this.state.texts.username = name- }-- reloadTextures() {- this._loadTextures(true)- }-- devicePixelRatioChanged(newPixelRatio: number, oldPixelRatio: number): void {- // Update FXAA pass resolution values if it exists- if (this._fxaaPass) {- this._fxaaPass.material.uniforms['resolution'].value.x =- 1 / (window.innerWidth * newPixelRatio)- this._fxaaPass.material.uniforms['resolution'].value.y =- 1 / (window.innerHeight * newPixelRatio)- }-- // Regenerate texture canvases with new pixel ratio- this._setupTextureCanvases()-- // Reload textures to apply new pixel ratio- this._loadTextures(true)-- // Update bloom pass resolution if it exists- if (this._bloomPass && this._sceneRenderer) {- this._bloomPass.resolution.set(- this._sceneRenderer.container.clientWidth * newPixelRatio,- this._sceneRenderer.container.clientHeight * newPixelRatio- )- }- }-- private _enableSecretEffects() {- if (this._effectsEnabled) return // Already enabled-- this._effectsEnabled = true- this._internalState.effectsIntensity = 0-- // Enable all passes- if (this._glitchPass) this._glitchPass.enabled = true- if (this._crtPass) this._crtPass.enabled = true- if (this._bloomPass) this._bloomPass.enabled = true- }-- private _updatePasses(time?: number) {- if (!this._sceneRenderer) {- throw new Error('SceneRenderer not loaded')- }-- const mousePosition = this._sceneRenderer.mousePositionState-- // Update time-based uniforms for shader passes- if (this._crtPass && this._crtPass.uniforms['time']) {- this._crtPass.uniforms['time'].value = time- }-- // Update effect intensities if effects are enabled- if (this._effectsEnabled) {- // Gradually increase effect intensity over time- this._internalState.effectsIntensity = Math.min(- this._internalState.effectsIntensity + 0.01,- 1.0- )-- // Update glitch pass intensity- if (this._glitchPass) {- const glitchIntensity = mousePosition?.mouseIntensity ?? 1- this._glitchPass.setIntensity(glitchIntensity * this._internalState.effectsIntensity * 4)- }-- // Update CRT shader intensity- if (this._crtPass && this._crtPass.uniforms['intensity']) {- this._crtPass.uniforms['intensity'].value = this._internalState.effectsIntensity * 1 // Scale to desired max (0.3)- }-- // Update bloom pass parameters based on secret version state- if (this._bloomPass) {- if (this.state.secret) {- // Gradually increase bloom strength from 0 to 3 without affecting transparency- const targetStrength = 3.0- const currentStrength = this._bloomPass.strength || 0- const newStrength = currentStrength + (targetStrength - currentStrength) * 0.05- this._bloomPass.strength = newStrength-- // Gradually decrease threshold for more bloom- const targetThreshold = 0.2- const currentThreshold = this._bloomPass.threshold || 1.0- const newThreshold = currentThreshold - (currentThreshold - targetThreshold) * 0.05- this._bloomPass.threshold = newThreshold- } else {- // Gradually reset bloom to initial values- this._bloomPass.strength = Math.max(0, (this._bloomPass.strength || 0) - 0.05)- this._bloomPass.threshold = Math.min(1.0, (this._bloomPass.threshold || 0.2) + 0.05)- }- }- } else {- // If effects are disabled, ensure all intensities are zero- this._internalState.effectsIntensity = 0-- if (this._glitchPass) this._glitchPass.setIntensity(0)- if (this._crtPass && this._crtPass.uniforms['intensity'])- this._crtPass.uniforms['intensity'].value = 0- if (this._bloomPass) {- this._bloomPass.strength = 0- this._bloomPass.threshold = 1.0- this._bloomPass.radius = 0.5- }- }- }-- private _setupPostProcessingEffects(context: SceneRenderer) {- // Create glitch pass and disable it initially- const glitchPass = new GlitchPass(521)- glitchPass.enabled = false // Start disabled- glitchPass.uniforms.col_s.value = 0- glitchPass.setIntensity(0) // Start with zero intensity- this._glitchPass = glitchPass-- // Create CRT pass with initial zero intensity- const crtPass = new ShaderPass(CRTShader)- crtPass.enabled = false // Start disabled- crtPass.uniforms.intensity.value = 0 // Start with zero intensity- this._crtPass = crtPass-- if (!this._ticket) throw new Error('Ticket not loaded')- if (!this._sceneRenderer) throw new Error('SceneRenderer not loaded')-- // Create bloom pass with initial zero intensity- const bloomPass = new TransparentBloomPass(- new THREE.Vector2(context.container.clientWidth, context.container.clientHeight),- 0, // Initial strength (0-3)- 0.5, // Initial radius- 1.0 // Initial threshold (higher = less bloom)- )-- bloomPass.enabled = false // Start disabled- this._bloomPass = bloomPass- }-- private _updateTicketToFollowMouse(scene: THREE.Scene, dt?: number) {- if (!this._sceneRenderer) {- throw new Error('SceneRenderer not loaded')- }-- const mousePosition = this._sceneRenderer.mousePositionState-- if (mousePosition.isWithinContainer) {- // Get the scene's current position in world space- const scenePosition = new THREE.Vector3()- scene.getWorldPosition(scenePosition)-- // Convert scene position to normalized device coordinates (NDC)- const sceneNDC = scenePosition.clone()- sceneNDC.project(this._sceneRenderer.camera)-- // Calculate mouse position relative to the scene's position- // This gives us a vector from the scene center to the mouse- const relativeMouseX = mousePosition.containerX - sceneNDC.x- const relativeMouseY = mousePosition.containerY - sceneNDC.y-- // Scale the rotation based on distance from scene center- // The further from center, the more rotation- const distanceScale = Math.min(- 1.0,- Math.sqrt(relativeMouseX * relativeMouseX + relativeMouseY * relativeMouseY) * 2- )-- // Calculate rotation angles with distance scaling- // Limit the rotation angles to a reasonable range- const targetRotationX = MathUtils.clamp(relativeMouseY * -0.2 * distanceScale, -0.3, 0.3)- const targetRotationZ = MathUtils.clamp(relativeMouseX * -0.3 * distanceScale, -0.4, 0.4)-- // Apply smooth rotation with a smaller lerp factor- const lerpFactor = Math.min(dt ?? 0.05, 0.05)- scene.rotation.x = MathUtils.lerp(- scene.rotation.x,- this._internalState.naturalRotation.x + targetRotationX,- lerpFactor- )- scene.rotation.z = MathUtils.lerp(- scene.rotation.z,- this._internalState.naturalRotation.z + targetRotationZ,- lerpFactor- )- } else {- // Return to neutral position more slowly- const lerpFactor = Math.min(dt ?? 0.03, 0.03)- scene.rotation.x = MathUtils.lerp(- scene.rotation.x,- this._internalState.naturalRotation.x,- lerpFactor- )- scene.rotation.z = MathUtils.lerp(- scene.rotation.z,- this._internalState.naturalRotation.z,- lerpFactor- )- }- }-- private _updateNaturalPosition() {- if (this.state.frontside) {- this._internalState.naturalRotation.set(0, 0, Math.PI)- } else {- this._internalState.naturalRotation.set(0, 0, 0)- }- }-- private _setCamera(camera: Camera) {- camera.position.copy(this._sceneConfig.camera.position)- camera.rotation.copy(this._sceneConfig.camera.rotation)-- if (camera instanceof THREE.PerspectiveCamera) {- camera.fov = this._sceneConfig.camera.fov- camera.updateProjectionMatrix()- }- }-- _invisibleScaleVector = new Vector3(0, 0, 0)-- private _updateTicketSize() {- if (this.state.visible) {- this._ticket?.scale.lerp(this._internalState.naturalScale, 0.1)- } else {- this._ticket?.scale.lerp(this._invisibleScaleVector, 0.1)- }-- // Update world matrices after scaling to ensure raycaster works correctly- this._ticket?.updateMatrixWorld(true)-- // Update bounding boxes for all meshes after scaling- this._updateMeshBoundingBoxes()- }-- private _updateTicketPosition() {- this._ticket?.position.lerp(this._internalState.naturalPosition, 0.01)- }-- private _updateMeshBoundingBoxes() {- // Update bounding boxes for all named meshes- for (const meshName in this._namedMeshes) {- const mesh = this._namedMeshes[meshName as AvailableTextures]- if (mesh && mesh.geometry) {- // Ensure the geometry has a bounding box- if (!mesh.geometry.boundingBox) {- mesh.geometry.computeBoundingBox()- }- }- }- }-- private _setupTextureCanvases() {- for (const [name, mesh] of Object.entries(this._namedMeshes)) {- const planeType = this.texturePlaneMapping[name as AvailableTextures]- let referenceMesh: THREE.Mesh | undefined- if (planeType === 'front') {- referenceMesh = this._namedMeshes.TicketFront- } else if (planeType === 'back') {- referenceMesh = this._namedMeshes.TicketBack- } else if (planeType === 'edge') {- referenceMesh = this._namedMeshes.TicketEdge- }-- if (!referenceMesh) {- throw new Error(`Could not find reference mesh for texture ${name}`)- }-- const localBox = new THREE.Box3().setFromObject(referenceMesh)- const localSize = localBox.getSize(new THREE.Vector3())-- // Get world scale- const worldScale = new THREE.Vector3()- mesh.matrixWorld.decompose(new THREE.Vector3(), new THREE.Quaternion(), worldScale)-- // Apply world scale to get world size- const worldSize = new THREE.Vector3(- localSize.x / Math.abs(worldScale.x),- localSize.y / Math.abs(worldScale.y),- localSize.z / Math.abs(worldScale.z)- )-- const canvas = document.createElement('canvas')- const canvasWidth = worldSize.x * TicketScene.TEXTURE_PIXEL_DENSITY_FACTOR- const canvasHeight = Math.floor(canvasWidth * (localSize.z / localSize.x)) // Maintain aspect ratio-- canvas.width = canvasWidth- canvas.height = canvasHeight-- // Get canvas context and set up text rendering- const context = canvas.getContext('2d')-- if (!context) {- throw new Error(`Could not get 2D context for text "${name}"`)- }-- this._textureCanvases[name as AvailableTextures] = {- canvas,- context,- }- }- }-- private _setupNamedObjects() {- const mesh = this._ticket-- if (!mesh) {- throw new Error(`Ticket mesh not loaded`)- }-- for (const part of mesh.children) {- if (!(part instanceof THREE.Mesh)) {- continue- }-- if (!(part.material instanceof THREE.Material)) {- console.warn(`Material is not an instance of THREE.Material. Got:`, part.material)- continue- }-- if ((TicketScene.TEXTURE_NAMES as readonly string[]).includes(part.material.name)) {- part.material.dithering = true- this._namedMeshes[part.material.name as AvailableTextures] = part- } else {- console.warn(`Mesh ${part.material.name} is not a named texture`)- }- }- }-- private async _loadTextures(force?: boolean) {- // Load textures for each named mesh- // Create a texture loader- const textureLoader = new THREE.TextureLoader()- const loadingPromises: Promise<void>[] = []-- const textureSetKey = this.state.platinum ? 'platinum' : this.state.secret ? 'secret' : 'basic'-- if (!force) {- if (this._internalState.loadedTextureType === textureSetKey) {- return- }- }-- this._internalState.loadedTextureType = textureSetKey-- // Determine which texture set to use based on ticket type- const textureSet = this.textureImages[textureSetKey]-- // Map of which image to use for each mesh- const textureImageMap: Partial<Record<AvailableTextures, TextureDescriptor>> = {- TicketFront: textureSet.front,- TicketBack: textureSet.back,- TicketFrontWebsiteButton: textureSet.front,- TicketBackGoBackButton: textureSet.back,- TicketFrontSeatChartButton: textureSet.front,- TicketBackWebsiteButton: textureSet.back,- // Add mappings for buttons if they have separate textures- // Or they can reuse the front/back textures with different UV coordinates- }-- const allMeshes = Object.entries(this._namedMeshes)- // Preload all textures and prepare canvases- for (const [name, mesh] of allMeshes) {- if (!mesh || !(mesh instanceof THREE.Mesh)) {- console.warn(`Mesh ${name} is not a THREE.Mesh`)- continue- }- if (!mesh.material || !(mesh.material instanceof THREE.MeshStandardMaterial)) {- console.warn(`Mesh ${name} has no material or is not a MeshStandardMaterial`)- continue- }-- const textureKey = name as AvailableTextures- const textureCanvas = this._textureCanvases[textureKey]-- if (!textureCanvas) {- console.warn(`No texture canvas found for texture ${textureKey}`)- continue- }- const { canvas, context } = textureCanvas-- // If we have an image for this texture- const textureDescriptor = textureImageMap[textureKey]- if (!textureDescriptor) {- continue- }-- if (textureDescriptor.cachedData === null) {- // Create a loading promise for this texture- await new Promise<void>((resolve) => {- textureLoader.load(- textureDescriptor.url,- (loadedTexture) => {- // Create an image from the loaded texture- textureDescriptor.cachedData = loadedTexture-- // Fix: Set the correct color space to match the original model- loadedTexture.colorSpace = THREE.SRGBColorSpace-- resolve()- },- undefined, // onProgress callback- (error) => {- console.error(`Error loading texture ${textureDescriptor.url}:`, error)- resolve() // Resolve anyway to not block other textures- }- )- })- }-- if (!textureDescriptor.cachedData) {- throw new Error(`Failed to load texture ${textureDescriptor.url}`)- }-- context.drawImage(textureDescriptor.cachedData.image, 0, 0, canvas.width, canvas.height)-- // For meshes without base images, just draw custom content- this._drawCustomContentOnTexture(textureKey, context, canvas)-- const texture = new THREE.CanvasTexture(canvas)- texture.flipY = false- // Set the correct color space for the texture- texture.colorSpace = THREE.SRGBColorSpace- texture.needsUpdate = true-- // Fix: Preserve the original material properties- const originalMaterial = mesh.material- const originalColor = mesh.material.color.clone()- const originalEmissive = mesh.material.emissive ? mesh.material.emissive.clone() : null- const originalEmissiveIntensity = mesh.material.emissiveIntensity-- mesh.material.map = texture- mesh.material.color = originalColor- if (originalEmissive) mesh.material.emissive = originalEmissive- if (originalEmissiveIntensity) mesh.material.emissiveIntensity = originalEmissiveIntensity-- // Ensure material properties are preserved- mesh.material.needsUpdate = true- }-- // Return a promise that resolves when all textures are loaded- return Promise.all(loadingPromises)- }-- // Method to draw custom content on each texture type- private _drawCustomContentOnTexture(- textureKey: AvailableTextures,- context: CanvasRenderingContext2D,- canvas: HTMLCanvasElement- ) {- // Use fallback fonts if custom fonts failed to load- const mainFontFamily = this._internalState.fontsLoaded- ? this.typography.main.family- : 'monospace'-- const ticketNumberFontFamily = this._internalState.fontsLoaded- ? this.typography.ticketNumber.family- : 'monospace'-- // Get the appropriate color scheme based on ticket type- const colors = this.state.platinum- ? this.textureImages.platinum- : this.state.secret- ? this.textureImages.secret- : this.textureImages.basic-- const isNeon = this.state.secret || this.state.platinum-- function getWrappedText({- text,- maxChars,- maxLines,- }: {- text: string- maxChars: number- maxLines: number- }): string[] {- const lines: string[] = []- let remainingText = text.trim()-- for (let i = 0; i < maxLines && remainingText.length > 0; i++) {- // If remaining text fits in one line- if (remainingText.length <= maxChars) {- lines.push(remainingText)- break- }-- // Check if we're on the last allowed line- if (i === maxLines - 1) {- // Add ellipsis for truncated text- lines.push(remainingText.substring(0, maxChars - 3) + '...')- break- }-- // Try to find a space to break at- let breakPos = remainingText.lastIndexOf(' ', maxChars)-- // If no space found or it's too early in the string, break at maxChars- if (breakPos <= 0 || breakPos < maxChars / 3) {- breakPos = maxChars- }-- // Add the line and update remaining text- lines.push(remainingText.substring(0, breakPos).trim())- remainingText = remainingText.substring(breakPos).trim()- }-- return lines- }-- switch (textureKey) {- case 'TicketFront': {- const fontSize = this.typography.main.relativeSize * canvas.height- const usernameLines = getWrappedText({- text: this.state.texts.username,- maxChars: 18,- maxLines: 4,- })-- context.font = `400 ${fontSize}px ${mainFontFamily}`- context.textAlign = 'left'- context.textBaseline = 'top'- const lineHeight = fontSize * 1.2- const padding = 4-- // Calculate max line width for consistent background width- const maxLineWidth = Math.max(- ...usernameLines.map((line) => context.measureText(line).width)- )-- // Draw username lines with background- usernameLines.forEach((line, index) => {- const x = this.texts.user.x * canvas.width- const y = this.texts.user.y * canvas.height + index * lineHeight-- const textWidth = context.measureText(line).width- const isLastLine = index === usernameLines.length - 1- const backgroundWidth = isLastLine ? textWidth : maxLineWidth-- // Draw main background- context.fillStyle = colorObjToRgb(colors.bgColor)- context.fillRect(- x - padding,- y - padding,- backgroundWidth + padding * 2,- fontSize + padding * 2- )-- // Draw secondary background (glow effect)- context.fillStyle = colorObjToRgb(colors.transparentBg)- context.fillRect(x - 287, y + 4, backgroundWidth + 280, fontSize - 24)-- // Draw text- context.fillStyle = colorObjToRgb(isNeon ? colors.textNeonColor : colors.textColor)- context.fillText(line, x, y)- })-- context.fillStyle = colorObjToRgb(isNeon ? colors.textDimmedColor : colors.textColor)- context.fillText(- this.state.texts.date,- this.texts.date.x * canvas.width,- this.texts.date.y * canvas.height- )-- context.fillStyle = colorObjToRgb(isNeon ? colors.textNeonColor : colors.textDimmedColor)- const ticketNumberFontSize = this.typography.ticketNumber.relativeSize * canvas.height- context.font = `${this.typography.ticketNumber.weight} ${ticketNumberFontSize}px ${ticketNumberFontFamily}`- context.fillText(- this.state.texts.seatCode.toUpperCase(),- this.texts.ticketNumber.x * canvas.width,- this.texts.ticketNumber.y * canvas.height- )- break- }- case 'TicketBack': {- context.textAlign = 'left'- context.textBaseline = 'top'-- const fontSize = this.typography.main.relativeSize * canvas.height- context.font = `400 ${fontSize}px ${mainFontFamily}`- context.fillStyle = colorObjToRgb(isNeon ? colors.textDimmedColor : colors.textColor)- context.fillText(- this.state.texts.date,- this.texts.date.x * canvas.width,- this.texts.date.y * canvas.height- )-- context.fillStyle = colorObjToRgb(isNeon ? colors.textNeonColor : colors.textColor)-- // Draw ticket number with different font- const ticketNumberFontSize = this.typography.ticketNumber.relativeSize * canvas.height- context.font = `${this.typography.ticketNumber.weight} ${ticketNumberFontSize}px ${ticketNumberFontFamily}`- context.fillText(- this.state.texts.seatCode.toUpperCase(),- this.texts.ticketNumberBack.x * canvas.width,- this.texts.ticketNumberBack.y * canvas.height- )-- const seatCoord = this.state.ticketNumber % 32- const seatCol = seatCoord % 8- const seatRow = Math.floor(seatCoord / 8)-- context.fillStyle = colorObjToRgb(colors.textNeonColor)-- // Save the current context state- context.save()- // Translate the context based on seat coordinates- // Adjust these multipliers to control spacing between seats- context.translate(- this.texts.seatStart.x * canvas.width +- (this.texts.seatPositions.x[seatCol] ?? 0) * canvas.width,- this.texts.seatStart.y * canvas.height +- (this.texts.seatPositions.y[seatRow] ?? 0) * canvas.height- )- // Fill the path at the new position- context.fill(this.textureImages.secret.seatPath)- // Restore the context to its original state- context.restore()-- break- }- // Handle other texture types as needed- case 'TicketFrontWebsiteButton':- case 'TicketFrontSeatChartButton':- case 'TicketBackGoBackButton':- case 'TicketBackWebsiteButton':- // These might not need custom content if the base image is sufficient- break- }- }-- private async _loadFonts(): Promise<void> {- try {- // Define the fonts to load- const fontFaces = this.fonts.map((f) => new FontFace(...f))- // Load all fonts- await Promise.all(- fontFaces.map(async (font) => {- const loadedFont = await font.load()- // Add the loaded font to the document- document.fonts.add(loadedFont)- return loadedFont- })- )-- // All fonts loaded successfully- this._internalState.fontsLoaded = true- } catch (error) {- // Handle font loading errors- console.error('Failed to load fonts:', error)- // Still continue to not block rendering, but with a warning- this._internalState.fontsLoaded = false- }- }-- private async _preloadAllTextureSets() {- const textureLoader = new THREE.TextureLoader()- const allSets = ['basic', 'secret', 'platinum'] as const-- let promises: Promise<void>[] = []- for (const set of allSets) {- const textureSet = this.textureImages[set]- if (textureSet.front.cachedData === null) {- const promise = new Promise<void>((resolve, reject) => {- textureLoader.load(- textureSet.front.url,- (texture) => {- textureSet.front.cachedData = texture- resolve()- },- undefined,- reject- )- })- promises.push(promise)- }- if (textureSet.back.cachedData === null) {- const promise = new Promise<void>((resolve, reject) => {- textureLoader.load(- textureSet.back.url,- (texture) => {- textureSet.back.cachedData = texture- resolve()- },- undefined,- reject- )- })-- promises.push(promise)- }- }-- await Promise.all(promises)- }-- private getResolutionDescriptor(resolution: number) {- const resolutionBase = this.state.narrow ? this.narrowResolutions : this.resolutions- const resolutions = Object.keys(resolutionBase).map(Number)- const closestResolution = resolutions.reduce((prev, curr) =>- resolution - curr >= 0 && resolution - curr < resolution - prev ? curr : prev- ) as keyof typeof this.resolutions-- return resolutionBase[closestResolution]- }-}--export default TicketScenediff --git a/apps/www/components/LaunchWeek/14/utils/SceneRenderer.ts b/apps/www/components/LaunchWeek/14/utils/SceneRenderer.tsdeleted file mode 100644index bccfa39ec52..00000000000--- a/apps/www/components/LaunchWeek/14/utils/SceneRenderer.ts+++ /dev/null@@ -1,295 +0,0 @@-import {- ColorManagement,- HalfFloatType,- PerspectiveCamera,- Scene,- SRGBColorSpace,- WebGLRenderer,- WebGLRenderTarget,-} from 'three'-import { EffectComposer } from 'three/examples/jsm/postprocessing/EffectComposer'--export interface MousePositionState {- clientX: number- clientY: number- isWithinContainer: boolean- containerX: number- containerY: number- mouseIntensity: number-}--export interface BaseScene {- getId(): string- /**- * Initialize the scene with the given context- */- setup(context: SceneRenderer): Promise<Scene | void>-- /**- * Update the scene for each animation frame- */- update(context: SceneRenderer, dt?: number): void-- /**- * Clean up resources when the scene is destroyed- */- cleanup(): void-- resize(ev: UIEvent): void-- /**- * Handle device pixel ratio changes- */- devicePixelRatioChanged?(newPixelRatio: number, oldPixelRatio: number): void-}--class SceneRenderer {- renderer: WebGLRenderer- composer: EffectComposer- camera: PerspectiveCamera- mainThreeJsScene: Scene | null = null- activeScenes: BaseScene[] = []- cachedContainerBBox: DOMRect- mousePositionState: MousePositionState- mouseIntensityDecay = 0.98- mouseIntensityGainRate = 0.003- currentPixelRatio: number-- private _resizeHandler: ((ev: UIEvent) => void) | null = null- private _mouseMoveHandler: ((ev: MouseEvent) => void) | null = null- private _mediaQueryListHandler: ((ev: MediaQueryListEvent) => void) | null = null- private _isDisposed = false- private _isInitialized = false-- constructor(- public container: HTMLElement,- private waitFor?: { init: Promise<void>; renderer: SceneRenderer }[],- private uuid?: string- ) {- this.renderer = new WebGLRenderer({ antialias: true, alpha: true })- this.composer = new EffectComposer(this.renderer)-- this.camera = new PerspectiveCamera(- 75,- this.container.clientWidth / this.container.clientHeight,- 0.1,- 1000- )-- this.mousePositionState = {- clientX: 0,- clientY: 0,- isWithinContainer: false,- containerX: 0,- containerY: 0,- mouseIntensity: 0,- }-- this.cachedContainerBBox = this.container.getBoundingClientRect()- this.currentPixelRatio = window.devicePixelRatio- }-- async init(sceneInitializer: () => Promise<void>) {- // console.log('SCENE RENDERER: Init call', this.waitFor?.length, this.uuid)- await Promise.allSettled(- this.waitFor?.filter((t) => t.renderer !== this).map((t) => t.init) || []- )-- if (this._isDisposed) {- // console.log('SCENE RENDERER: Already disposed before sceneInitializer', this.uuid)- return- }-- // console.log('SCENE RENDERER: Waited for all pending inits', this.waitFor?.length, this.uuid)-- await sceneInitializer()-- if (this._isDisposed) {- // console.log('SCENE RENDERER: Already disposed after sceneInitializer', this.uuid)- return- }-- this.renderer.setSize(this.container.clientWidth, this.container.clientHeight)- this.renderer.setPixelRatio(window.devicePixelRatio)- this.renderer.setClearColor(0x000000, 0) // Set transparent background- this.renderer.autoClear = false // Prevent automatic clearing- this.renderer.outputColorSpace = SRGBColorSpace- ColorManagement.enabled = true-- // Initialize composer with correct size and pixel ratio- this.composer.setSize(this.container.clientWidth, this.container.clientHeight)- this.composer.setPixelRatio(window.devicePixelRatio)-- this.container.appendChild(this.renderer.domElement)-- this._resizeHandler = this._resize.bind(this)- window.addEventListener('resize', this._resizeHandler)-- this._mouseMoveHandler = this._updateMousePosition.bind(this)- window.addEventListener('mousemove', this._mouseMoveHandler)-- // Disable it since it brakes Chrome browser- // // Add device pixel ratio change listener- // this._mediaQueryListHandler = this._handleDevicePixelRatioChange.bind(this)- // window- // .matchMedia(`(resolution: ${window.devicePixelRatio}dppx)`)- // .addEventListener('change', this._mediaQueryListHandler)- }-- async activateScene(scene: BaseScene, main?: boolean) {- if (this._isDisposed) {- // console.log('SCENE RENDERER: Already disposed before activateScene', this.uuid)- return- }-- const threeScene = await scene.setup(this)-- if (this._isDisposed) {- // console.log('SCENE RENDERER: Already disposed after activateScene', this.uuid)- return- }-- if (main && threeScene) {- this.mainThreeJsScene = threeScene- }-- const newId = scene.getId()- const existingSceneId = this.activeScenes.findIndex((s) => s.getId() === newId)- if (existingSceneId > -1) {- const sceneToRemove = this.activeScenes[existingSceneId]- this.activeScenes[existingSceneId] = scene- sceneToRemove.cleanup()- } else {- this.activeScenes.push(scene)- }- }-- animate(time?: number) {- // Clear the renderer before rendering- this.renderer.clear()-- this._decayMouseIntensity()-- for (const activeScene of this.activeScenes) {- activeScene.update(this, time)- }- this.composer.render(time)- }-- cleanup() {- // console.log('SCENE RENDERER: Cleanup', this.uuid)-- this._isDisposed = true- this.composer.dispose()- this.renderer.dispose()-- try {- this.container.removeChild(this.renderer.domElement)- } catch (e) {- console.warn(e)- }-- if (this._resizeHandler) {- window.removeEventListener('resize', this._resizeHandler)- this._resizeHandler = null- }-- if (this._mouseMoveHandler) {- window.removeEventListener('mousemove', this._mouseMoveHandler)- this._mouseMoveHandler = null- }-- if (this._mediaQueryListHandler) {- window- .matchMedia(`(resolution: ${window.devicePixelRatio}dppx)`)- .removeEventListener('change', this._mediaQueryListHandler)- this._mediaQueryListHandler = null- }-- if (this.waitFor) {- // Mutate array in place instead of replacing reference- this.waitFor.splice(- 0,- this.waitFor.length,- ...this.waitFor.filter((t) => t.renderer === this)- )- }- }-- private _resize(ev: UIEvent) {- this.camera.aspect = this.container.clientWidth / this.container.clientHeight- this.camera.updateProjectionMatrix()- this.renderer.setSize(this.container.clientWidth, this.container.clientHeight)- this.composer.setSize(this.container.clientWidth, this.container.clientHeight)- this.cachedContainerBBox = this.container.getBoundingClientRect()-- for (const activeScene of this.activeScenes) {- activeScene.resize(ev)- }- }-- private _handleDevicePixelRatioChange(ev: MediaQueryListEvent) {- const oldPixelRatio = this.currentPixelRatio- const newPixelRatio = window.devicePixelRatio-- // Update renderer and composer pixel ratio- this.renderer.setPixelRatio(newPixelRatio)- this.composer.setPixelRatio(newPixelRatio)-- // Store the new pixel ratio- this.currentPixelRatio = newPixelRatio-- // Notify all active scenes about the pixel ratio change- for (const activeScene of this.activeScenes) {- if (typeof activeScene.devicePixelRatioChanged === 'function') {- activeScene.devicePixelRatioChanged(newPixelRatio, oldPixelRatio)- }- }-- // console.log(- // `SCENE RENDERER: Device pixel ratio changed from ${oldPixelRatio} to ${newPixelRatio}`- // )- }-- private _decayMouseIntensity() {- if (this.mousePositionState.mouseIntensity > 0) {- this.mousePositionState.mouseIntensity *= this.mouseIntensityDecay- if (this.mousePositionState.mouseIntensity < 0.0000001) {- this.mousePositionState.mouseIntensity = 0- }- }- }-- private _updateMousePosition(ev: MouseEvent) {- this.cachedContainerBBox = this.container.getBoundingClientRect()- const dx = ev.clientX - this.mousePositionState.clientX- const dy = ev.clientY - this.mousePositionState.clientY- const distance = Math.sqrt(dx * dx + dy * dy)-- // Update intensity based on movement (clamped between 0 and 1)- this.mousePositionState.mouseIntensity = Math.min(- 1.0,- Math.max(0, this.mousePositionState.mouseIntensity + distance * this.mouseIntensityGainRate)- )-- // Update last position- this.mousePositionState.clientX = ev.clientX- this.mousePositionState.clientY = ev.clientY-- const rect = this.cachedContainerBBox- if (!rect) {- return- }- const isWithinContainer =- ev.clientX >= rect.left &&- ev.clientX <= rect.right &&- ev.clientY >= rect.top &&- ev.clientY <= rect.bottom-- this.mousePositionState.isWithinContainer = isWithinContainer- this.mousePositionState.containerX = ((ev.clientX - rect.left) / rect.width) * 2 - 1- this.mousePositionState.containerY = -((ev.clientY - rect.top) / rect.height) * 2 + 1- }-}--export default SceneRendererdiff --git a/apps/www/components/LaunchWeek/14/utils/ticketThemes.tsx b/apps/www/components/LaunchWeek/14/utils/ticketThemes.tsxdeleted file mode 100644index 7693a461b66..00000000000--- a/apps/www/components/LaunchWeek/14/utils/ticketThemes.tsx+++ /dev/null@@ -1,14 +0,0 @@-export const themes = () => ({- regular: {- TICKET_FOREGROUND: '#1F1F1F',- },- platinum: {- TICKET_FOREGROUND: '#1F1F1F',- },- secret: {- TICKET_FOREGROUND: '#1F1F1F',- },- platinumSecret: {- TICKET_FOREGROUND: '#1F1F1F',- },-})diff --git a/apps/www/package.json b/apps/www/package.jsonindex 0256bb49737..6379e16f486 100644--- a/apps/www/package.json+++ b/apps/www/package.json@@ -73,7 +73,6 @@"remark-html": "^16.0.1","shared-data": "workspace:*","swiper": "^11.0.7",- "three": "^0.170.0","typed.js": "^2.0.16","typescript": "~5.5.0","ui": "workspace:*",diff --git a/apps/www/pages/launch-week/index.tsx b/apps/www/pages/launch-week/index.tsxindex a2354e01c68..26376aa5640 100644--- a/apps/www/pages/launch-week/index.tsx+++ b/apps/www/pages/launch-week/index.tsx@@ -1,6 +1,5 @@import { NextSeo } from 'next-seo'import { LW14_DATE, LW14_TITLE, LW14_URL, SITE_ORIGIN } from '~/lib/constants'-import { LwView } from '~/components/LaunchWeek/14/LwView'import { useRouter } from 'next/router'import { Lw14ConfDataProvider } from '~/components/LaunchWeek/14/hooks/use-conf-data'import DefaultLayout from '~/components/Layouts/Default'@@ -52,7 +51,6 @@ const Lw14Page = () => {<LWHeader /><MainStage className="relative z-10" /><BuildStage />- <LwView /></div></DefaultLayout></Lw14ConfDataProvider>diff --git a/apps/www/pages/launch-week/tickets/[username].tsx b/apps/www/pages/launch-week/tickets/[username].tsxdeleted file mode 100644index 982ff7149d7..00000000000--- a/apps/www/pages/launch-week/tickets/[username].tsx+++ /dev/null@@ -1,128 +0,0 @@-import { NextSeo } from 'next-seo'-import dayjs from 'dayjs'-import Error from 'next/error'-import { GetStaticPaths, GetStaticProps } from 'next'-import { LW14_DATE, LW14_TITLE, LW14_URL, SITE_ORIGIN } from '~/lib/constants'-import { LwView } from '~/components/LaunchWeek/14/LwView'-import {- Lw14ConfDataProvider,- UserTicketData,-} from '~/components/LaunchWeek/14/hooks/use-conf-data'-import { createClient } from '@supabase/supabase-js'-import DefaultLayout from '~/components/Layouts/Default'-import { Tunnel } from '~/components/LaunchWeek/14/Tunnel'--interface Props {- user: UserTicketData- ogImageUrl: string-}--const Lw14Page = ({ user, ogImageUrl }: Props) => {- const username = user?.username- const TITLE = `${LW14_TITLE} | ${LW14_DATE}`- const DESCRIPTION = 'Join us for a week of announcing new features, every day at 7 AM PT.'- const PAGE_URL = `${LW14_URL}/tickets/${username}`-- if (!username) {- return <Error statusCode={404} />- }-- return (- <>- <NextSeo- title={TITLE}- description={DESCRIPTION}- openGraph={{- title: TITLE,- description: DESCRIPTION,- url: PAGE_URL,- images: [- {- url: ogImageUrl,- width: 1200,- height: 628,- },- ],- }}- />-- <Lw14ConfDataProvider initState={{ partymodeStatus: 'on' }}>- <DefaultLayout className='font-["Departure_Mono"] lg:pt-32 border-b pb-0 md:pb-16 lg:!pb-[230px]'>- <LwView />- </DefaultLayout>- </Lw14ConfDataProvider>- </>- )-}--export default Lw14Page--export const getStaticProps: GetStaticProps = async ({ params }) => {- const username = params?.username?.toString() || null- let user-- const supabaseAdmin = createClient(- process.env.NEXT_PUBLIC_SUPABASE_URL!,- process.env.LIVE_SUPABASE_COM_SERVICE_ROLE_KEY!- )-- // fetch the normal ticket- // stores the og images in supabase storage- fetch(- // @ts-ignore- `${SITE_ORIGIN}/api-v2/ticket-og?username=${encodeURIComponent(username ?? '')}`- )-- // fetch a specific user- if (username) {- const { data, error } = await supabaseAdmin!- .from('tickets_view')- .select('name, username, ticket_number, metadata, platinum, secret, role, company, location')- .eq('launch_week', 'lw14')- .eq('username', username)- .single()-- user = data- }-- // fetch the platinum ticket- // stores the og images in supabase storage- if (user?.secret) {- fetch(- `${SITE_ORIGIN}/api-v2/ticket-og?username=${encodeURIComponent(username ?? '')}&secret=true`- )- } else if (user?.platinum) {- // fetch /api-v2/ticket-og- fetch(- `${SITE_ORIGIN}/api-v2/ticket-og?username=${encodeURIComponent(username ?? '')}&platinum=true`- )- }-- const ticketType = user?.secret- ? user?.platinum- ? 'platinumSecret'- : 'secret'- : user?.platinum- ? 'platinum'- : 'regular'- const ogImageUrl = `${process.env.NEXT_PUBLIC_SUPABASE_URL}/storage/v1/object/public/images/launch-week/lw14/og/${ticketType}/${username}.png?t=${dayjs(new Date()).format('DHHmmss')}`-- return {- props: {- user: {- ...user,- username,- },- ogImageUrl,- key: username,- },- revalidate: 5,- }-}--export const getStaticPaths: GetStaticPaths = async () => {- return Promise.resolve({- paths: [],- fallback: 'blocking',- })-}diff --git a/pnpm-lock.yaml b/pnpm-lock.yamlindex 73835d32d72..6cc4c06d6b0 100644--- a/pnpm-lock.yaml+++ b/pnpm-lock.yaml@@ -1401,9 +1401,6 @@ importers:swiper:specifier: ^11.0.7version: 11.0.7- three:- specifier: ^0.170.0- version: 0.170.0typed.js:specifier: ^2.0.16version: 2.0.16@@ -9919,6 +9916,7 @@ packages:resolution: {integrity: sha512-t0q23FIpvHDTtnORW+bDJziGsal5uh9RJTJ1fyH8drd4lICOoXhJ5pLMUZ5C0VQei6dNmwTzzoTRgMkO9JgHEQ==}peerDependencies:eslint: '>= 5'+ bundledDependencies: []resolution: {integrity: sha512-BbPC0cuExzhiMo4Ff1BTVwHpjjv28C5R+btTOGaCRC7UEz801up0JadwkeSk5Ued6TG34uaczuVuH6qyy5YUxw==}@@ -15133,9 +15131,6 @@ packages:resolution: {integrity: sha512-OqyPZ9u96VohAyMfJykzmivOrY2wfMSf3C5TtFJVgN+Hm6aj+voFhlK+kZEIv2FBh1X6Xp3DlnCOfEQ3B2J86A==}- resolution: {integrity: sha512-FQK+LEpYc0fBD+J8g6oSEyyNzjp+Q7Ks1C568WWaoMRLW+TkNNWmenWeGgJjV105Gd+p/2ql1ZcjYvNiPZBhuQ==}-resolution: {integrity: sha512-dTEWWNu6JmeVXY0ZYoPuH5cRIwc0MeGbJwah9KUNYSJwommQpCzTySTpEe8Gs1J23aeWEuAobe4Ag7EHVt/LOg==}engines: {node: '>=10'}@@ -33011,8 +33006,6 @@ snapshots:dependencies:real-require: 0.2.0- [email protected]: {}-