mirror of
https://github.com/supabase/supabase.git
synced 2026-12-04 07:29:16 +00:00
## Problem - plan cards on the studio upgrade screen do not match recent plan cards updates to the pricing page - add-on illustrations on the pricing page sometimes show the light image in dark mode - spend cap bars on the pricing page flash when a user toggles the spend cap ## Solution - changes the upgrade screen plan cards to the pricing page design + shows enterprise as a fourth column - moves the lifted card style to the current plan of the organization + gives it a neutral "current plan" badge - moves the compare plans and pricing faq links below the plan cards + removes the stagger animation on the cards - changes the pricing page illustrations to pick the light or dark image with css because the server render does not know the theme - changes the spend cap animation to resize the bars instead of remounting them
70 lines
2.4 KiB
TypeScript
70 lines
2.4 KiB
TypeScript
'use client'
|
|
|
|
import { useBreakpoint } from 'common'
|
|
import Image from 'next/image'
|
|
import React, { useState } from 'react'
|
|
import { cn } from 'ui'
|
|
|
|
const THEMES = ['light', 'dark'] as const
|
|
|
|
const PricingComputeAnimation = () => {
|
|
const [triggerAnimation, setTriggerAnimation] = useState(false)
|
|
const isTablet = useBreakpoint(1023)
|
|
|
|
return (
|
|
<figure
|
|
className="h-full relative lg:absolute lg:-right-24 xl:-right-10 aspect-541/285"
|
|
onMouseEnter={() => setTriggerAnimation(true)}
|
|
>
|
|
{THEMES.map((theme) => (
|
|
<div
|
|
key={theme}
|
|
className={theme === 'dark' ? 'hidden dark:contents' : 'contents dark:hidden'}
|
|
>
|
|
<Image
|
|
fill
|
|
src={`/images/pricing/compute/compute-cube-${theme}-active.svg`}
|
|
alt="Compute addon grid"
|
|
className={cn(
|
|
'absolute inset-0 z-20 transition-opacity opacity-0 ease-[cubic-bezier(.76,0,.23,1)]! duration-300',
|
|
triggerAnimation && 'opacity-100'
|
|
)}
|
|
/>
|
|
<Image
|
|
fill
|
|
src={`/images/pricing/compute/compute-cube-${theme}-active.svg`}
|
|
alt="Compute addon grid"
|
|
className={cn(
|
|
'absolute inset-0 z-20 transition-all opacity-0 ease-[cubic-bezier(.76,0,.23,1)]! duration-500 delay-500 translate-y-[-18%] blur-md',
|
|
triggerAnimation && 'opacity-100 translate-y-[-8%] blur-none'
|
|
)}
|
|
/>
|
|
<Image
|
|
fill
|
|
src={`/images/pricing/compute/compute-cube-${theme}-active.svg`}
|
|
alt="Compute addon grid"
|
|
className={cn(
|
|
'absolute inset-0 z-20 transition-all opacity-0 ease-[cubic-bezier(.76,0,.23,1)]! duration-500 delay-1000 translate-y-[-24%] blur-md',
|
|
triggerAnimation && 'opacity-100 translate-y-[-16%] blur-none'
|
|
)}
|
|
/>
|
|
<Image
|
|
fill
|
|
src={`/images/pricing/compute/compute-cube-${theme}.svg`}
|
|
alt="Compute addon grid"
|
|
className="absolute inset-0 z-10"
|
|
/>
|
|
<Image
|
|
fill
|
|
src={`/images/pricing/compute/compute-grid${isTablet ? '-mobile' : ''}-${theme}.svg`}
|
|
alt="Compute addon grid"
|
|
className="absolute inset-0 z-0 object-contain object-center"
|
|
/>
|
|
</div>
|
|
))}
|
|
</figure>
|
|
)
|
|
}
|
|
|
|
export default PricingComputeAnimation
|