Saima / app.py
SHassan's picture
Update app.py
e40f53d verified
raw
history blame
1.28 kB
import gradio as gr
# Function to generate greeting card content
def generate_card(name, message):
# HTML greeting card layout with inline CSS
html = f"""
<div style="background-image: url('https://imgur.com/gallery/tried-hand-digital-watercolor-what-do-you-think-9MNLzB3#/t/wallpaper');
background-size: cover;
color: white;
height: 300px;
padding: 20px;
font-family: 'Segoe UI', sans-serif;
border-radius: 15px;
box-shadow: 0 0 20px rgba(0,0,0,0.3);
display: flex;
flex-direction: column;
justify-content: center;
text-align: center;">
<h1 style="font-size: 2.5em;">Salaam, {name}!</h1>
<p style="font-size: 1.5em;">{message}</p>
</div>
"""
return html
# Gradio interface using HTML output
demo = gr.Interface(
fn=generate_card,
inputs=[
gr.Textbox(label="Enter your name"),
gr.Textbox(label="Enter a custom message")
],
outputs=gr.HTML(label="Your Greeting Card"),
title="๐ŸŒŸ Greeting Card Generator",
description="Create a beautiful greeting card with a name and message. Powered by Gradio + HTML."
)
demo.launch()