Files
supabase/apps/www/components/LaunchWeek/8/LaunchWeekPrizeCard.tsx
Francesco SansalvadoreandAnt Wilson accf7618eb Eagle (#22425)
* lw11 ga ticketing

* add @types/animejs

* build new game word

* og ticket layout

* ticket og layout

* lw11 ticketing flow

* remove unused assets

* clean up old LW code

* smol cleanup

* update lw11 og function

* update lw11 og function

* prepare

* main layout

* layout

* update naming

* fix lw11 canvas resize

* lw announcement countdown banner

* hp badge

* update lw page

* cleanup

* update banners

* update ticket shape

* update share string

* update launch time

* avatar in ticket

* update lw11-og handler

* mask ticket glow

* update game with input-otp

* clean up game

* update ticketing page title

* update

* update awards

* special event

* update constants

* fix mobile inputs bug

* update announcements

* dots grid

* remove 2024

* gst

* fix ticket user page

* less stacked layout

* lw

* update secret ticket

* update sharing layout

* max width to ticket container

* update tweet text

* clean up merge

* npm i

* update hero announcement

* update footer

* update types

* fix types

* Update apps/www/lib/constants.ts

* Update apps/www/lib/constants.ts

* Update apps/www/lib/constants.ts

* Apply suggestions from code review

* update og

* og

* special announcement

* special announcement

* fix favicon

* url timestamp for cache

* cache

* favicon

* remove file

* fix title

* game only when signed in

* user ticket nme

* day

* switch to /special-announcent

* update /special-announcement

* update /special-announcement

* skip build

* redirect

* fix theme in /special-announcement

* fix mobile ticket form

* image not draggable

* cleanup

* restore latest manifest

* update secret ticket tweet

* secret share

* update text

* fix secret share

* typo

* remove comment

* update deprecated icon

* restore input.stories

---------

Co-authored-by: Ant Wilson <awalias@users.noreply.github.com>
2024-04-04 13:09:21 +00:00

75 lines
2.2 KiB
TypeScript

import Image from 'next/image'
import React from 'react'
import { motion } from 'framer-motion'
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-[1px] bg-gradient-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 flex-grow before:content[' '] before:absolute before:inset-0 before:z-10 before:bg-gradient-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>
)
}