import React from 'react' import * as z from "zod"; import { ImageSchema } from '@/presentation-layouts/defaultSchemes'; export const layoutId = 'image-background-text-slide' export const layoutName = 'Image Background + Text Slide' export const layoutDescription = 'A layout for quotes, key messages, and mood slides with full-slide background image and overlaid text.' const imageBackgroundTextSlideSchema = z.object({ title: z.string().min(3).max(200).default('Success is not final, failure is not fatal: it is the courage to continue that counts.').meta({ description: "Main quote or message text", }), subtitle: z.string().optional().default('Winston Churchill').meta({ description: "Optional subtitle, author, or attribution", }), backgroundImage: ImageSchema.default({ __image_url__: 'https://cdn.pixabay.com/photo/2016/12/02/02/10/idea-1876659_1280.jpg', __image_prompt__: 'Inspirational workspace with lightbulb and motivation' }).meta({ description: "Background image for the slide", }), overlayOpacity: z.number().min(0.3).max(0.8).default(0.5).meta({ description: "Dark overlay opacity (0.3-0.8)", }), textAlignment: z.enum(['left', 'center', 'right']).default('center').meta({ description: "Text alignment", }), textSize: z.enum(['large', 'extra-large', 'huge']).default('large').meta({ description: "Text size variant", }), textColor: z.enum(['white', 'light-gray', 'yellow', 'blue']).default('white').meta({ description: "Text color theme", }), }) export const Schema = imageBackgroundTextSlideSchema export type ImageBackgroundTextSlideData = z.infer interface ImageBackgroundTextSlideLayoutProps { data?: Partial } const ImageBackgroundTextSlideLayout: React.FC = ({ data: slideData }) => { const getTextAlignment = () => { switch (slideData?.textAlignment) { case 'left': return 'text-left items-start justify-start pl-8 sm:pl-16 lg:pl-24'; case 'right': return 'text-right items-end justify-end pr-8 sm:pr-16 lg:pr-24'; default: return 'text-center items-center justify-center'; } }; const getTextSize = () => { switch (slideData?.textSize) { case 'extra-large': return 'text-3xl sm:text-4xl lg:text-5xl xl:text-6xl'; case 'huge': return 'text-4xl sm:text-5xl lg:text-6xl xl:text-7xl'; default: return 'text-2xl sm:text-3xl lg:text-4xl xl:text-5xl'; } }; const getTextColor = () => { switch (slideData?.textColor) { case 'light-gray': return 'text-gray-100'; case 'yellow': return 'text-yellow-300'; case 'blue': return 'text-blue-300'; default: return 'text-white'; } }; const getOverlayOpacity = () => { const opacity = slideData?.overlayOpacity || 0.5; return `rgba(0, 0, 0, ${opacity})`; }; return ( <> {/* Import Google Fonts */}
{/* Background Image */}
{slideData?.backgroundImage?.__image_prompt__
{/* Dark Overlay */}
{/* Text Overlay */}
{/* Main Title/Quote */}

{slideData?.title || 'Success is not final, failure is not fatal: it is the courage to continue that counts.'}

{/* Subtitle/Attribution */} {slideData?.subtitle && (

— {slideData.subtitle}

)}
) } export default ImageBackgroundTextSlideLayout