Files
Alberto-Audrix 32a36cceff
CI / lint-and-test (push) Canceled after 0s
first commit
2026-07-28 08:55:05 +07:00

110 lines
3.8 KiB
TypeScript

import React from 'react';
import { SlideData } from './slidesData.ts';
import DashboardSlide from './DashboardSlide.tsx';
const SlideContent: React.FC<{ slide: SlideData }> = ({ slide }) => {
const backgroundStyle = slide.image ? { backgroundImage: `url(${slide.image})` } : {};
const SlideWrapper: React.FC<{ children: React.ReactNode; hasImage: boolean }> = ({
children,
hasImage,
}) => (
<div
className={`w-full h-full bg-cover bg-center ${hasImage ? '' : 'bg-white'}`}
style={backgroundStyle}
>
<div
className={`w-full h-full flex flex-col justify-center p-12 lg:p-20 ${hasImage ? 'bg-black/50' : ''}`}
>
{children}
</div>
</div>
);
switch (slide.type) {
case 'title':
return (
<SlideWrapper hasImage={false}>
<div className="text-center text-gray-800">
{slide.logo && (
<img src={slide.logo} alt="Logo" className="h-20 md:h-24 mx-auto mb-10" />
)}
<h1 className="text-4xl md:text-6xl font-bold tracking-tight text-gray-900">
{slide.title}
</h1>
<p className="text-xl md:text-2xl mt-4 text-gray-600 max-w-4xl mx-auto">
{slide.subtitle}
</p>
</div>
</SlideWrapper>
);
case 'points':
return (
<SlideWrapper hasImage={!!slide.image}>
<h2
className={`text-4xl md:text-5xl font-bold mb-10 ${slide.image ? 'text-white' : 'text-gray-900'}`}
>
{slide.title}
</h2>
<ul className="space-y-6">
{slide.points?.map((point, index) => (
<li
key={index}
className={`flex items-start text-xl md:text-2xl animate-fade-in-up ${slide.image ? 'text-gray-200' : 'text-gray-700'}`}
style={{ animationDelay: `${index * 150}ms` }}
>
<i className={`fa-solid ${point.icon} text-red-500 w-10 text-center mr-6 mt-1`}></i>
<span>{point.text}</span>
</li>
))}
</ul>
</SlideWrapper>
);
case 'image':
return (
<SlideWrapper hasImage={!!slide.image}>
<div className="max-w-3xl">
<h2 className="text-4xl md:text-5xl font-bold text-white mb-6">{slide.title}</h2>
<p className="text-xl md:text-2xl text-gray-200">{slide.text}</p>
</div>
</SlideWrapper>
);
case 'features':
return (
<SlideWrapper hasImage={false}>
<h2 className="text-4xl md:text-5xl font-bold text-gray-900 mb-12 text-center">
{slide.title}
</h2>
<div className="grid grid-cols-1 md:grid-cols-2 lg:grid-cols-4 gap-8">
{slide.features?.map((feature, index) => (
<div
key={index}
className="text-center text-gray-800 animate-fade-in-up"
style={{ animationDelay: `${index * 150}ms` }}
>
<div className="text-5xl text-red-500 mb-4">{feature.icon}</div>
<h3 className="text-xl font-bold text-gray-900 mb-2">{feature.title}</h3>
<p className="text-gray-600">{feature.text}</p>
</div>
))}
</div>
</SlideWrapper>
);
case 'dashboard':
return <DashboardSlide />;
case 'final':
return (
<SlideWrapper hasImage={false}>
<div className="text-center text-gray-800">
<h1 className="text-5xl md:text-7xl font-bold text-gray-900">{slide.title}</h1>
<p className="text-xl md:text-2xl mt-4 text-gray-600">{slide.subtitle}</p>
</div>
</SlideWrapper>
);
default:
return null;
}
};
export default SlideContent;