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:
@@ -1,7 +1,6 @@
|
|||||||
'use client'
|
'use client'
|
||||||
|
|
||||||
import {demoCategories} from './data/demos'
|
import {demoCategories} from './data/demos'
|
||||||
import Image from 'next/image'
|
|
||||||
import Link from 'next/link'
|
import Link from 'next/link'
|
||||||
import {motion} from 'framer-motion'
|
import {motion} from 'framer-motion'
|
||||||
|
|
||||||
@@ -23,14 +22,31 @@ export default function Home() {
|
|||||||
animate={{opacity: 1, y: 0}}
|
animate={{opacity: 1, y: 0}}
|
||||||
transition={{duration: 0.4}}
|
transition={{duration: 0.4}}
|
||||||
>
|
>
|
||||||
<Image
|
{/* Preview iframe */}
|
||||||
src={demo.preview}
|
<div className="relative w-full h-[270px] overflow-hidden bg-black">
|
||||||
alt={`${demo.name} Vorschau`}
|
<motion.div
|
||||||
width={600}
|
className="absolute inset-0"
|
||||||
height={300}
|
style={{height: '200%', width: '100%'}}
|
||||||
className="w-full h-auto object-cover"
|
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">
|
<div className="flex flex-col flex-1 p-4">
|
||||||
<h3 className="text-xl font-semibold mb-2">{demo.name}</h3>
|
<h3 className="text-xl font-semibold mb-2">{demo.name}</h3>
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user