feat: add pitch-deck service to core infrastructure
Migrated pitch-deck from breakpilot-pwa to breakpilot-core. Container: bp-core-pitch-deck on port 3012. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
53
pitch-deck/components/SlideContainer.tsx
Normal file
53
pitch-deck/components/SlideContainer.tsx
Normal file
@@ -0,0 +1,53 @@
|
||||
'use client'
|
||||
|
||||
import { ReactNode } from 'react'
|
||||
import { motion, AnimatePresence } from 'framer-motion'
|
||||
|
||||
interface SlideContainerProps {
|
||||
children: ReactNode
|
||||
slideKey: string
|
||||
direction: number
|
||||
}
|
||||
|
||||
const variants = {
|
||||
enter: (direction: number) => ({
|
||||
x: direction > 0 ? '30%' : '-30%',
|
||||
opacity: 0,
|
||||
scale: 0.95,
|
||||
}),
|
||||
center: {
|
||||
x: 0,
|
||||
opacity: 1,
|
||||
scale: 1,
|
||||
},
|
||||
exit: (direction: number) => ({
|
||||
x: direction < 0 ? '30%' : '-30%',
|
||||
opacity: 0,
|
||||
scale: 0.95,
|
||||
}),
|
||||
}
|
||||
|
||||
export default function SlideContainer({ children, slideKey, direction }: SlideContainerProps) {
|
||||
return (
|
||||
<AnimatePresence mode="wait" custom={direction}>
|
||||
<motion.div
|
||||
key={slideKey}
|
||||
custom={direction}
|
||||
variants={variants}
|
||||
initial="enter"
|
||||
animate="center"
|
||||
exit="exit"
|
||||
transition={{
|
||||
x: { type: 'spring', stiffness: 300, damping: 30 },
|
||||
opacity: { duration: 0.3 },
|
||||
scale: { duration: 0.3 },
|
||||
}}
|
||||
className="absolute inset-0 flex items-center justify-center overflow-y-auto"
|
||||
>
|
||||
<div className="w-full max-w-6xl mx-auto px-6 py-12 md:py-16">
|
||||
{children}
|
||||
</div>
|
||||
</motion.div>
|
||||
</AnimatePresence>
|
||||
)
|
||||
}
|
||||
Reference in New Issue
Block a user