mirror of
https://github.com/supabase/supabase.git
synced 2026-10-06 09:55:06 +03:00
This PR migrates the whole monorepo to use Tailwind v4: - Removed `@tailwindcss/container-queries` plugin since it's included by default in v4, - Bump all instances of Tailwind to v4. Made minimal changes to the shared config to remove non-supported features (`alpha` mentions), - Migrate all apps to be compatible with v4 configs, - Fix the `typography.css` import in 3 apps, - Add missing rules which were included by default in v3, - Run `pnpm dlx @tailwindcss/upgrade` on all apps, which renames a lot of classes - Rename all misnamed classes according to https://tailwindcss.com/docs/upgrade-guide#renamed-utilities in all apps. --------- Co-authored-by: Jordi Enric <jordi.err@gmail.com>
75 lines
2.1 KiB
TypeScript
75 lines
2.1 KiB
TypeScript
import { motion } from 'framer-motion'
|
|
import Image from 'next/image'
|
|
import React from 'react'
|
|
import { cn } from 'ui'
|
|
|
|
type animateFromType = 'left' | 'right' | 'up' | 'down' | 'opacityOnly'
|
|
|
|
export default function LaunchWeekPrizeCard({
|
|
imageUrl = '',
|
|
imageWrapperClassName,
|
|
content,
|
|
className,
|
|
animateFrom,
|
|
imgObjectPosition = 'center',
|
|
}: {
|
|
imageUrl: string
|
|
imageWrapperClassName?: string
|
|
content: any
|
|
className?: string
|
|
animateFrom?: animateFromType
|
|
imgObjectPosition?: string
|
|
}) {
|
|
const finalState = { x: 0, y: 0, opacity: 1 }
|
|
|
|
function getAnimationFrom(animationDirection: animateFromType) {
|
|
switch (animationDirection) {
|
|
case 'left':
|
|
return { x: -20, opacity: 0 }
|
|
case 'up':
|
|
return { y: -20, opacity: 0 }
|
|
case 'right':
|
|
return { x: 20, opacity: 0 }
|
|
case 'down':
|
|
return { y: 20, opacity: 0 }
|
|
case 'opacityOnly':
|
|
return { opacity: 0 }
|
|
}
|
|
}
|
|
|
|
return (
|
|
<motion.div
|
|
className={[
|
|
'relative p-px bg-linear-to-b from-[#22282a] to-[#030A0C] rounded-lg overflow-hidden shadow-lg',
|
|
className && className,
|
|
].join(' ')}
|
|
initial={animateFrom ? getAnimationFrom(animateFrom) : finalState}
|
|
whileInView={finalState}
|
|
viewport={{ once: true, margin: '-50px' }}
|
|
transition={{ type: 'spring', bounce: 0, delay: 0.5 }}
|
|
>
|
|
<div className="relative h-full flex flex-col bg-[#030A0C] rounded-lg overflow-hidden">
|
|
<div
|
|
className={[
|
|
"relative w-full grow before:content[' '] before:absolute before:inset-0 before:z-10 before:bg-linear-to-t before:from-[#030A0C] before:via-transparent",
|
|
imageWrapperClassName && imageWrapperClassName,
|
|
].join(' ')}
|
|
>
|
|
<Image
|
|
src={imageUrl}
|
|
fill
|
|
sizes="100%"
|
|
className={cn(
|
|
'object-cover',
|
|
imgObjectPosition === 'right' ? 'object-right' : 'object-center'
|
|
)}
|
|
quality={100}
|
|
alt=""
|
|
/>
|
|
</div>
|
|
<div className="p-4 flex flex-col gap-2 items-start">{content && content}</div>
|
|
</div>
|
|
</motion.div>
|
|
)
|
|
}
|