Replace Image component with an iframe preview for demos, including smooth vertical animation, and adjust associated layout for better visualization.

This commit is contained in:
2025-06-19 08:28:40 +09:00
parent 8781aa3a52
commit eb554b8aad

View File

@@ -1,7 +1,6 @@
'use client'
import {demoCategories} from './data/demos'
import Image from 'next/image'
import Link from 'next/link'
import {motion} from 'framer-motion'
@@ -23,14 +22,31 @@ export default function Home() {
animate={{opacity: 1, y: 0}}
transition={{duration: 0.4}}
>
<Image
src={demo.preview}
alt={`${demo.name} Vorschau`}
width={600}
height={300}
className="w-full h-auto object-cover"
/>
{/* Preview iframe */}
<div className="relative w-full h-[270px] overflow-hidden bg-black">
<motion.div
className="absolute inset-0"
style={{height: '200%', width: '100%'}}
animate={{y: ['0%', '-50%']}}
transition={{
repeat: Infinity,
repeatType: 'reverse',
duration: 7,
ease: 'easeInOut',
}}
>
<iframe
src={demo.url}
className="w-full h-full"
style={{
border: 'none',
pointerEvents: 'none',
}}
/>
</motion.div>
</div>
{/* Info and button */}
<div className="flex flex-col flex-1 p-4">
<h3 className="text-xl font-semibold mb-2">{demo.name}</h3>
@@ -60,4 +76,4 @@ export default function Home() {
))}
</main>
)
}
}