Skip to content

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

lw8: current day widget

Francesco Sansalvadore4d559dbfba8a
diff --git a/apps/www/components/Hero/Hero.tsx b/apps/www/components/Hero/Hero.tsx
index 9ce53bff3a8..716812b5dad 100644
--- a/apps/www/components/Hero/Hero.tsx
+++ b/apps/www/components/Hero/Hero.tsx
@@ -9,21 +9,22 @@ import HeroFrameworks from './HeroFrameworks'
import styles from './hero.module.css'
import Image from 'next/image'
import { useEffect, useState } from 'react'
+import DayHighlightWidget from '../LaunchWeek/8/Releases/DayHighlightWidget'
const Hero = () => {
const router = useRouter()
- const [showAnnouncement, setShowAnnouncement] = useState(false)
+ const [showAnnouncement, setShowAnnouncement] = useState(true)
const telemetryProps = useTelemetryProps()
const sendTelemetryEvent = async (event: TelemetryEvent) => {
await Telemetry.sendEvent(event, telemetryProps, router)
}
- useEffect(() => {
- if (typeof window !== undefined) {
- const lw8AnnouncementKey = window.localStorage.getItem('announcement_SupabaseLaunchWeek8')
- setShowAnnouncement(!!lw8AnnouncementKey)
- }
- }, [showAnnouncement])
+ // useEffect(() => {
+ // if (typeof window !== undefined) {
+ // const lw8AnnouncementKey = window.localStorage.getItem('announcement_SupabaseLaunchWeek8')
+ // setShowAnnouncement(!!lw8AnnouncementKey)
+ // }
+ // }, [showAnnouncement])
return (
<div className="relative -mt-[65px]">
@@ -33,24 +34,27 @@ const Hero = () => {
<div className="mx-auto max-w-2xl lg:col-span-6 lg:flex lg:items-center justify-center text-center">
<div
className={[
- 'relative z-10 appear-first lg:h-auto pt-[250px] lg:pt-[250px] lg:min-h-[300px] flex flex-col items-center justify-center sm:mx-auto md:w-3/4 lg:mx-0 lg:w-full gap-4 lg:gap-8',
+ 'relative z-10 appear-first lg:h-auto pt-[90px] lg:pt-[90px] lg:min-h-[300px] flex flex-col items-center justify-center sm:mx-auto md:w-3/4 lg:mx-0 lg:w-full gap-4 lg:gap-8',
styles['hero-text'],
].join(' ')}
>
<div className="flex flex-col items-center">
{showAnnouncement && (
- <Link href="/launch-week">
- <a className="group w-auto rounded-full p-1 mb-6 mt-8 md:mb-10 bg-gradient-to-b from-[#1b1f2124] to-[#02040550] hover:from-[#ffffff15] hover:to-[#ffffff05] transition-all backdrop-blur-lg border flex items-center justify-between gap-2 md:gap-4 text-scale-1100 hover:text-scale-1200 text-sm">
- <div className="text-scale-200 rounded-full bg-brand px-3 py-1 flex items-center justify-center">
- Get your ticket
- </div>
- <span>Launch Week 8 - August 7-11</span>
- <IconArrowRight
- size={16}
- className="transform mr-2 transition-transform translate-x-0 sm:-translate-x-1 group-hover:translate-x-0"
- />
- </a>
- </Link>
+ // <Link href="/launch-week">
+ // <a className="group w-auto rounded-full p-1 mb-6 mt-8 md:mb-10 bg-gradient-to-b from-[#1b1f2124] to-[#02040550] hover:from-[#ffffff15] hover:to-[#ffffff05] transition-all backdrop-blur-lg border flex items-center justify-between gap-2 md:gap-4 text-scale-1100 hover:text-scale-1200 text-sm">
+ // <div className="text-scale-200 rounded-full bg-brand px-3 py-1 flex items-center justify-center">
+ // Get your ticket
+ // </div>
+ // <span>Launch Week 8 - August 7-11</span>
+ // <IconArrowRight
+ // size={16}
+ // className="transform mr-2 transition-transform translate-x-0 sm:-translate-x-1 group-hover:translate-x-0"
+ // />
+ // </a>
+ // </Link>
+ <div className="z-40 w-full flex justify-center mb-8 lg:mb-12">
+ <DayHighlightWidget title="Launch Week 8: Day 1" />
+ </div>
)}
<h1 className="text-scale-1200 text-4xl sm:text-5xl sm:leading-none lg:text-7xl">
<span className="block text-[#F4FFFA00] bg-clip-text bg-gradient-to-b from-scale-1200 to-scale-1200 dark:to-scale-1100">
@@ -116,7 +120,7 @@ const Hero = () => {
</div>
</div>
</SectionContainer>
- <div className="absolute w-full max-w-[1600px] mx-auto h-[500px] lg:h-[750px] inset-0 z-0">
+ <div className="absolute w-full max-w-[1600px] mx-auto h-[500px] lg:h-[750px] inset-0 z-0 flex items-center justify-center">
<Image
src="/images/launchweek/8/LW8-gradient.png"
layout="fill"
diff --git a/apps/www/components/LaunchWeek/8/Releases/DayHighlightWidget.tsx b/apps/www/components/LaunchWeek/8/Releases/DayHighlightWidget.tsx
index ef3a6cac82e..faa78634461 100644
--- a/apps/www/components/LaunchWeek/8/Releases/DayHighlightWidget.tsx
+++ b/apps/www/components/LaunchWeek/8/Releases/DayHighlightWidget.tsx
@@ -2,21 +2,21 @@ import React from 'react'
import { SmallCard } from './components'
import Link from 'next/link'
import Image from 'next/image'
-import days, { WeekDayProps } from './lw8_data'
+import days from './lw8_data'
-const DayHighlightWidget = () => {
+const DayHighlightWidget = ({ title }: { title?: string }) => {
const [_pre, d1, _d2, _d3, _d4, _d5] = days
return (
- <div className="w-full max-w-xl">
+ <div className="w-full max-w-xl opacity-0 !animate-[fadeIn_0.5s_cubic-bezier(0.25,0.25,0,1)_0.5s_both]">
<SmallCard
className="border hover:border-scale-800 transition-colors"
- innerClassName="bg-opacity-20"
+ innerClassName="bg-opacity-70"
>
- <Link href="#currentDay">
- <a className="flex flex-row justify-between items-center w-full h-full gap-2">
+ <Link href="/launch-week#today">
+ <a className="flex flex-row justify-between items-center w-full h-full gap-2 text-left">
<div className="relative flex-shrink flex items-center p-2 w-2/3 md:w-auto">
- <div className="flex flex-col gap-1 sm:pl-4">
+ <div className="flex flex-col gap-1 sm:pl-2">
<div className="flex items-center gap-2">
<div className={['flex min-w-[20px] opacity-50', 'opacity-pulse'].join(' ')}>
<svg
@@ -34,12 +34,12 @@ const DayHighlightWidget = () => {
/>
</svg>
</div>
- <span className="text-white">Live now: Day 1</span>
+ <span className="text-white">{title ?? 'Launch Week 8: Day 1'}</span>
</div>
<span className="">{d1.steps[0].title}</span>
</div>
</div>
- <div className="relative flex !aspect-video h-[80px] md:h-[100px] gap-2 z-10 rounded overflow-hidden">
+ <div className="relative flex !aspect-video h-[80px] md:h-[80px] gap-2 z-10 rounded overflow-hidden">
<Image
src="/images/launchweek/8/lw8-yt-thumb.jpg"
alt="Youtube video thumbnail"
diff --git a/apps/www/components/LaunchWeek/8/Releases/components/index.tsx b/apps/www/components/LaunchWeek/8/Releases/components/index.tsx
index d2c0507cb1c..7c0fd2506a1 100644
--- a/apps/www/components/LaunchWeek/8/Releases/components/index.tsx
+++ b/apps/www/components/LaunchWeek/8/Releases/components/index.tsx
@@ -215,36 +215,34 @@ export const AccordionHeader = ({
</div>
{day === 1 && (
<div className="self-end hover:cursor-pointer">
- <ExpandableVideo
- videoId="OWhKVbg1p7Y"
- trigger={
- <div className="flex items-center h-full gap-3 text-xs group/vid text-scale-1100 hover:text-scale-1200 transition-colors">
- <span>Watch: Day 1</span>
- <div className="relative h-8 !aspect-video flex items-center justify-center rounded overflow-hidden border border-scale-800 opacity-80 group-hover/vid:opacity-100 transition-colors">
- <div className="absolute z-10 w-2.5 h-2.5 text-scale-900 opacity-70 group-hover/vid:opacity-100 transition-opacity">
- <svg viewBox="0 0 81 91" fill="none" xmlns="http://www.w3.org/2000/svg">
- <path
- d="M76.5621 37.998C82.3369 41.3321 82.3369 49.6673 76.5621 53.0014L13.2198 89.5721C7.44504 92.9062 0.226562 88.7386 0.226562 82.0704L0.226566 8.92901C0.226566 2.26085 7.44506 -1.90673 13.2199 1.42735L76.5621 37.998Z"
- fill="currentColor"
- />
- </svg>
- </div>
- <Image
- src="/images/launchweek/8/lw8-yt-thumb.jpg"
- alt="Video thumbnail"
- layout="fill"
- objectFit="cover"
- // className="blur-sm"
- />
- </div>
- </div>
- }
- />
+ <ExpandableVideo videoId="OWhKVbg1p7Y" trigger={<VideoPreviewTrigger />} />
</div>
)}
</div>
)
+export const VideoPreviewTrigger = () => (
+ <div className="flex items-center h-full gap-3 text-xs group/vid text-scale-1100 hover:text-scale-1200 transition-colors">
+ <span>Watch: Day 1</span>
+ <div className="relative h-8 !aspect-video flex items-center justify-center rounded overflow-hidden border border-scale-800 opacity-80 group-hover/vid:opacity-100 transition-colors">
+ <div className="absolute z-10 w-2.5 h-2.5 text-scale-900 opacity-70 group-hover/vid:opacity-100 transition-opacity">
+ <svg viewBox="0 0 81 91" fill="none" xmlns="http://www.w3.org/2000/svg">
+ <path
+ d="M76.5621 37.998C82.3369 41.3321 82.3369 49.6673 76.5621 53.0014L13.2198 89.5721C7.44504 92.9062 0.226562 88.7386 0.226562 82.0704L0.226566 8.92901C0.226566 2.26085 7.44506 -1.90673 13.2199 1.42735L76.5621 37.998Z"
+ fill="currentColor"
+ />
+ </svg>
+ </div>
+ <Image
+ src="/images/launchweek/8/lw8-yt-thumb.jpg"
+ alt="Video thumbnail"
+ layout="fill"
+ objectFit="cover"
+ />
+ </div>
+ </div>
+)
+
export const MultistepSectionHeader = ({ title, blog }: any) => {
return (
<div className="flex flex-1 flex-col sm:flex-row py-8">
diff --git a/apps/www/components/LaunchWeek/8/Releases/index.tsx b/apps/www/components/LaunchWeek/8/Releases/index.tsx
index f91d6b7847a..743db5083a6 100644
--- a/apps/www/components/LaunchWeek/8/Releases/index.tsx
+++ b/apps/www/components/LaunchWeek/8/Releases/index.tsx
@@ -286,7 +286,7 @@ export default function LW8Releases() {
)}
</Accordion.Item>
</div>
- <div className="border-b border-[#111718] scroll-mt-16" id="currentDay">
+ <div className="border-b border-[#111718] scroll-mt-16" id="today">
<Accordion.Item
header={
<AccordionHeader
diff --git a/apps/www/components/LaunchWeek/8/Releases/lw8_data.ts b/apps/www/components/LaunchWeek/8/Releases/lw8_data.ts
index ae11d59efd1..e000e22f9e7 100644
--- a/apps/www/components/LaunchWeek/8/Releases/lw8_data.ts
+++ b/apps/www/components/LaunchWeek/8/Releases/lw8_data.ts
@@ -61,7 +61,7 @@ const days: WeekDayProps[] = [
steps: [
{
title: "Why we'll stay remote",
- blog: '/blog/',
+ blog: '/blog/why-we-will-stay-remote',
bg_layers: [{ img: images['00-stay-remote'] }],
steps: [],
},
diff --git a/apps/www/components/Nav/index.tsx b/apps/www/components/Nav/index.tsx
index 8f7e04225b0..4149d2eb1e6 100644
--- a/apps/www/components/Nav/index.tsx
+++ b/apps/www/components/Nav/index.tsx
@@ -198,7 +198,7 @@ const Nav = () => {
return (
<>
- <Announcement link="/launch-week">
+ <Announcement link="/launch-week#today">
<LW8CountdownBanner />
</Announcement>
<div className="sticky top-0 z-40 transform" style={{ transform: 'translate3d(0,0,999px)' }}>
diff --git a/packages/ui/src/layout/banners/LW8CountdownBanner/LW8CountdownBanner.tsx b/packages/ui/src/layout/banners/LW8CountdownBanner/LW8CountdownBanner.tsx
index 25593b32db9..8f4764db3de 100644
--- a/packages/ui/src/layout/banners/LW8CountdownBanner/LW8CountdownBanner.tsx
+++ b/packages/ui/src/layout/banners/LW8CountdownBanner/LW8CountdownBanner.tsx
@@ -5,38 +5,27 @@ import { AnnouncementProps } from '../Announcement'
import _announcement from '../data/Announcement.json'
import CountdownWidget from '../../../components/CountdownWidget/CountdownWidget'
import Lw8BannerBg from './Lw8BannerBg'
+import VideoPreview from './VideoPreview'
const announcement = _announcement as AnnouncementProps
-function CountdownButton({ children }: PropsWithChildren<{}>) {
- return (
- <div className="bg-white text-xs px-1.5 md:px-2.5 py-1 rounded-full text-black shadow-none hover:shadow-mg cursor-pointer">
- {children}
- </div>
- )
-}
-
export function LW8CountdownBanner() {
const { pathname } = useRouter()
+ const isHomePage = pathname === '/'
const isLaunchWeekPage = pathname === '/launch-week'
const isLaunchWeekSection = pathname.includes('launch-week')
- if (isLaunchWeekPage) return null
+ if (isLaunchWeekPage || isHomePage) return null
- const renderer = ({ days, hours, minutes, seconds, completed }: any) => {
- if (completed) {
- // Render a completed state
- return (
- <div className="w-full flex gap-3 md:gap-6 items-center justify-center">
- <p>Supabase Launch Week 8</p>
- <div>
- <CountdownButton>Live now</CountdownButton>
- </div>
- </div>
- )
- } else {
- // Render countdown
- return (
+ return (
+ <div
+ className="relative w-full h-14 p-2 flex items-center group justify-center text-white !bg-cover !bg-center overflow-hidden"
+ style={{
+ background:
+ 'linear-gradient(to right, #020405 10%, #1D0B31 40%, #1B113B 50%, #122029 70%, #020405 90%)',
+ }}
+ >
+ <div className="relative z-10 flex items-center justify-center">
<div
className={[
'w-full flex gap-3 md:gap-6 items-center md:justify-center text-sm md:text-base',
@@ -44,31 +33,10 @@ export function LW8CountdownBanner() {
].join(' ')}
>
<p>
- <span className="hidden md:inline">Supabase</span> Launch Week 8
+ <span className="hidden md:inline">Supabase</span> Launch Week 8: Day 1
</p>
- <div className="flex gap-1 items-center">
- <CountdownWidget days={days} hours={hours} minutes={minutes} seconds={seconds} />
- </div>
- {!isLaunchWeekPage && (
- <div className="hidden md:block">
- <CountdownButton>Get your ticket</CountdownButton>
- </div>
- )}
+ <VideoPreview />
</div>
- )
- }
- }
-
- return (
- <div
- className="relative w-full h-14 p-2 flex items-center justify-center text-white !bg-cover !bg-center overflow-hidden"
- style={{
- background:
- 'linear-gradient(to right, #020405 10%, #1D0B31 40%, #1B113B 50%, #122029 70%, #020405 90%)',
- }}
- >
- <div className="relative z-10 flex items-center justify-center">
- <Countdown date={new Date(announcement.launchDate)} renderer={renderer} />
</div>
<Lw8BannerBg className="absolute z-0 inset-0 w-full flex items-center justify-center h-auto min-h-full [&>svg]:w-auto [&>svg]:h-[40%] md:[&>svg]:h-[64%]" />
</div>
diff --git a/packages/ui/src/layout/banners/LW8CountdownBanner/VideoPreview.tsx b/packages/ui/src/layout/banners/LW8CountdownBanner/VideoPreview.tsx
new file mode 100644
index 00000000000..cb487f73cb0
--- /dev/null
+++ b/packages/ui/src/layout/banners/LW8CountdownBanner/VideoPreview.tsx
@@ -0,0 +1,22 @@
+import Image from 'next/image'
+
+const VideoPreview = () => (
+ <div className="relative h-8 !aspect-video flex items-center justify-center rounded overflow-hidden border transition-colors">
+ <div className="absolute z-10 w-2.5 h-2.5 text-scale-1200 opacity-100">
+ <svg viewBox="0 0 81 91" fill="none" xmlns="http://www.w3.org/2000/svg">
+ <path
+ d="M76.5621 37.998C82.3369 41.3321 82.3369 49.6673 76.5621 53.0014L13.2198 89.5721C7.44504 92.9062 0.226562 88.7386 0.226562 82.0704L0.226566 8.92901C0.226566 2.26085 7.44506 -1.90673 13.2199 1.42735L76.5621 37.998Z"
+ fill="currentColor"
+ />
+ </svg>
+ </div>
+ <Image
+ src="/images/launchweek/8/lw8-yt-thumb.jpg"
+ alt="Video thumbnail"
+ layout="fill"
+ objectFit="cover"
+ />
+ </div>
+)
+
+export default VideoPreview
diff --git a/packages/ui/src/layout/banners/data/Announcement.json b/packages/ui/src/layout/banners/data/Announcement.json
index abb5cec8362..541012dc0bc 100644
--- a/packages/ui/src/layout/banners/data/Announcement.json
+++ b/packages/ui/src/layout/banners/data/Announcement.json
@@ -2,6 +2,6 @@
"show": true,
"text": "Supabase Launch Week 8",
"launchDate": "2023-08-07T09:00:00.000-07:00",
- "link": "https://supabase.com/launch-week",
+ "link": "https://supabase.com/launch-week#today",
"badge": "Get your ticket"
}