Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
|
@@ -12,33 +12,71 @@ load_dotenv()
|
|
| 12 |
|
| 13 |
# --- SYSTEM CONSTANTS ---
|
| 14 |
PROMPTS_FOR_AI = [
|
| 15 |
-
|
| 16 |
-
"
|
| 17 |
-
"
|
| 18 |
-
"
|
| 19 |
-
"
|
| 20 |
-
"
|
| 21 |
-
"
|
| 22 |
-
"
|
| 23 |
-
"
|
| 24 |
-
"
|
| 25 |
-
"
|
| 26 |
-
"
|
| 27 |
-
"
|
| 28 |
-
"
|
| 29 |
-
"
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 30 |
]
|
| 31 |
|
| 32 |
PROMPT_FOR_IMAGE_GENERATION = """
|
| 33 |
-
When creating image placeholders
|
| 34 |
-
|
| 35 |
-
|
| 36 |
-
|
| 37 |
-
|
| 38 |
-
|
| 39 |
-
|
| 40 |
-
|
| 41 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 42 |
"""
|
| 43 |
|
| 44 |
PROMPT_FOR_PROJECT_NAME = """
|
|
@@ -182,7 +220,7 @@ design_task = Task(
|
|
| 182 |
"**Required Deliverables:**\n\n"
|
| 183 |
"1. **Project Overview:**\n"
|
| 184 |
" - Creative project name with emoji\n"
|
| 185 |
-
" - Project type (single-page or multi-page)\n"
|
| 186 |
" - If multi-page, list all pages needed (e.g., index.html, about.html, contact.html)\n\n"
|
| 187 |
"2. **Color Palette (5-7 colors with specific usage):**\n"
|
| 188 |
" - Primary color (brand identity, CTAs)\n"
|
|
@@ -214,10 +252,15 @@ design_task = Task(
|
|
| 214 |
" - Transition timings (fast: 150ms, normal: 300ms, slow: 500ms)\n"
|
| 215 |
" - Easing functions to use\n\n"
|
| 216 |
"7. **Image & Media Strategy:**\n"
|
| 217 |
-
" -
|
| 218 |
-
" - Specify
|
| 219 |
-
" -
|
| 220 |
-
" -
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 221 |
"8. **Page Structure:**\n"
|
| 222 |
" - Header/Navigation (consistent across pages if multi-page)\n"
|
| 223 |
" - Hero section (with specific layout description)\n"
|
|
@@ -234,7 +277,8 @@ design_task = Task(
|
|
| 234 |
expected_output=(
|
| 235 |
"A detailed, structured Design System Brief in markdown format with all 9 sections completed. "
|
| 236 |
"Include the creative project name with emoji at the top. "
|
| 237 |
-
"Clearly specify if this is a single-page or multi-page project. "
|
|
|
|
| 238 |
"Include specific values, measurements, and clear implementation guidelines. "
|
| 239 |
"The brief should be detailed enough for a developer to implement without additional questions."
|
| 240 |
),
|
|
@@ -310,7 +354,8 @@ development_task = Task(
|
|
| 310 |
"1. Check the Design Brief for project type (single-page vs multi-page)\n"
|
| 311 |
"2. If SINGLE-PAGE: Save as 'outputs/index.html'\n"
|
| 312 |
"3. If MULTI-PAGE: Save each page separately (e.g., 'outputs/index.html', 'outputs/about.html', etc.)\n"
|
| 313 |
-
"4. Use the project name from the Design Brief in all page titles and metadata\n
|
|
|
|
| 314 |
"**MANDATORY TECHNICAL REQUIREMENTS:**\n\n"
|
| 315 |
"1. **HTML Structure (for each page):**\n"
|
| 316 |
" ```html\n"
|
|
@@ -354,10 +399,13 @@ development_task = Task(
|
|
| 354 |
" * Gradient backgrounds if specified\n"
|
| 355 |
" * Any design-specific styles not achievable with Tailwind\n\n"
|
| 356 |
"4. **Image Implementation:**\n"
|
| 357 |
-
" - Use
|
| 358 |
-
" - Format:
|
| 359 |
" - Include proper alt text for all images\n"
|
| 360 |
-
" - Add loading=\"lazy\" for performance\n
|
|
|
|
|
|
|
|
|
|
| 361 |
"5. **Animation Implementation:**\n"
|
| 362 |
" - Initialize AOS in script: `AOS.init({duration: 800, once: true});`\n"
|
| 363 |
" - Add AOS attributes to elements:\n"
|
|
@@ -404,23 +452,25 @@ development_task = Task(
|
|
| 404 |
" - Clean, readable code\n"
|
| 405 |
" - No console errors\n\n"
|
| 406 |
"**CRITICAL:** Save all HTML files to 'outputs/' directory using FileWriterTool.\n"
|
| 407 |
-
"Files must be immediately viewable in a browser without any modifications.\n
|
| 408 |
-
"
|
|
|
|
| 409 |
"**Content Reference:** Use exact copy from the Content Map.\n\n"
|
| 410 |
"Think step-by-step:\n"
|
| 411 |
"1. Identify if single-page or multi-page from Design Brief\n"
|
| 412 |
"2. Set up HTML boilerplate with all CDN links\n"
|
| 413 |
"3. Define CSS variables for the color palette\n"
|
| 414 |
"4. Build header/navigation (with multi-page links if applicable)\n"
|
| 415 |
-
"5. Create hero section with animations\n"
|
| 416 |
"6. Build each content section with appropriate Tailwind classes\n"
|
| 417 |
-
"7. Add
|
| 418 |
-
"8.
|
| 419 |
-
"9.
|
| 420 |
-
"10.
|
| 421 |
-
"11.
|
| 422 |
-
"12.
|
| 423 |
-
"13.
|
|
|
|
| 424 |
),
|
| 425 |
expected_output=(
|
| 426 |
"Complete, self-contained HTML file(s) saved to 'outputs/' directory that:\n"
|
|
@@ -429,6 +479,7 @@ development_task = Task(
|
|
| 429 |
"- Includes smooth animations and transitions\n"
|
| 430 |
"- Uses Tailwind CSS and AOS library\n"
|
| 431 |
"- Implements the exact design and content from previous tasks\n"
|
|
|
|
| 432 |
"- Uses the project name consistently\n"
|
| 433 |
"- Has working navigation for multi-page projects\n"
|
| 434 |
"- Has no errors or missing dependencies\n"
|
|
@@ -477,7 +528,7 @@ def extract_project_name(result_text):
|
|
| 477 |
try:
|
| 478 |
# Look for emoji + project name pattern
|
| 479 |
import re
|
| 480 |
-
pattern = r'([
|
| 481 |
match = re.search(pattern, str(result_text))
|
| 482 |
if match:
|
| 483 |
return match.group(1).strip()
|
|
@@ -623,6 +674,22 @@ with gr.Blocks(theme=gr.themes.Soft(), css="""
|
|
| 623 |
-webkit-text-fill-color: transparent;
|
| 624 |
margin: 20px 0;
|
| 625 |
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 626 |
""") as iface:
|
| 627 |
|
| 628 |
gr.Markdown(
|
|
@@ -631,7 +698,8 @@ with gr.Blocks(theme=gr.themes.Soft(), css="""
|
|
| 631 |
### Create stunning websites with Tailwind CSS & AOS Animations
|
| 632 |
Generate complete, production-ready websites with our AI team. Support for both single-page and multi-page projects!
|
| 633 |
|
| 634 |
-
**๐ Features:** Tailwind CSS โข AOS Animations โข
|
|
|
|
| 635 |
"""
|
| 636 |
)
|
| 637 |
|
|
@@ -649,14 +717,14 @@ with gr.Blocks(theme=gr.themes.Soft(), css="""
|
|
| 649 |
template_dropdown = gr.Dropdown(
|
| 650 |
choices=PROMPTS_FOR_AI,
|
| 651 |
value=PROMPTS_FOR_AI[0],
|
| 652 |
-
label="๐ฏ Select a Template",
|
| 653 |
interactive=True,
|
| 654 |
visible=True
|
| 655 |
)
|
| 656 |
|
| 657 |
custom_prompt = gr.Textbox(
|
| 658 |
lines=4,
|
| 659 |
-
placeholder="Example: A website for
|
| 660 |
label="โ๏ธ Or Describe Your Custom Website",
|
| 661 |
visible=False,
|
| 662 |
elem_classes="container"
|
|
@@ -676,6 +744,19 @@ with gr.Blocks(theme=gr.themes.Soft(), css="""
|
|
| 676 |
scale=1
|
| 677 |
)
|
| 678 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 679 |
with gr.Row():
|
| 680 |
status_output = gr.Markdown(
|
| 681 |
value="",
|
|
@@ -712,7 +793,7 @@ with gr.Blocks(theme=gr.themes.Soft(), css="""
|
|
| 712 |
# Hidden code display
|
| 713 |
with gr.Row(visible=False) as code_row:
|
| 714 |
code_output = gr.Code(
|
| 715 |
-
label="๐ Generated HTML Source Code (Tailwind CSS + AOS)",
|
| 716 |
language="html",
|
| 717 |
lines=15,
|
| 718 |
elem_classes="container"
|
|
@@ -787,7 +868,8 @@ if __name__ == "__main__":
|
|
| 787 |
print("๐จ Vibe Coder AI - Professional Edition")
|
| 788 |
print("="*50)
|
| 789 |
print("\nโ
System initialized successfully!")
|
| 790 |
-
print(f"๐ {len(PROMPTS_FOR_AI)} templates loaded")
|
|
|
|
| 791 |
print("๐ Launching Gradio interface...\n")
|
| 792 |
|
| 793 |
iface.launch(share=False)
|
|
|
|
| 12 |
|
| 13 |
# --- SYSTEM CONSTANTS ---
|
| 14 |
PROMPTS_FOR_AI = [
|
| 15 |
+
# === SINGLE-PAGE WEBSITES ===
|
| 16 |
+
"๐จ Portfolio - Minimalist designer portfolio with projects grid and contact form (Single Page)",
|
| 17 |
+
"๐ SaaS Landing Page - Modern software startup with pricing cards and demo CTA (Single Page)",
|
| 18 |
+
"๐ผ Personal CV - Professional resume website with timeline and skills section (Single Page)",
|
| 19 |
+
"๐ฏ Product Launch - Single product showcase with features and pre-order form (Single Page)",
|
| 20 |
+
"๐ฑ App Landing - Mobile app presentation with screenshots and download buttons (Single Page)",
|
| 21 |
+
"๐ช Event Landing - Conference or workshop page with schedule and registration (Single Page)",
|
| 22 |
+
"๐๏ธ Fitness Landing - Gym or trainer page with services and transformation gallery (Single Page)",
|
| 23 |
+
"๐ Restaurant Landing - Menu showcase with reservations and location info (Single Page)",
|
| 24 |
+
"๐ Course Landing - Online course sales page with curriculum and testimonials (Single Page)",
|
| 25 |
+
"๐ต Music Artist - Musician portfolio with discography and tour dates (Single Page)",
|
| 26 |
+
"๐ Wedding Invitation - Elegant RSVP page with event details and gallery (Single Page)",
|
| 27 |
+
"๐ Real Estate Listing - Property showcase with virtual tour and contact form (Single Page)",
|
| 28 |
+
"๐ Car Dealership - Vehicle showcase with specifications and test drive booking (Single Page)",
|
| 29 |
+
"๐ Beauty Salon - Services menu with pricing and appointment booking (Single Page)",
|
| 30 |
+
"๐ฎ Gaming Landing - Game showcase with trailer and download links (Single Page)",
|
| 31 |
+
"โ Coffee Shop - Cozy cafe page with menu and ambiance gallery (Single Page)",
|
| 32 |
+
"๐ท Photography Portfolio - Visual gallery with categories and booking info (Single Page)",
|
| 33 |
+
"๐ข Corporate Landing - Business services with team and contact sections (Single Page)",
|
| 34 |
+
"๐ฟ Wellness Center - Holistic services with practitioner profiles (Single Page)",
|
| 35 |
+
"๐ฌ Film Production - Studio portfolio with showreel and services (Single Page)",
|
| 36 |
+
|
| 37 |
+
# === MULTI-PAGE WEBSITES ===
|
| 38 |
+
"๐๏ธ E-commerce Platform - Full online store with products, cart, and checkout (Multi-Page)",
|
| 39 |
+
"๐ฐ News Magazine - Multi-category blog with articles and authors (Multi-Page)",
|
| 40 |
+
"๐ University Website - Campus site with departments and student portal (Multi-Page)",
|
| 41 |
+
"๐ฅ Healthcare Portal - Medical center with departments and patient services (Multi-Page)",
|
| 42 |
+
"๐จ Hotel Website - Accommodation with rooms, amenities, and booking system (Multi-Page)",
|
| 43 |
+
"๐ Dashboard Application - Analytics platform with multiple data views (Multi-Page)",
|
| 44 |
+
"๐ญ Theatre Website - Shows, tickets, and venue information (Multi-Page)",
|
| 45 |
+
"โ๏ธ Law Firm - Practice areas, team, and case studies (Multi-Page)",
|
| 46 |
+
"๐๏ธ Construction Company - Projects portfolio, services, and team (Multi-Page)",
|
| 47 |
+
"๐ Travel Agency - Destinations, packages, and booking system (Multi-Page)"
|
| 48 |
]
|
| 49 |
|
| 50 |
PROMPT_FOR_IMAGE_GENERATION = """
|
| 51 |
+
When creating image placeholders, use the static.photos service:
|
| 52 |
+
|
| 53 |
+
Format: http://static.photos/[category]/[dimensions]/[seed]
|
| 54 |
+
|
| 55 |
+
IMPORTANT RULES:
|
| 56 |
+
- Dimensions MUST be one of: 200x200, 320x240, 640x360, 1024x576, or 1200x630
|
| 57 |
+
- Seed: Any number (1-999+) for consistent images, or omit for random
|
| 58 |
+
- Categories: nature, office, people, technology, minimal, abstract, aerial, blurred, bokeh, gradient,
|
| 59 |
+
monochrome, vintage, white, black, blue, red, green, yellow, cityscape, workspace, food, travel,
|
| 60 |
+
textures, industry, indoor, outdoor, studio, finance, medical, season, holiday, event, sport,
|
| 61 |
+
science, legal, estate, restaurant, retail, wellness, agriculture, construction, craft, cosmetic,
|
| 62 |
+
automotive, gaming, or education
|
| 63 |
+
|
| 64 |
+
USAGE EXAMPLES:
|
| 65 |
+
- Hero section: http://static.photos/gradient/1200x630/42
|
| 66 |
+
- Team photos: http://static.photos/people/320x240/[1-6] (use different seeds)
|
| 67 |
+
- Product cards: http://static.photos/technology/640x360/100
|
| 68 |
+
- Background: http://static.photos/abstract/1200x630/777
|
| 69 |
+
- Testimonial avatars: http://static.photos/people/200x200/[201-203]
|
| 70 |
+
- Gallery: http://static.photos/nature/640x360/[301-306]
|
| 71 |
+
|
| 72 |
+
BEST PRACTICES:
|
| 73 |
+
- Use consistent seeds within sections for cohesive design
|
| 74 |
+
- Match category to content (e.g., 'office' for corporate, 'food' for restaurant)
|
| 75 |
+
- Hero images: Use 1200x630 for full-width sections
|
| 76 |
+
- Cards/Features: Use 640x360 for medium-sized images
|
| 77 |
+
- Thumbnails: Use 320x240 or 200x200 for small images
|
| 78 |
+
- Always include descriptive alt text
|
| 79 |
+
- Add loading="lazy" for performance
|
| 80 |
"""
|
| 81 |
|
| 82 |
PROMPT_FOR_PROJECT_NAME = """
|
|
|
|
| 220 |
"**Required Deliverables:**\n\n"
|
| 221 |
"1. **Project Overview:**\n"
|
| 222 |
" - Creative project name with emoji\n"
|
| 223 |
+
" - Project type (single-page or multi-page) - Check if prompt mentions 'Single Page' or 'Multi-Page'\n"
|
| 224 |
" - If multi-page, list all pages needed (e.g., index.html, about.html, contact.html)\n\n"
|
| 225 |
"2. **Color Palette (5-7 colors with specific usage):**\n"
|
| 226 |
" - Primary color (brand identity, CTAs)\n"
|
|
|
|
| 252 |
" - Transition timings (fast: 150ms, normal: 300ms, slow: 500ms)\n"
|
| 253 |
" - Easing functions to use\n\n"
|
| 254 |
"7. **Image & Media Strategy:**\n"
|
| 255 |
+
" - Use static.photos service for all placeholder images\n"
|
| 256 |
+
" - Specify exact URLs for each section using format: http://static.photos/[category]/[dimensions]/[seed]\n"
|
| 257 |
+
" - Hero image: Use 1200x630 dimension\n"
|
| 258 |
+
" - Feature cards: Use 640x360 dimension\n"
|
| 259 |
+
" - Thumbnails: Use 320x240 or 200x200\n"
|
| 260 |
+
" - Profile/avatar images: Use 200x200\n"
|
| 261 |
+
" - Choose appropriate categories for the project type\n"
|
| 262 |
+
" - Use consistent seed numbers within sections\n"
|
| 263 |
+
" - Include alt text descriptions for each image\n\n"
|
| 264 |
"8. **Page Structure:**\n"
|
| 265 |
" - Header/Navigation (consistent across pages if multi-page)\n"
|
| 266 |
" - Hero section (with specific layout description)\n"
|
|
|
|
| 277 |
expected_output=(
|
| 278 |
"A detailed, structured Design System Brief in markdown format with all 9 sections completed. "
|
| 279 |
"Include the creative project name with emoji at the top. "
|
| 280 |
+
"Clearly specify if this is a single-page or multi-page project based on the prompt. "
|
| 281 |
+
"Include specific static.photos URLs with proper dimensions and categories. "
|
| 282 |
"Include specific values, measurements, and clear implementation guidelines. "
|
| 283 |
"The brief should be detailed enough for a developer to implement without additional questions."
|
| 284 |
),
|
|
|
|
| 354 |
"1. Check the Design Brief for project type (single-page vs multi-page)\n"
|
| 355 |
"2. If SINGLE-PAGE: Save as 'outputs/index.html'\n"
|
| 356 |
"3. If MULTI-PAGE: Save each page separately (e.g., 'outputs/index.html', 'outputs/about.html', etc.)\n"
|
| 357 |
+
"4. Use the project name from the Design Brief in all page titles and metadata\n"
|
| 358 |
+
"5. Use the exact static.photos URLs specified in the Design Brief\n\n"
|
| 359 |
"**MANDATORY TECHNICAL REQUIREMENTS:**\n\n"
|
| 360 |
"1. **HTML Structure (for each page):**\n"
|
| 361 |
" ```html\n"
|
|
|
|
| 399 |
" * Gradient backgrounds if specified\n"
|
| 400 |
" * Any design-specific styles not achievable with Tailwind\n\n"
|
| 401 |
"4. **Image Implementation:**\n"
|
| 402 |
+
" - Use the exact static.photos URLs from the Design Brief\n"
|
| 403 |
+
" - Format: <img src=\"http://static.photos/[category]/[dimensions]/[seed]\" alt=\"[description]\">\n"
|
| 404 |
" - Include proper alt text for all images\n"
|
| 405 |
+
" - Add loading=\"lazy\" for performance (except hero images)\n"
|
| 406 |
+
" - Add class=\"w-full h-auto\" for responsive images\n"
|
| 407 |
+
" - Example hero: <img src=\"http://static.photos/gradient/1200x630/42\" alt=\"Hero background\" class=\"w-full h-auto\">\n"
|
| 408 |
+
" - Example card: <img src=\"http://static.photos/technology/640x360/100\" alt=\"Feature image\" class=\"w-full h-auto rounded-lg\">\n\n"
|
| 409 |
"5. **Animation Implementation:**\n"
|
| 410 |
" - Initialize AOS in script: `AOS.init({duration: 800, once: true});`\n"
|
| 411 |
" - Add AOS attributes to elements:\n"
|
|
|
|
| 452 |
" - Clean, readable code\n"
|
| 453 |
" - No console errors\n\n"
|
| 454 |
"**CRITICAL:** Save all HTML files to 'outputs/' directory using FileWriterTool.\n"
|
| 455 |
+
"Files must be immediately viewable in a browser without any modifications.\n"
|
| 456 |
+
"Images must use static.photos URLs exactly as specified in the Design Brief.\n\n"
|
| 457 |
+
"**Design Brief Reference:** Use exact colors, fonts, spacing, images, and project name from the Design Brief.\n"
|
| 458 |
"**Content Reference:** Use exact copy from the Content Map.\n\n"
|
| 459 |
"Think step-by-step:\n"
|
| 460 |
"1. Identify if single-page or multi-page from Design Brief\n"
|
| 461 |
"2. Set up HTML boilerplate with all CDN links\n"
|
| 462 |
"3. Define CSS variables for the color palette\n"
|
| 463 |
"4. Build header/navigation (with multi-page links if applicable)\n"
|
| 464 |
+
"5. Create hero section with static.photos image and animations\n"
|
| 465 |
"6. Build each content section with appropriate Tailwind classes\n"
|
| 466 |
+
"7. Add static.photos images with proper dimensions\n"
|
| 467 |
+
"8. Add AOS animations to key elements\n"
|
| 468 |
+
"9. Implement hover effects and transitions\n"
|
| 469 |
+
"10. Build responsive footer\n"
|
| 470 |
+
"11. Add mobile menu functionality\n"
|
| 471 |
+
"12. For multi-page: Repeat for each additional page\n"
|
| 472 |
+
"13. Test responsive breakpoints\n"
|
| 473 |
+
"14. Save all files to outputs/ directory"
|
| 474 |
),
|
| 475 |
expected_output=(
|
| 476 |
"Complete, self-contained HTML file(s) saved to 'outputs/' directory that:\n"
|
|
|
|
| 479 |
"- Includes smooth animations and transitions\n"
|
| 480 |
"- Uses Tailwind CSS and AOS library\n"
|
| 481 |
"- Implements the exact design and content from previous tasks\n"
|
| 482 |
+
"- Uses static.photos images with correct dimensions\n"
|
| 483 |
"- Uses the project name consistently\n"
|
| 484 |
"- Has working navigation for multi-page projects\n"
|
| 485 |
"- Has no errors or missing dependencies\n"
|
|
|
|
| 528 |
try:
|
| 529 |
# Look for emoji + project name pattern
|
| 530 |
import re
|
| 531 |
+
pattern = r'([๐๐จ๐ซ๐โจ๐ฏ๐ฅ๐๐๐ญ๐ช๐ธ๐ฌ๐ฎ๐ฏ๐ผ๐๐ธ๐ฆ๐๐๐๏ธ๐๐ ๐๏ธ๐ฐ๐ต๐ณ๐๐๐จ๐ฑ๐ช๐๐ต๐๐ ๐๐๐ฎโ๐ท๐ข๐ฟ๐ฌ๐ฅ๐จ๐๐ญโ๏ธ๐๏ธ๐][^\n]*(?:Pro|Studio|Hub|Lab|Plus|App|Site|Portal|Platform|Space|Zone|World|Center|Market|Shop|Store|Pages?))'
|
| 532 |
match = re.search(pattern, str(result_text))
|
| 533 |
if match:
|
| 534 |
return match.group(1).strip()
|
|
|
|
| 674 |
-webkit-text-fill-color: transparent;
|
| 675 |
margin: 20px 0;
|
| 676 |
}
|
| 677 |
+
.template-badge {
|
| 678 |
+
display: inline-block;
|
| 679 |
+
padding: 3px 8px;
|
| 680 |
+
border-radius: 4px;
|
| 681 |
+
font-size: 0.75rem;
|
| 682 |
+
font-weight: 600;
|
| 683 |
+
margin-left: 8px;
|
| 684 |
+
}
|
| 685 |
+
.single-page-badge {
|
| 686 |
+
background: #48bb78;
|
| 687 |
+
color: white;
|
| 688 |
+
}
|
| 689 |
+
.multi-page-badge {
|
| 690 |
+
background: #4299e1;
|
| 691 |
+
color: white;
|
| 692 |
+
}
|
| 693 |
""") as iface:
|
| 694 |
|
| 695 |
gr.Markdown(
|
|
|
|
| 698 |
### Create stunning websites with Tailwind CSS & AOS Animations
|
| 699 |
Generate complete, production-ready websites with our AI team. Support for both single-page and multi-page projects!
|
| 700 |
|
| 701 |
+
**๐ Features:** Tailwind CSS โข AOS Animations โข Static.photos Images โข Semantic HTML5 โข Multi-page Support โข Auto ZIP Export
|
| 702 |
+
**๐ผ๏ธ Images:** Professional placeholders from static.photos with 30+ categories
|
| 703 |
"""
|
| 704 |
)
|
| 705 |
|
|
|
|
| 717 |
template_dropdown = gr.Dropdown(
|
| 718 |
choices=PROMPTS_FOR_AI,
|
| 719 |
value=PROMPTS_FOR_AI[0],
|
| 720 |
+
label="๐ฏ Select a Template (20 Single-Page | 10 Multi-Page)",
|
| 721 |
interactive=True,
|
| 722 |
visible=True
|
| 723 |
)
|
| 724 |
|
| 725 |
custom_prompt = gr.Textbox(
|
| 726 |
lines=4,
|
| 727 |
+
placeholder="Example: A minimalist portfolio website for a photographer with smooth animations and a gallery section. Single page design with modern layout.",
|
| 728 |
label="โ๏ธ Or Describe Your Custom Website",
|
| 729 |
visible=False,
|
| 730 |
elem_classes="container"
|
|
|
|
| 744 |
scale=1
|
| 745 |
)
|
| 746 |
|
| 747 |
+
with gr.Row():
|
| 748 |
+
gr.Examples(
|
| 749 |
+
examples=[
|
| 750 |
+
["๐จ Portfolio - Minimalist designer portfolio with projects grid and contact form (Single Page)"],
|
| 751 |
+
["๐ SaaS Landing Page - Modern software startup with pricing cards and demo CTA (Single Page)"],
|
| 752 |
+
["๐ Restaurant Landing - Menu showcase with reservations and location info (Single Page)"],
|
| 753 |
+
["๐ Course Landing - Online course sales page with curriculum and testimonials (Single Page)"],
|
| 754 |
+
["๐๏ธ E-commerce Platform - Full online store with products, cart, and checkout (Multi-Page)"],
|
| 755 |
+
],
|
| 756 |
+
inputs=template_dropdown,
|
| 757 |
+
label="๐ก Popular Templates"
|
| 758 |
+
)
|
| 759 |
+
|
| 760 |
with gr.Row():
|
| 761 |
status_output = gr.Markdown(
|
| 762 |
value="",
|
|
|
|
| 793 |
# Hidden code display
|
| 794 |
with gr.Row(visible=False) as code_row:
|
| 795 |
code_output = gr.Code(
|
| 796 |
+
label="๐ Generated HTML Source Code (Tailwind CSS + AOS + Static.photos)",
|
| 797 |
language="html",
|
| 798 |
lines=15,
|
| 799 |
elem_classes="container"
|
|
|
|
| 868 |
print("๐จ Vibe Coder AI - Professional Edition")
|
| 869 |
print("="*50)
|
| 870 |
print("\nโ
System initialized successfully!")
|
| 871 |
+
print(f"๐ {len(PROMPTS_FOR_AI)} templates loaded (20 single-page, 10 multi-page)")
|
| 872 |
+
print("๐ผ๏ธ Static.photos integration enabled")
|
| 873 |
print("๐ Launching Gradio interface...\n")
|
| 874 |
|
| 875 |
iface.launch(share=False)
|