Spaces:
Sleeping
Sleeping
File size: 1,279 Bytes
ea084ed e40f53d ea084ed |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 |
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()
|