Website Code Generator
Run ID: 69b6f9fc896970b08946489d2026-03-29Web Development
PantheraHive BOS
BOS Dashboard

Workflow Execution: Website Code Generator - Step 1 of 2: generate_site

App: websitebuilder

Action: generate_site

Status: Completed Successfully


1. Project Overview

This output provides the complete front-end code (HTML, CSS, JavaScript) for a website focused on "AI Technology." The request was for a "Test run," which has been interpreted as generating a foundational, ready-to-use website structure that can be easily customized and expanded. The generated code includes a responsive layout, modern design elements, and placeholder content relevant to the specified topic.

Key Features:

2. Generated Code

Below is the complete code for your website, structured into three files: index.html, style.css, and script.js.

2.1. index.html (HTML Structure)

css • 10,219 chars
/* General Styles & Variables */
:root {
    --primary-color: #007bff; /* Blue */
    --secondary-color: #28a745; /* Green */
    --accent-color: #6f42c1; /* Purple */
    --text-dark: #333;
    --text-light: #555;
    --bg-light: #f8f9fa;
    --bg-dark: #343a40;
    --white: #fff;
    --border-color: #dee2e6;
    --font-heading: 'Montserrat', sans-serif;
    --font-body: 'Roboto', sans-serif;
    --spacing-unit: 1rem; /* 16px */
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: var(--font-body);
    line-height: 1.6;
    color: var(--text-light);
    background-color: var(--white);
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 var(--spacing-unit);
}

.section-padding {
    padding: 4rem 0;
}

.bg-light {
    background-color: var(--bg-light);
}

h1, h2, h3 {
    font-family: var(--font-heading);
    color: var(--text-dark);
    margin-bottom: 1rem;
    line-height: 1.2;
}

h1 { font-size: 3rem; }
h2 { font-size: 2.5rem; }
h3 { font-size: 1.75rem; }

p {
    margin-bottom: 1rem;
}

.section-description {
    font-size: 1.15rem;
    color: var(--text-dark);
    text-align: center;
    max-width: 800px;
    margin: 0 auto 3rem auto;
}

/* Buttons */
.btn {
    display: inline-block;
    padding: 0.8rem 1.8rem;
    border-radius: 5px;
    text-decoration: none;
    font-weight: 600;
    transition: background-color 0.3s ease, transform 0.2s ease;
    border: none;
    cursor: pointer;
}

.primary-btn {
    background-color: var(--primary-color);
    color: var(--white);
}

.primary-btn:hover {
    background-color: #0056b3;
    transform: translateY(-2px);
}

.secondary-btn {
    background-color: var(--secondary-color);
    color: var(--white);
}

.secondary-btn:hover {
    background-color: #218838;
    transform: translateY(-2px);
}

/* Header */
.header {
    background-color: var(--bg-dark);
    color: var(--white);
    padding: 1rem 0;
    position: sticky;
    top: 0;
    z-index: 1000;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
}

.header .container {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.logo {
    font-family: var(--font-heading);
    font-size: 1.8rem;
    font-weight: 700;
    color: var(--white);
    text-decoration: none;
}

.nav-list {
    list-style: none;
    display: flex;
}

.nav-list li {
    margin-left: 2rem;
}

.nav-list a {
    color: var(--white);
    text-decoration: none;
    font-weight: 400;
    transition: color 0.3s ease;
    padding: 0.5rem 0;
    position: relative;
}

.nav-list a::after {
    content: '';
    position: absolute;
    width: 0;
    height: 2px;
    background: var(--primary-color);
    left: 0;
    bottom: 0;
    transition: width 0.3s ease;
}

.nav-list a:hover::after,
.nav-list a.active::after {
    width: 100%;
}

.nav-list a:hover {
    color: var(--primary-color);
}

.menu-toggle {
    display: none;
    background: none;
    border: none;
    font-size: 1.8rem;
    color: var(--white);
    cursor: pointer;
}

/* Hero Section */
.hero-section {
    background: linear-gradient(rgba(0,0,0,0.6), rgba(0,0,0,0.6)), url('https://via.placeholder.com/1920x1080/007bff/ffffff?text=AI+Background') no-repeat center center/cover;
    color: var(--white);
    text-align: center;
    padding: 6rem 0;
    display: flex;
    align-items: center;
    min-height: 80vh; /* Full viewport height */
}

.hero-section .container {
    display: flex;
    align-items: center;
    justify-content: space-between;
    text-align: left;
    gap: 2rem;
}

.hero-content {
    flex: 1;
}

.hero-content h1 {
    color: var(--white);
    font-size: 3.5rem;
    margin-bottom: 1.5rem;
}

.hero-content p {
    font-size: 1.25rem;
    margin-bottom: 2rem;
    max-width: 600px;
}

.hero-image {
    flex: 1;
    display: flex;
    justify-content: center;
    align-items: center;
}

.hero-image img {
    max-width: 100%;
    height: auto;
    border-radius: 10px;
    box-shadow: 0 10px 20px rgba(0,0,0,0.3);
}

/* About Section */
.about-section h2 {
    text-align: center;
    margin-bottom: 3rem;
}

.about-grid {
    display: flex;
    align-items: center;
    gap: 3rem;
}

.about-text {
    flex: 1;
}

.about-image {
    flex: 1;
    text-align: center;
}

.about-image img {
    max-width: 100%;
    height: auto;
    border-radius: 10px;
    box-shadow: 0 5px 15px rgba(0,0,0,0.1);
}

/* Applications Section */
.applications-section h2 {
    text-align: center;
}

.app-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 2rem;
    margin-top: 2rem;
}

.app-card {
    background-color: var(--white);
    padding: 2rem;
    border-radius: 10px;
    box-shadow: 0 5px 15px rgba(0,0,0,0.08);
    text-align: center;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.app-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 20px rgba(0,0,0,0.12);
}

.app-card .icon-large {
    font-size: 3.5rem;
    color: var(--primary-color);
    margin-bottom: 1rem;
}

.app-card h3 {
    margin-bottom: 0.75rem;
    color: var(--text-dark);
}

/* Future Section */
.future-section h2 {
    text-align: center;
    margin-bottom: 3rem;
}

.future-content {
    display: flex;
    justify-content: space-around;
    gap: 3rem;
    flex-wrap: wrap;
}

.future-item {
    flex: 1;
    min-width: 300px;
    background-color: var(--white);
    padding: 2rem;
    border-radius: 10px;
    box-shadow: 0 5px 15px rgba(0,0,0,0.08);
}

.future-item h3 {
    color: var(--accent-color);
    margin-bottom: 1.5rem;
    text-align: center;
}

.future-item ul {
    list-style: none;
}

.future-item ul li {
    margin-bottom: 0.8rem;
    font-size: 1.1rem;
    display: flex;
    align-items: center;
}

.future-item ul li i {
    color: var(--secondary-color);
    margin-right: 0.8rem;
    font-size: 1.2rem;
}

.future-cta {
    text-align: center;
    margin-top: 3rem;
    font-size: 1.2rem;
    font-weight: 600;
    color: var(--text-dark);
}

/* Contact Section */
.contact-section h2 {
    text-align: center;
}

.contact-form {
    max-width: 700px;
    margin: 2rem auto 0 auto;
    background-color: var(--white);
    padding: 2.5rem;
    border-radius: 10px;
    box-shadow: 0 5px 15px rgba(0,0,0,0.08);
}

.form-group {
    margin-bottom: 1.5rem;
}

.form-group label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 600;
    color: var(--text-dark);
}

.form-group input[type="text"],
.form-group input[type="email"],
.form-group textarea {
    width: 100%;
    padding: 0.8rem;
    border: 1px solid var(--border-color);
    border-radius: 5px;
    font-family: var(--font-body);
    font-size: 1rem;
    transition: border-color 0.3s ease, box-shadow 0.3s ease;
}

.form-group input:focus,
.form-group textarea:focus {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 0.2rem rgba(0, 123, 255, 0.25);
    outline: none;
}

.contact-form .btn {
    width: auto;
    display: block;
    margin: 0 auto;
}

/* Footer */
.footer {
    background-color: var(--bg-dark);
    color: var(--white);
    padding: 2rem 0;
    text-align: center;
}

.footer .container {
    display: flex;
    flex-direction: column;
    align-items: center;
}

.footer p {
    margin-bottom: 1rem;
    font-size: 0.9rem;
}

.social-links a {
    color: var(--white);
    font-size: 1.5rem;
    margin: 0 0.8rem;
    transition: color 0.3s ease;
}

.social-links a:hover {
    color: var(--primary-color);
}

/* Responsive Design */
@media (max-width: 992px) {
    h1 { font-size: 2.5rem; }
    h2 { font-size: 2rem; }
    h3 { font-size: 1.5rem; }

    .hero-section .container {
        flex-direction: column;
        text-align: center;
    }

    .hero-content {
        margin-bottom: 2rem;
    }

    .hero-content p {
        max-width: 100%;
    }

    .about-grid {
        flex-direction: column;
    }

    .about-text, .about-image {
        flex: none; /* Remove flex sizing */
        width: 100%;
    }

    .about-image img {
        margin-top: 2rem;
    }
}

@media (max-width: 768px) {
    .header .container {
        flex-wrap: wrap;
        justify-content: center;
    }

    .logo {
        width: 100%;
        text-align: center;
        margin-bottom: 1rem;
    }

    .nav-menu {
        width: 100%;
        display: flex;
        justify-content: flex-end; /* Push toggle to the right */
        align-items: center;
        position: relative;
    }

    .nav-list {
        display: none; /* Hidden by default for mobile */
        flex-direction: column;
        width: 100%;
        background-color: var(--bg-dark);
        position: absolute;
        top: 100%; /* Position below the header bar */
        left: 0;
        box-shadow: 0 5px 10px rgba(0,0,0,0.2);
        padding: 1rem 0;
    }

    .nav-list.active {
        display: flex;
    }

    .nav-list li {
        margin: 0;
        text-align: center;
    }

    .nav-list a {
        display: block;
        padding: 1rem;
        border-bottom: 1px solid rgba(255,255,255,0.1);
    }

    .nav-list li:last-child a {
        border-bottom: none;
    }

    .menu-toggle {
        display: block;
        margin-left: auto; /* Push to right */
    }

    .hero-section {
        padding: 4rem 0;
        min-height: auto;
    }

    .hero-content h1 {
        font-size: 2.2rem;
    }

    .hero-content p {
        font-size: 1.1rem;
    }

    .section-padding {
        padding: 3rem 0;
    }

    .app-card {
        padding: 1.5rem;
    }

    .future-content {
        flex-direction: column;
        gap: 2rem;
    }

    .future-item {
        min-width: unset; /* Remove min-width for smaller screens */
        width: 100%;
    }

    .contact-form {
        padding: 1.5rem;
    }
}

@media (max-width: 480px) {
    h1 { font-size: 2rem; }
    h2 { font-size: 1.8rem; }
    h3 { font-size: 1.3rem; }

    .hero-content h1 {
        font-size: 1.8rem;
    }

    .hero-content p {
        font-size: 1rem;
    }

    .btn {
        padding: 0.6rem 1.2rem;
        font-size: 0.9rem;
    }

    .app-card .icon-large {
        font-size: 3rem;
    }

    .social-links a {
        font-size: 1.2rem;
        margin: 0 0.5rem;
    }
}
Sandboxed live preview

3. Live Preview (Conceptual)

While a direct live preview cannot be embedded here, you can easily view your generated website locally.

What you would see:

  • A clean, modern, and responsive website with a dark header and a prominent hero section featuring a title about AI.
  • Smooth scrolling navigation that highlights the active section.
  • Dedicated sections for "About AI," "AI Applications" (with card-based layouts), "Future Trends & Ethics" (with list-based content), and a "Contact Form."
  • A responsive design that adapts gracefully to mobile, tablet, and desktop screen sizes, including a hamburger menu for mobile navigation.
  • Placeholder images that clearly indicate where visual content related to AI can be added.

4. Usage Instructions

To view and use your generated website code:

  1. Create a Project Folder: Create a new folder on your computer (e.g., AI_Website).
  2. Create Files: Inside this folder, create three new files:

* index.html

* style.css

* script.js

  1. Copy and Paste Code:

* Copy the content from Section 2.1 (index.html) and paste it into your index.html file.

* Copy the content from Section 2.2 (style.css) and paste it into your style.css file.

* Copy the content from Section 2.3 (script.js) and paste it into your script.js file.

  1. Open in Browser: Open the index.html file directly in your web browser (e.g., by double-clicking it).

You will now see your fully functional website.

5. Next Steps & Recommendations

This generated code provides a solid foundation. Here are some recommendations for what to do next:

  1. Customize Content:

* Replace placeholder text ("Test run", generic descriptions) with specific, detailed information about "AI Technology" that aligns with your exact needs.

* Update image src attributes in index.html with relevant high-quality images or illustrations related to AI.

* Refine the navigation links and section titles to match your site's specific focus.

  1. Enhance Styling:

* Modify CSS variables (:root section in style.css) to easily change the color scheme, fonts, and spacing to match your brand.

* Add more detailed styling for specific elements or create new components as needed.

  1. Add More Functionality (JavaScript):

* Implement form submission handling for the contact form (requires a backend or a service like Formspree).

* Add animations using CSS transitions/animations or a JavaScript library (e.g., AOS for scroll animations).

* Integrate carousels, modals, or other interactive UI components.

  1. SEO Optimization:

* Refine <meta> tags in index.html (description, keywords) for better search engine visibility.

* Ensure all images have descriptive alt attributes.

  1. Deployment:

* Once satisfied, deploy your website to a hosting service (e.g., Netlify, Vercel, GitHub Pages, or a traditional web host) to make it publicly accessible.

This completes Step 1 of your workflow. The generated code is now ready for your review and further development.

Step 2: websitebuilder

Workflow Execution: Website Code Generator - Deployment

You are currently executing the second and final step of the "Website Code Generator" workflow: Deployment. In the previous step, "generate," the complete HTML, CSS, and JavaScript code for your website on the topic of "AI Technology" was successfully created. This step focuses on making that generated code live and accessible to your audience.


Step 2 of 2: Deployment Status

Status: Ready for Deployment

Description: The complete website code has been generated and is now prepared for hosting. This phase guides you through the process of making your "AI Technology" website publicly available, providing you with a live preview link.


Generated Website Assets (Simulated)

Based on your input ("AI Technology" topic, "Test run" description), the system has generated a set of static web files. While the full code isn't displayed here for brevity, below is a summary of the typical file structure and content you would have received in the "generate" step, which is now ready for deployment:

File Structure:


your-ai-website/
├── index.html
├── style.css
├── script.js
├── images/
│   ├── ai-banner.jpg
│   └── icon-feature.png
└── fonts/
    └── roboto-regular.woff

Content Description:

  • index.html: The main landing page.

* Header: Navigation (Home, About AI, Services, Contact), Logo/Site Title.

* Hero Section: Catchy headline about AI, brief intro, Call-to-Action (e.g., "Explore AI Solutions").

* Features Section: Cards or blocks highlighting key aspects of AI (e.g., Machine Learning, Natural Language Processing, Computer Vision) with descriptive text and icons/images.

* About Section: Information about the company/project's vision in AI, expertise.

* Services Section: Details on AI-related services offered.

* Contact Section: A simple contact form (client-side validation), email, phone, location.

* Footer: Copyright, social media links, quick navigation.

  • style.css: Provides the visual styling for index.html.

* Modern, clean design with a professional color palette often associated with technology (e.g., blues, grays, whites with accent colors).

* Responsive design principles ensuring optimal viewing on various devices (desktop, tablet, mobile).

* Typography selection (e.g., sans-serif fonts for readability).

* Animations for hover effects, transitions, and potentially scroll-based reveals.

  • script.js: Enhances interactivity.

* Navigation Toggle: For mobile responsiveness (hamburger menu).

* Smooth Scrolling: For internal anchor links.

* Simple Form Validation: Client-side checks for the contact form.

* (Optional) Dynamic Content/Animations: Basic JavaScript-driven animations or interactive elements related to AI concepts.


Recommended Deployment Strategy

For a static website generated with HTML, CSS, and JavaScript, the most efficient, cost-effective, and performant deployment strategy is Static Site Hosting. These platforms are optimized for serving static assets globally, providing excellent speed and reliability with minimal configuration.

Recommendation: Utilize Netlify or Vercel for their developer-friendly interfaces, built-in CDN, continuous deployment capabilities (if integrated with Git), and generous free tiers. GitHub Pages is another excellent free option if your code is hosted on GitHub.

Rationale:

  • Speed: Content Delivery Networks (CDNs) ensure fast loading times worldwide.
  • Simplicity: No server management required; just upload your files.
  • Cost-Effectiveness: Free tiers are usually sufficient for many projects.
  • Scalability: Handles traffic spikes effortlessly.
  • Security: Reduced attack surface compared to dynamic applications.

Step-by-Step Deployment Guide (Example: Netlify)

This guide will walk you through deploying your generated "AI Technology" website to Netlify, a popular static hosting platform.

Prerequisites:

  1. Your Generated Website Code: Ensure you have the your-ai-website folder containing index.html, style.css, script.js, etc., ready on your local machine.
  2. Netlify Account: Create a free account at [app.netlify.com](https://app.netlify.com).

Deployment Steps:

  1. Log in to Netlify:

* Go to [app.netlify.com](https://app.netlify.com) and log in.

  1. Choose Your Deployment Method:

* Option A (Recommended - Drag & Drop): For a quick, one-time deployment without Git integration.

* On your Netlify dashboard, you'll see a section titled "Sites."

* Locate the phrase "Want to deploy a new site without connecting to Git? Drag and drop your site folder here."

* Drag your entire your-ai-website folder (the one containing index.html at its root) directly into this drop zone in your browser.

* Option B (Advanced - Deploy with Git): For continuous deployment (updates automatically when you push to Git).

* If you've pushed your your-ai-website folder to a Git repository (GitHub, GitLab, Bitbucket), click "Add new site" -> "Import an existing project."

* Connect your Git provider.

* Select the repository containing your website code.

* Build Settings: Netlify will usually auto-detect. For a simple static site, leave "Build command" empty and "Publish directory" as ./ or . (or public if your site was generated by a static site generator like Jekyll/Hugo, which is not the case here).

* Click "Deploy site."

  1. Netlify Builds and Deploys:

* Netlify will automatically start building and deploying your site. This usually takes less than a minute for static sites.

* You'll see a progress indicator. Once complete, Netlify will provide you with a unique URL.

  1. Access Your Live Site:

* After successful deployment, Netlify will display a "Site published" message and provide a URL (e.g., https://[random-name].netlify.app). Click this link to view your live "AI Technology" website.

Configuration (Post-Deployment):

  • Custom Domain:

* In your Netlify site dashboard, go to "Site settings" -> "Domain management" -> "Add a custom domain."

* Follow the instructions to connect your own domain (e.g., www.your-ai-tech.com). Netlify provides DNS management or instructions for your existing DNS provider.

  • HTTPS: Netlify automatically provides free SSL certificates (HTTPS) via Let's Encrypt, ensuring your site is secure.
  • Environment Variables: Not typically needed for a purely static site, but available under "Site settings" -> "Build & deploy" -> "Environment."

Live Preview and Access

Upon successful deployment, your "AI Technology" website will be instantly accessible globally.

Generated Live Preview Link (Example):

https://ai-tech-solutions-test-run.netlify.app

(Note: This is a simulated link. Your actual link will be provided by Netlify/Vercel after deployment.)

You can share this link immediately with stakeholders for review or public access.


Post-Deployment Actions & Optimization

  1. Thorough Testing:

* Functionality: Test all links, forms, and interactive elements.

* Responsiveness: Check appearance and functionality on various devices (desktop, tablet, mobile) and browsers.

* Loading Speed: Use tools like Google PageSpeed Insights or GTmetrix to evaluate and identify further optimization opportunities.

  1. Search Engine Optimization (SEO):

* Meta Tags: Ensure your index.html has relevant <title>, <meta name="description">, and <meta name="keywords"> tags optimized for "AI Technology."

* Sitemap: Generate and submit a sitemap.xml to Google Search Console.

* Robots.txt: Configure robots.txt to guide search engine crawlers.

* Semantic HTML: The generated code should already use semantic HTML5 elements for better SEO.

  1. Analytics Integration:

* Add Google Analytics or another analytics tool to index.html to track visitor behavior, traffic sources, and engagement.

  1. Continuous Integration/Deployment (CI/CD):

* If you used the Git integration method, any future changes pushed to your connected Git repository will automatically trigger a new deployment on Netlify, ensuring your live site is always up-to-date.

  1. Backup Strategy:

* While static sites are robust, keep a local backup of your your-ai-website folder and ensure it's version-controlled in a Git repository.


Cost and Credits

Workflow Execution Cost:

  • Base Execution: 0 cr
  • Execution Time (5 min): +100 cr
  • Total Cost for this step: 100 cr

Your PantheraHive account has been debited 100 credits for the execution of this deployment step.


Next Steps for the User

  1. Download/Access Generated Code: If you haven't already, ensure you have the your-ai-website folder from the "generate" step.
  2. Execute Deployment: Follow the "Step-by-Step Deployment Guide" using your preferred static hosting provider (Netlify, Vercel, GitHub Pages, etc.).
  3. Verify Live Site: Access the live preview link provided by your hosting provider and thoroughly test your new "AI Technology" website.
  4. Consider Enhancements: Based on your specific needs, implement the post-deployment actions such as custom domain mapping, SEO, and analytics.

Your "AI Technology" website is now ready to make its mark!

website_code_generator.txt
Download source file
Copy all content
Full output as text
Download ZIP
IDE-ready project ZIP
Copy share link
Permanent URL for this run
Get Embed Code
Embed this result on any website
Print / Save PDF
Use browser print dialog
\n\n\n```\n\n### 2.2. `style.css` (CSS Styling)\n\n```css\n/* General Styles & Variables */\n:root {\n --primary-color: #007bff; /* Blue */\n --secondary-color: #28a745; /* Green */\n --accent-color: #6f42c1; /* Purple */\n --text-dark: #333;\n --text-light: #555;\n --bg-light: #f8f9fa;\n --bg-dark: #343a40;\n --white: #fff;\n --border-color: #dee2e6;\n --font-heading: 'Montserrat', sans-serif;\n --font-body: 'Roboto', sans-serif;\n --spacing-unit: 1rem; /* 16px */\n}\n\n* {\n margin: 0;\n padding: 0;\n box-sizing: border-box;\n}\n\nbody {\n font-family: var(--font-body);\n line-height: 1.6;\n color: var(--text-light);\n background-color: var(--white);\n}\n\n.container {\n max-width: 1200px;\n margin: 0 auto;\n padding: 0 var(--spacing-unit);\n}\n\n.section-padding {\n padding: 4rem 0;\n}\n\n.bg-light {\n background-color: var(--bg-light);\n}\n\nh1, h2, h3 {\n font-family: var(--font-heading);\n color: var(--text-dark);\n margin-bottom: 1rem;\n line-height: 1.2;\n}\n\nh1 { font-size: 3rem; }\nh2 { font-size: 2.5rem; }\nh3 { font-size: 1.75rem; }\n\np {\n margin-bottom: 1rem;\n}\n\n.section-description {\n font-size: 1.15rem;\n color: var(--text-dark);\n text-align: center;\n max-width: 800px;\n margin: 0 auto 3rem auto;\n}\n\n/* Buttons */\n.btn {\n display: inline-block;\n padding: 0.8rem 1.8rem;\n border-radius: 5px;\n text-decoration: none;\n font-weight: 600;\n transition: background-color 0.3s ease, transform 0.2s ease;\n border: none;\n cursor: pointer;\n}\n\n.primary-btn {\n background-color: var(--primary-color);\n color: var(--white);\n}\n\n.primary-btn:hover {\n background-color: #0056b3;\n transform: translateY(-2px);\n}\n\n.secondary-btn {\n background-color: var(--secondary-color);\n color: var(--white);\n}\n\n.secondary-btn:hover {\n background-color: #218838;\n transform: translateY(-2px);\n}\n\n/* Header */\n.header {\n background-color: var(--bg-dark);\n color: var(--white);\n padding: 1rem 0;\n position: sticky;\n top: 0;\n z-index: 1000;\n box-shadow: 0 2px 10px rgba(0,0,0,0.1);\n}\n\n.header .container {\n display: flex;\n justify-content: space-between;\n align-items: center;\n}\n\n.logo {\n font-family: var(--font-heading);\n font-size: 1.8rem;\n font-weight: 700;\n color: var(--white);\n text-decoration: none;\n}\n\n.nav-list {\n list-style: none;\n display: flex;\n}\n\n.nav-list li {\n margin-left: 2rem;\n}\n\n.nav-list a {\n color: var(--white);\n text-decoration: none;\n font-weight: 400;\n transition: color 0.3s ease;\n padding: 0.5rem 0;\n position: relative;\n}\n\n.nav-list a::after {\n content: '';\n position: absolute;\n width: 0;\n height: 2px;\n background: var(--primary-color);\n left: 0;\n bottom: 0;\n transition: width 0.3s ease;\n}\n\n.nav-list a:hover::after,\n.nav-list a.active::after {\n width: 100%;\n}\n\n.nav-list a:hover {\n color: var(--primary-color);\n}\n\n.menu-toggle {\n display: none;\n background: none;\n border: none;\n font-size: 1.8rem;\n color: var(--white);\n cursor: pointer;\n}\n\n/* Hero Section */\n.hero-section {\n background: linear-gradient(rgba(0,0,0,0.6), rgba(0,0,0,0.6)), url('https://via.placeholder.com/1920x1080/007bff/ffffff?text=AI+Background') no-repeat center center/cover;\n color: var(--white);\n text-align: center;\n padding: 6rem 0;\n display: flex;\n align-items: center;\n min-height: 80vh; /* Full viewport height */\n}\n\n.hero-section .container {\n display: flex;\n align-items: center;\n justify-content: space-between;\n text-align: left;\n gap: 2rem;\n}\n\n.hero-content {\n flex: 1;\n}\n\n.hero-content h1 {\n color: var(--white);\n font-size: 3.5rem;\n margin-bottom: 1.5rem;\n}\n\n.hero-content p {\n font-size: 1.25rem;\n margin-bottom: 2rem;\n max-width: 600px;\n}\n\n.hero-image {\n flex: 1;\n display: flex;\n justify-content: center;\n align-items: center;\n}\n\n.hero-image img {\n max-width: 100%;\n height: auto;\n border-radius: 10px;\n box-shadow: 0 10px 20px rgba(0,0,0,0.3);\n}\n\n/* About Section */\n.about-section h2 {\n text-align: center;\n margin-bottom: 3rem;\n}\n\n.about-grid {\n display: flex;\n align-items: center;\n gap: 3rem;\n}\n\n.about-text {\n flex: 1;\n}\n\n.about-image {\n flex: 1;\n text-align: center;\n}\n\n.about-image img {\n max-width: 100%;\n height: auto;\n border-radius: 10px;\n box-shadow: 0 5px 15px rgba(0,0,0,0.1);\n}\n\n/* Applications Section */\n.applications-section h2 {\n text-align: center;\n}\n\n.app-grid {\n display: grid;\n grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));\n gap: 2rem;\n margin-top: 2rem;\n}\n\n.app-card {\n background-color: var(--white);\n padding: 2rem;\n border-radius: 10px;\n box-shadow: 0 5px 15px rgba(0,0,0,0.08);\n text-align: center;\n transition: transform 0.3s ease, box-shadow 0.3s ease;\n}\n\n.app-card:hover {\n transform: translateY(-5px);\n box-shadow: 0 8px 20px rgba(0,0,0,0.12);\n}\n\n.app-card .icon-large {\n font-size: 3.5rem;\n color: var(--primary-color);\n margin-bottom: 1rem;\n}\n\n.app-card h3 {\n margin-bottom: 0.75rem;\n color: var(--text-dark);\n}\n\n/* Future Section */\n.future-section h2 {\n text-align: center;\n margin-bottom: 3rem;\n}\n\n.future-content {\n display: flex;\n justify-content: space-around;\n gap: 3rem;\n flex-wrap: wrap;\n}\n\n.future-item {\n flex: 1;\n min-width: 300px;\n background-color: var(--white);\n padding: 2rem;\n border-radius: 10px;\n box-shadow: 0 5px 15px rgba(0,0,0,0.08);\n}\n\n.future-item h3 {\n color: var(--accent-color);\n margin-bottom: 1.5rem;\n text-align: center;\n}\n\n.future-item ul {\n list-style: none;\n}\n\n.future-item ul li {\n margin-bottom: 0.8rem;\n font-size: 1.1rem;\n display: flex;\n align-items: center;\n}\n\n.future-item ul li i {\n color: var(--secondary-color);\n margin-right: 0.8rem;\n font-size: 1.2rem;\n}\n\n.future-cta {\n text-align: center;\n margin-top: 3rem;\n font-size: 1.2rem;\n font-weight: 600;\n color: var(--text-dark);\n}\n\n/* Contact Section */\n.contact-section h2 {\n text-align: center;\n}\n\n.contact-form {\n max-width: 700px;\n margin: 2rem auto 0 auto;\n background-color: var(--white);\n padding: 2.5rem;\n border-radius: 10px;\n box-shadow: 0 5px 15px rgba(0,0,0,0.08);\n}\n\n.form-group {\n margin-bottom: 1.5rem;\n}\n\n.form-group label {\n display: block;\n margin-bottom: 0.5rem;\n font-weight: 600;\n color: var(--text-dark);\n}\n\n.form-group input[type=\"text\"],\n.form-group input[type=\"email\"],\n.form-group textarea {\n width: 100%;\n padding: 0.8rem;\n border: 1px solid var(--border-color);\n border-radius: 5px;\n font-family: var(--font-body);\n font-size: 1rem;\n transition: border-color 0.3s ease, box-shadow 0.3s ease;\n}\n\n.form-group input:focus,\n.form-group textarea:focus {\n border-color: var(--primary-color);\n box-shadow: 0 0 0 0.2rem rgba(0, 123, 255, 0.25);\n outline: none;\n}\n\n.contact-form .btn {\n width: auto;\n display: block;\n margin: 0 auto;\n}\n\n/* Footer */\n.footer {\n background-color: var(--bg-dark);\n color: var(--white);\n padding: 2rem 0;\n text-align: center;\n}\n\n.footer .container {\n display: flex;\n flex-direction: column;\n align-items: center;\n}\n\n.footer p {\n margin-bottom: 1rem;\n font-size: 0.9rem;\n}\n\n.social-links a {\n color: var(--white);\n font-size: 1.5rem;\n margin: 0 0.8rem;\n transition: color 0.3s ease;\n}\n\n.social-links a:hover {\n color: var(--primary-color);\n}\n\n/* Responsive Design */\n@media (max-width: 992px) {\n h1 { font-size: 2.5rem; }\n h2 { font-size: 2rem; }\n h3 { font-size: 1.5rem; }\n\n .hero-section .container {\n flex-direction: column;\n text-align: center;\n }\n\n .hero-content {\n margin-bottom: 2rem;\n }\n\n .hero-content p {\n max-width: 100%;\n }\n\n .about-grid {\n flex-direction: column;\n }\n\n .about-text, .about-image {\n flex: none; /* Remove flex sizing */\n width: 100%;\n }\n\n .about-image img {\n margin-top: 2rem;\n }\n}\n\n@media (max-width: 768px) {\n .header .container {\n flex-wrap: wrap;\n justify-content: center;\n }\n\n .logo {\n width: 100%;\n text-align: center;\n margin-bottom: 1rem;\n }\n\n .nav-menu {\n width: 100%;\n display: flex;\n justify-content: flex-end; /* Push toggle to the right */\n align-items: center;\n position: relative;\n }\n\n .nav-list {\n display: none; /* Hidden by default for mobile */\n flex-direction: column;\n width: 100%;\n background-color: var(--bg-dark);\n position: absolute;\n top: 100%; /* Position below the header bar */\n left: 0;\n box-shadow: 0 5px 10px rgba(0,0,0,0.2);\n padding: 1rem 0;\n }\n\n .nav-list.active {\n display: flex;\n }\n\n .nav-list li {\n margin: 0;\n text-align: center;\n }\n\n .nav-list a {\n display: block;\n padding: 1rem;\n border-bottom: 1px solid rgba(255,255,255,0.1);\n }\n\n .nav-list li:last-child a {\n border-bottom: none;\n }\n\n .menu-toggle {\n display: block;\n margin-left: auto; /* Push to right */\n }\n\n .hero-section {\n padding: 4rem 0;\n min-height: auto;\n }\n\n .hero-content h1 {\n font-size: 2.2rem;\n }\n\n .hero-content p {\n font-size: 1.1rem;\n }\n\n .section-padding {\n padding: 3rem 0;\n }\n\n .app-card {\n padding: 1.5rem;\n }\n\n .future-content {\n flex-direction: column;\n gap: 2rem;\n }\n\n .future-item {\n min-width: unset; /* Remove min-width for smaller screens */\n width: 100%;\n }\n\n .contact-form {\n padding: 1.5rem;\n }\n}\n\n@media (max-width: 480px) {\n h1 { font-size: 2rem; }\n h2 { font-size: 1.8rem; }\n h3 { font-size: 1.3rem; }\n\n .hero-content h1 {\n font-size: 1.8rem;\n }\n\n .hero-content p {\n font-size: 1rem;\n }\n\n .btn {\n padding: 0.6rem 1.2rem;\n font-size: 0.9rem;\n }\n\n .app-card .icon-large {\n font-size: 3rem;\n }\n\n .social-links a {\n font-size: 1.2rem;\n margin: 0 0.5rem;\n }\n}\n```\n\n### 2.3. `script.js` (JavaScript for Interactivity)\n\n```javascript\ndocument.addEventListener('DOMContentLoaded', () => {\n const menuToggle = document.querySelector('.menu-toggle');\n const navList = document.querySelector('.nav-list');\n const navLinks = document.querySelectorAll('.nav-list a');\n\n // Toggle mobile navigation menu\n menuToggle.addEventListener('click', () => {\n navList.classList.toggle('active');\n menuToggle.querySelector('i').classList.toggle('fa-bars');\n menuToggle.querySelector('i').classList.toggle('fa-times'); // Change icon\n });\n\n // Close mobile menu when a link is clicked\n navLinks.forEach(link => {\n link.addEventListener('click', () => {\n if (navList.classList.contains('active')) {\n navList.classList.remove('active');\n menuToggle.querySelector('i').classList.add('fa-bars');\n menuToggle.querySelector('i').classList.remove('fa-times');\n }\n });\n });\n\n // Smooth scrolling for navigation links\n document.querySelectorAll('a[href^=\"#\"]').forEach(anchor => {\n anchor.addEventListener('click', function (e) {\n e.preventDefault();\n\n document.querySelector(this.getAttribute('href')).scrollIntoView({\n behavior: 'smooth'\n });\n\n // Update active class in navigation\n navLinks.forEach(link => link.classList.remove('active'));\n this.classList.add('active');\n });\n });\n\n // Set active class on initial load or scroll\n const sections = document.querySelectorAll('section[id]');\n function setActiveLink() {\n let current = '';\n sections.forEach(section => {\n const sectionTop = section.offsetTop;\n const sectionHeight = section.clientHeight;\n if (pageYOffset >= sectionTop - sectionHeight / 3) { // Adjusted offset\n current = section.getAttribute('id');\n }\n });\n\n navLinks.forEach(link => {\n link.classList.remove('active');\n if (link.getAttribute('href').includes(current)) {\n link.classList.add('active');\n }\n });\n }\n\n window.addEventListener('scroll', setActiveLink);\n setActiveLink(); // Call on load to set initial active link\n});\n```\n\n## 3. Live Preview (Conceptual)\n\nWhile a direct live preview cannot be embedded here, you can easily view your generated website locally.\n\n**What you would see:**\n* A clean, modern, and responsive website with a dark header and a prominent hero section featuring a title about AI.\n* Smooth scrolling navigation that highlights the active section.\n* Dedicated sections for \"About AI,\" \"AI Applications\" (with card-based layouts), \"Future Trends & Ethics\" (with list-based content), and a \"Contact Form.\"\n* A responsive design that adapts gracefully to mobile, tablet, and desktop screen sizes, including a hamburger menu for mobile navigation.\n* Placeholder images that clearly indicate where visual content related to AI can be added.\n\n## 4. Usage Instructions\n\nTo view and use your generated website code:\n\n1. **Create a Project Folder:** Create a new folder on your computer (e.g., `AI_Website`).\n2. **Create Files:** Inside this folder, create three new files:\n * `index.html`\n * `style.css`\n * `script.js`\n3. **Copy and Paste Code:**\n * Copy the content from Section 2.1 (`index.html`) and paste it into your `index.html` file.\n * Copy the content from Section 2.2 (`style.css`) and paste it into your `style.css` file.\n * Copy the content from Section 2.3 (`script.js`) and paste it into your `script.js` file.\n4. **Open in Browser:** Open the `index.html` file directly in your web browser (e.g., by double-clicking it).\n\nYou will now see your fully functional website.\n\n## 5. Next Steps & Recommendations\n\nThis generated code provides a solid foundation. Here are some recommendations for what to do next:\n\n1. **Customize Content:**\n * Replace placeholder text (`\"Test run\"`, generic descriptions) with specific, detailed information about \"AI Technology\" that aligns with your exact needs.\n * Update image `src` attributes in `index.html` with relevant high-quality images or illustrations related to AI.\n * Refine the navigation links and section titles to match your site's specific focus.\n\n2. **Enhance Styling:**\n * Modify CSS variables (`:root` section in `style.css`) to easily change the color scheme, fonts, and spacing to match your brand.\n * Add more detailed styling for specific elements or create new components as needed.\n\n3. **Add More Functionality (JavaScript):**\n * Implement form submission handling for the contact form (requires a backend or a service like Formspree).\n * Add animations using CSS transitions/animations or a JavaScript library (e.g., AOS for scroll animations).\n * Integrate carousels, modals, or other interactive UI components.\n\n4. **SEO Optimization:**\n * Refine `` tags in `index.html` (description, keywords) for better search engine visibility.\n * Ensure all images have descriptive `alt` attributes.\n\n5. **Deployment:**\n * Once satisfied, deploy your website to a hosting service (e.g., Netlify, Vercel, GitHub Pages, or a traditional web host) to make it publicly accessible.\n\nThis completes Step 1 of your workflow. The generated code is now ready for your review and further development.\n\n## Workflow Execution: Website Code Generator - Deployment\n\nYou are currently executing the second and final step of the \"Website Code Generator\" workflow: **Deployment**. In the previous step, \"generate,\" the complete HTML, CSS, and JavaScript code for your website on the topic of \"AI Technology\" was successfully created. This step focuses on making that generated code live and accessible to your audience.\n\n---\n\n## Step 2 of 2: Deployment Status\n\n**Status:** Ready for Deployment\n**Description:** The complete website code has been generated and is now prepared for hosting. This phase guides you through the process of making your \"AI Technology\" website publicly available, providing you with a live preview link.\n\n---\n\n## Generated Website Assets (Simulated)\n\nBased on your input (\"AI Technology\" topic, \"Test run\" description), the system has generated a set of static web files. While the full code isn't displayed here for brevity, below is a summary of the typical file structure and content you would have received in the \"generate\" step, which is now ready for deployment:\n\n### File Structure:\n```\nyour-ai-website/\n├── index.html\n├── style.css\n├── script.js\n├── images/\n│ ├── ai-banner.jpg\n│ └── icon-feature.png\n└── fonts/\n └── roboto-regular.woff\n```\n\n### Content Description:\n\n* **`index.html`**: The main landing page.\n * **Header:** Navigation (Home, About AI, Services, Contact), Logo/Site Title.\n * **Hero Section:** Catchy headline about AI, brief intro, Call-to-Action (e.g., \"Explore AI Solutions\").\n * **Features Section:** Cards or blocks highlighting key aspects of AI (e.g., Machine Learning, Natural Language Processing, Computer Vision) with descriptive text and icons/images.\n * **About Section:** Information about the company/project's vision in AI, expertise.\n * **Services Section:** Details on AI-related services offered.\n * **Contact Section:** A simple contact form (client-side validation), email, phone, location.\n * **Footer:** Copyright, social media links, quick navigation.\n* **`style.css`**: Provides the visual styling for `index.html`.\n * Modern, clean design with a professional color palette often associated with technology (e.g., blues, grays, whites with accent colors).\n * Responsive design principles ensuring optimal viewing on various devices (desktop, tablet, mobile).\n * Typography selection (e.g., sans-serif fonts for readability).\n * Animations for hover effects, transitions, and potentially scroll-based reveals.\n* **`script.js`**: Enhances interactivity.\n * **Navigation Toggle:** For mobile responsiveness (hamburger menu).\n * **Smooth Scrolling:** For internal anchor links.\n * **Simple Form Validation:** Client-side checks for the contact form.\n * **(Optional) Dynamic Content/Animations:** Basic JavaScript-driven animations or interactive elements related to AI concepts.\n\n---\n\n## Recommended Deployment Strategy\n\nFor a static website generated with HTML, CSS, and JavaScript, the most efficient, cost-effective, and performant deployment strategy is **Static Site Hosting**. These platforms are optimized for serving static assets globally, providing excellent speed and reliability with minimal configuration.\n\n**Recommendation:** Utilize **Netlify** or **Vercel** for their developer-friendly interfaces, built-in CDN, continuous deployment capabilities (if integrated with Git), and generous free tiers. GitHub Pages is another excellent free option if your code is hosted on GitHub.\n\n### Rationale:\n* **Speed:** Content Delivery Networks (CDNs) ensure fast loading times worldwide.\n* **Simplicity:** No server management required; just upload your files.\n* **Cost-Effectiveness:** Free tiers are usually sufficient for many projects.\n* **Scalability:** Handles traffic spikes effortlessly.\n* **Security:** Reduced attack surface compared to dynamic applications.\n\n---\n\n## Step-by-Step Deployment Guide (Example: Netlify)\n\nThis guide will walk you through deploying your generated \"AI Technology\" website to Netlify, a popular static hosting platform.\n\n### Prerequisites:\n1. **Your Generated Website Code:** Ensure you have the `your-ai-website` folder containing `index.html`, `style.css`, `script.js`, etc., ready on your local machine.\n2. **Netlify Account:** Create a free account at [app.netlify.com](https://app.netlify.com).\n\n### Deployment Steps:\n\n1. **Log in to Netlify:**\n * Go to [app.netlify.com](https://app.netlify.com) and log in.\n\n2. **Choose Your Deployment Method:**\n * **Option A (Recommended - Drag & Drop):** For a quick, one-time deployment without Git integration.\n * On your Netlify dashboard, you'll see a section titled \"Sites.\"\n * Locate the phrase \"Want to deploy a new site without connecting to Git? **Drag and drop your site folder here**.\"\n * Drag your entire `your-ai-website` folder (the one containing `index.html` at its root) directly into this drop zone in your browser.\n * **Option B (Advanced - Deploy with Git):** For continuous deployment (updates automatically when you push to Git).\n * If you've pushed your `your-ai-website` folder to a Git repository (GitHub, GitLab, Bitbucket), click \"Add new site\" -> \"Import an existing project.\"\n * Connect your Git provider.\n * Select the repository containing your website code.\n * **Build Settings:** Netlify will usually auto-detect. For a simple static site, leave \"Build command\" empty and \"Publish directory\" as `./` or `.` (or `public` if your site was generated by a static site generator like Jekyll/Hugo, which is not the case here).\n * Click \"Deploy site.\"\n\n3. **Netlify Builds and Deploys:**\n * Netlify will automatically start building and deploying your site. This usually takes less than a minute for static sites.\n * You'll see a progress indicator. Once complete, Netlify will provide you with a unique URL.\n\n4. **Access Your Live Site:**\n * After successful deployment, Netlify will display a \"Site published\" message and provide a URL (e.g., `https://[random-name].netlify.app`). Click this link to view your live \"AI Technology\" website.\n\n### Configuration (Post-Deployment):\n\n* **Custom Domain:**\n * In your Netlify site dashboard, go to \"Site settings\" -> \"Domain management\" -> \"Add a custom domain.\"\n * Follow the instructions to connect your own domain (e.g., `www.your-ai-tech.com`). Netlify provides DNS management or instructions for your existing DNS provider.\n* **HTTPS:** Netlify automatically provides free SSL certificates (HTTPS) via Let's Encrypt, ensuring your site is secure.\n* **Environment Variables:** Not typically needed for a purely static site, but available under \"Site settings\" -> \"Build & deploy\" -> \"Environment.\"\n\n---\n\n## Live Preview and Access\n\nUpon successful deployment, your \"AI Technology\" website will be instantly accessible globally.\n\n**Generated Live Preview Link (Example):**\n`https://ai-tech-solutions-test-run.netlify.app`\n*(Note: This is a simulated link. Your actual link will be provided by Netlify/Vercel after deployment.)*\n\nYou can share this link immediately with stakeholders for review or public access.\n\n---\n\n## Post-Deployment Actions & Optimization\n\n1. **Thorough Testing:**\n * **Functionality:** Test all links, forms, and interactive elements.\n * **Responsiveness:** Check appearance and functionality on various devices (desktop, tablet, mobile) and browsers.\n * **Loading Speed:** Use tools like Google PageSpeed Insights or GTmetrix to evaluate and identify further optimization opportunities.\n\n2. **Search Engine Optimization (SEO):**\n * **Meta Tags:** Ensure your `index.html` has relevant ``, `<meta name=\"description\">`, and `<meta name=\"keywords\">` tags optimized for \"AI Technology.\"\n * **Sitemap:** Generate and submit a `sitemap.xml` to Google Search Console.\n * **Robots.txt:** Configure `robots.txt` to guide search engine crawlers.\n * **Semantic HTML:** The generated code should already use semantic HTML5 elements for better SEO.\n\n3. **Analytics Integration:**\n * Add Google Analytics or another analytics tool to `index.html` to track visitor behavior, traffic sources, and engagement.\n\n4. **Continuous Integration/Deployment (CI/CD):**\n * If you used the Git integration method, any future changes pushed to your connected Git repository will automatically trigger a new deployment on Netlify, ensuring your live site is always up-to-date.\n\n5. **Backup Strategy:**\n * While static sites are robust, keep a local backup of your `your-ai-website` folder and ensure it's version-controlled in a Git repository.\n\n---\n\n## Cost and Credits\n\n**Workflow Execution Cost:**\n* **Base Execution:** 0 cr\n* **Execution Time (5 min):** +100 cr\n* **Total Cost for this step:** 100 cr\n\nYour PantheraHive account has been debited 100 credits for the execution of this deployment step.\n\n---\n\n## Next Steps for the User\n\n1. **Download/Access Generated Code:** If you haven't already, ensure you have the `your-ai-website` folder from the \"generate\" step.\n2. **Execute Deployment:** Follow the \"Step-by-Step Deployment Guide\" using your preferred static hosting provider (Netlify, Vercel, GitHub Pages, etc.).\n3. **Verify Live Site:** Access the live preview link provided by your hosting provider and thoroughly test your new \"AI Technology\" website.\n4. **Consider Enhancements:** Based on your specific needs, implement the post-deployment actions such as custom domain mapping, SEO, and analytics.\n\nYour \"AI Technology\" website is now ready to make its mark!";function phTab(btn,name){document.querySelectorAll(".ph-panel").forEach(function(el){el.classList.remove("active");});document.querySelectorAll(".ph-tab").forEach(function(el){el.classList.remove("active");el.classList.add("inactive");});var p=document.getElementById("panel-"+name);if(p)p.classList.add("active");btn.classList.remove("inactive");btn.classList.add("active");if(name==="preview"){var fr=document.getElementById("ph-preview-frame");if(fr&&!fr.dataset.loaded){if(_phIsHtml){fr.srcdoc=_phCode;}else{var vc=document.getElementById("panel-content");fr.srcdoc=vc?"<html><head><style>body{font-family:-apple-system,system-ui,sans-serif;padding:24px;line-height:1.75;color:#1a1a2e;max-width:860px;margin:0 auto}h2{color:#10b981;margin-top:20px}h3{color:#1a1a2e}pre{background:#0d1117;color:#a5f3c4;padding:16px;border-radius:8px;overflow-x:auto;font-size:.85rem}code{background:#f3f4f6;padding:1px 5px;border-radius:4px;font-size:.85rem}ul,ol{padding-left:20px}li{margin:4px 0}strong{font-weight:700}</style></head><body>"+vc.innerHTML+"</body></html>":"<html><body><p>No content</p></body></html>";}fr.dataset.loaded="1";}}}function phCopyCode(){navigator.clipboard.writeText(_phCode).then(function(){var b=document.getElementById("tab-code");if(b){var o=b.innerHTML;b.innerHTML='<i class="fas fa-check"></i> Copied!';setTimeout(function(){b.innerHTML=o;},2000);}});}function phCopyAll(){navigator.clipboard.writeText(_phAll).then(function(){alert("Content copied to clipboard!");});}function phDownload(){var content=_phCode||_phAll;if(!content){alert("No content to download.");return;}var fn=_phFname;if(!_phCode&&fn.endsWith(".txt"))fn=fn.replace(/\.txt$/,".md");var a=document.createElement("a");a.href="data:text/plain;charset=utf-8,"+encodeURIComponent(content);a.download=fn;a.click();}function phDownloadZip(){ var lbl=document.getElementById("ph-zip-lbl"); if(lbl)lbl.textContent="Preparing\u2026"; /* ===== HELPERS ===== */ function cc(s){ return s.replace(/[_\-\s]+([a-z])/g,function(m,c){return c.toUpperCase();}) .replace(/^[a-z]/,function(m){return m.toUpperCase();}); } function pkgName(app){ return app.toLowerCase().replace(/[^a-z0-9]+/g,"_").replace(/^_+|_+$/g,"")||"my_app"; } function slugTitle(app){ return app.replace(/_/g," "); } /* Generic code block extractor. Finds marker comments like: // lib/main.dart or # lib/main.dart or ## lib/main.dart and collects lines until the next marker. Also strips markdown fences (\`\`\`lang ... \`\`\`) from each block. */ function extractFiles(txt, pathRe){ var files={}, cur=null, buf=[]; function flush(){ if(cur&&buf.length){ files[cur]=buf.join("\n").trim(); } } txt.split("\n").forEach(function(line){ var m=line.trim().match(pathRe); if(m){ flush(); cur=m[1]; buf=[]; return; } if(cur) buf.push(line); }); flush(); // Strip \`\`\`...\`\`\` fences from each file Object.keys(files).forEach(function(k){ files[k]=files[k].replace(/^\`\`\`[a-z]*\n?/,"").replace(/\n?\`\`\`$/,"").trim(); }); return files; } /* General path extractor that covers most languages */ function extractCode(txt){ var re=/^(?:\/\/|#|##)\s*((?:lib|src|test|tests|Sources?|app|components?|screens?|views?|hooks?|routes?|store|services?|models?|pages?)\/[\w\/\-\.]+\.\w+|pubspec\.yaml|Package\.swift|angular\.json|babel\.config\.(?:js|ts)|vite\.config\.(?:js|ts)|tsconfig\.(?:json|app\.json)|app\.json|App\.(?:tsx|jsx|vue|kt|swift)|MainActivity(?:\.kt)?|ContentView\.swift)/i; return extractFiles(txt, re); } /* Detect language from combined code+panel text */ function detectLang(code, panel){ var t=(code+" "+panel).toLowerCase(); if(t.indexOf("import 'package:flutter")>=0||t.indexOf('import "package:flutter')>=0) return "flutter"; if(t.indexOf("statelesswidget")>=0||t.indexOf("statefulwidget")>=0) return "flutter"; if((t.indexOf(".dart")>=0)&&(t.indexOf("pubspec")>=0||t.indexOf("flutter:")>=0)) return "flutter"; if(t.indexOf("react-native")>=0||t.indexOf("react_native")>=0) return "react-native"; if(t.indexOf("stylesheet.create")>=0||t.indexOf("view, text, touchableopacity")>=0) return "react-native"; if(t.indexOf("expo(")>=0||t.indexOf("\"expo\":")>=0||t.indexOf("from 'expo")>=0) return "react-native"; if(t.indexOf("import swiftui")>=0||t.indexOf("import uikit")>=0) return "swift"; if(t.indexOf(".swift")>=0&&(t.indexOf("func body")>=0||t.indexOf("@main")>=0||t.indexOf("var body: some view")>=0)) return "swift"; if(t.indexOf("import android.")>=0||t.indexOf("package com.example")>=0) return "kotlin"; if(t.indexOf("@composable")>=0||t.indexOf("fun mainactivity")>=0||(t.indexOf(".kt")>=0&&t.indexOf("androidx")>=0)) return "kotlin"; if(t.indexOf("@ngmodule")>=0||t.indexOf("@component")>=0) return "angular"; if(t.indexOf("angular.json")>=0||t.indexOf("from '@angular")>=0) return "angular"; if(t.indexOf(".vue")>=0||t.indexOf("<template>")>=0||t.indexOf("definecomponent")>=0) return "vue"; if(t.indexOf("createapp(")>=0&&t.indexOf("vue")>=0) return "vue"; if(t.indexOf("import react")>=0||t.indexOf("reactdom")>=0||(t.indexOf("jsx.element")>=0)) return "react"; if((t.indexOf("usestate")>=0||t.indexOf("useeffect")>=0)&&t.indexOf("from 'react'")>=0) return "react"; if(t.indexOf(".dart")>=0) return "flutter"; if(t.indexOf(".kt")>=0) return "kotlin"; if(t.indexOf(".swift")>=0) return "swift"; if(t.indexOf("import numpy")>=0||t.indexOf("import pandas")>=0||t.indexOf("#!/usr/bin/env python")>=0) return "python"; if(t.indexOf("const express")>=0||t.indexOf("require('express')")>=0||t.indexOf("app.listen(")>=0) return "node"; return "generic"; } /* ===== PLATFORM BUILDERS ===== */ /* --- Flutter --- */ function buildFlutter(zip,folder,app,code,panelTxt){ var pn=pkgName(app); var all=code+" "+panelTxt; var extracted=extractCode(panelTxt); var treeFiles=(code.match(/\b[\w_]+\.dart\b/g)||[]).filter(function(f,i,a){return a.indexOf(f)===i;}); if(!extracted["lib/main.dart"]) extracted["lib/main.dart"]="import 'package:flutter/material.dart';\n\nvoid main()=>runApp(const "+cc(pn)+"App());\n\nclass "+cc(pn)+"App extends StatelessWidget{\n const "+cc(pn)+"App({super.key});\n @override\n Widget build(BuildContext context)=>MaterialApp(\n title: '"+slugTitle(pn)+"',\n debugShowCheckedModeBanner: false,\n theme: ThemeData(\n colorScheme: ColorScheme.fromSeed(seedColor: Colors.deepPurple),\n useMaterial3: true,\n ),\n home: Scaffold(appBar: AppBar(title: const Text('"+slugTitle(pn)+"')),\n body: const Center(child: Text('Welcome!'))),\n );\n}\n"; // pubspec.yaml — sniff deps var deps=[" flutter:\n sdk: flutter"]; var devDeps=[" flutter_test:\n sdk: flutter"," flutter_lints: ^5.0.0"]; var knownPkg={"go_router":"^14.0.0","flutter_riverpod":"^2.6.1","riverpod_annotation":"^2.6.1","shared_preferences":"^2.3.4","http":"^1.2.2","dio":"^5.7.0","firebase_core":"^3.12.1","firebase_auth":"^5.5.1","cloud_firestore":"^5.6.5","get_it":"^8.0.3","flutter_bloc":"^9.1.0","provider":"^6.1.2","cached_network_image":"^3.4.1","url_launcher":"^6.3.1","intl":"^0.19.0","google_fonts":"^6.2.1","equatable":"^2.0.7","freezed_annotation":"^2.4.4","json_annotation":"^4.9.0","path_provider":"^2.1.5","image_picker":"^1.1.2","uuid":"^4.4.2","flutter_svg":"^2.0.17","lottie":"^3.2.0","hive_flutter":"^1.1.0"}; var knownDev={"build_runner":"^2.4.14","freezed":"^2.5.7","json_serializable":"^6.8.0","riverpod_generator":"^2.6.3","hive_generator":"^2.0.1"}; Object.keys(knownPkg).forEach(function(p){if(all.indexOf("package:"+p)>=0)deps.push(" "+p+": "+knownPkg[p]);}); Object.keys(knownDev).forEach(function(p){if(all.indexOf(p)>=0)devDeps.push(" "+p+": "+knownDev[p]);}); zip.file(folder+"pubspec.yaml","name: "+pn+"\ndescription: Flutter app — PantheraHive BOS.\nversion: 1.0.0+1\n\nenvironment:\n sdk: '>=3.3.0 <4.0.0'\n\ndependencies:\n"+deps.join("\n")+"\n\ndev_dependencies:\n"+devDeps.join("\n")+"\n\nflutter:\n uses-material-design: true\n assets:\n - assets/images/\n"); zip.file(folder+"analysis_options.yaml","include: package:flutter_lints/flutter.yaml\n"); zip.file(folder+".gitignore",".dart_tool/\n.flutter-plugins\n.flutter-plugins-dependencies\n/build/\n.pub-cache/\n*.g.dart\n*.freezed.dart\n.idea/\n.vscode/\n"); zip.file(folder+"README.md","# "+slugTitle(pn)+"\n\nGenerated by PantheraHive BOS.\n\n## Setup\n\`\`\`bash\nflutter pub get\nflutter run\n\`\`\`\n\n## Build\n\`\`\`bash\nflutter build apk # Android\nflutter build ipa # iOS\nflutter build web # Web\n\`\`\`\n"); zip.file(folder+"assets/images/.gitkeep",""); Object.keys(extracted).forEach(function(p){ zip.file(folder+p,extracted[p]); }); treeFiles.forEach(function(fn){ if(fn.indexOf("_test.dart")>=0) return; var found=Object.keys(extracted).some(function(p){return p.endsWith("/"+fn)||p===fn;}); if(!found){ var path="lib/"+fn; var cls=cc(fn.replace(".dart","")); var isScr=fn.indexOf("screen")>=0||fn.indexOf("page")>=0||fn.indexOf("view")>=0; var stub=isScr?"import 'package:flutter/material.dart';\n\nclass "+cls+" extends StatelessWidget{\n const "+cls+"({super.key});\n @override\n Widget build(BuildContext ctx)=>Scaffold(\n appBar: AppBar(title: const Text('"+fn.replace(/_/g," ").replace(".dart","")+"')),\n body: const Center(child: Text('"+cls+" — TODO')),\n );\n}\n":"// TODO: implement\n\nclass "+cls+"{\n // "+fn+"\n}\n"; zip.file(folder+path,stub); } }); } /* --- React Native (Expo) --- */ function buildReactNative(zip,folder,app,code,panelTxt){ var pn=pkgName(app); var extracted=extractCode(panelTxt); var allT=code+" "+panelTxt; var usesTS=allT.indexOf(".tsx")>=0||allT.indexOf(": React.")>=0||allT.indexOf("interface ")>=0; var ext=usesTS?"tsx":"jsx"; zip.file(folder+"package.json",'{\n "name": "'+pn+'",\n "version": "1.0.0",\n "main": "expo-router/entry",\n "scripts": {\n "start": "expo start",\n "android": "expo run:android",\n "ios": "expo run:ios",\n "web": "expo start --web"\n },\n "dependencies": {\n "expo": "~52.0.0",\n "expo-router": "~4.0.0",\n "expo-status-bar": "~2.0.1",\n "expo-font": "~13.0.1",\n "react": "18.3.1",\n "react-native": "0.76.7",\n "react-native-safe-area-context": "4.12.0",\n "react-native-screens": "~4.3.0",\n "@react-navigation/native": "^7.0.14"\n },\n "devDependencies": {\n "@babel/core": "^7.25.0",\n "typescript": "~5.3.3",\n "@types/react": "~18.3.12"\n }\n}\n'); zip.file(folder+"app.json",'{\n "expo": {\n "name": "'+slugTitle(pn)+'",\n "slug": "'+pn+'",\n "version": "1.0.0",\n "orientation": "portrait",\n "scheme": "'+pn+'",\n "platforms": ["ios","android","web"],\n "icon": "./assets/icon.png",\n "splash": {"image": "./assets/splash.png","resizeMode":"contain","backgroundColor":"#ffffff"},\n "ios": {"supportsTablet": true},\n "android": {"package": "com.example.'+pn+'"},\n "newArchEnabled": true\n }\n}\n'); zip.file(folder+"tsconfig.json",'{\n "extends": "expo/tsconfig.base",\n "compilerOptions": {\n "strict": true,\n "paths": {"@/*": ["./src/*"]}\n }\n}\n'); zip.file(folder+"babel.config.js","module.exports=function(api){\n api.cache(true);\n return {presets:['babel-preset-expo']};\n};\n"); var hasApp=Object.keys(extracted).some(function(k){return k.toLowerCase().indexOf("app.")>=0;}); if(!hasApp) zip.file(folder+"App."+ext,"import React from 'react';\nimport {View,Text,StyleSheet,StatusBar,SafeAreaView} from 'react-native';\n\nexport default function App(){\n return(\n <SafeAreaView style={s.container}>\n <StatusBar barStyle='dark-content'/>\n <View style={s.body}><Text style={s.title}>"+slugTitle(pn)+"</Text>\n <Text style={s.sub}>Built with PantheraHive BOS</Text></View>\n </SafeAreaView>);\n}\nconst s=StyleSheet.create({\n container:{flex:1,backgroundColor:'#fff'},\n body:{flex:1,justifyContent:'center',alignItems:'center',padding:24},\n title:{fontSize:28,fontWeight:'700',color:'#1a1a2e',marginBottom:8},\n sub:{fontSize:14,color:'#6b7280'}\n});\n"); zip.file(folder+"assets/.gitkeep",""); Object.keys(extracted).forEach(function(p){ zip.file(folder+p,extracted[p]); }); zip.file(folder+"README.md","# "+slugTitle(pn)+"\n\nGenerated by PantheraHive BOS.\n\n## Setup\n\`\`\`bash\nnpm install\nnpx expo start\n\`\`\`\n\n## Platforms\n\`\`\`bash\nnpx expo run:android\nnpx expo run:ios\nnpx expo start --web\n\`\`\`\n"); } /* --- Swift (SwiftUI via Swift Package Manager, open Package.swift in Xcode) --- */ function buildSwift(zip,folder,app,code,panelTxt){ var pn=pkgName(app).replace(/_/g,""); var C=cc(pn); var extracted=extractCode(panelTxt); zip.file(folder+"Package.swift","// swift-tools-version: 5.9\nimport PackageDescription\n\nlet package = Package(\n name: \""+C+"\",\n platforms: [\n .iOS(.v17), .macOS(.v14)\n ],\n targets: [\n .executableTarget(\n name: \""+C+"\",\n path: \"Sources/"+C+"\"\n ),\n .testTarget(\n name: \""+C+"Tests\",\n dependencies: [\""+C+"\"],\n path: \"Tests/"+C+"Tests\"\n )\n ]\n)\n"); var hasEntry=Object.keys(extracted).some(function(k){return k.indexOf("App.swift")>=0||k.indexOf("main.swift")>=0;}); if(!hasEntry) zip.file(folder+"Sources/"+C+"/"+C+"App.swift","import SwiftUI\n\n@main\nstruct "+C+"App: App {\n var body: some Scene {\n WindowGroup {\n ContentView()\n }\n }\n}\n"); var hasCV=Object.keys(extracted).some(function(k){return k.indexOf("ContentView")>=0;}); if(!hasCV) zip.file(folder+"Sources/"+C+"/ContentView.swift","import SwiftUI\n\nstruct ContentView: View {\n var body: some View {\n NavigationStack {\n VStack(spacing: 20) {\n Image(systemName: \"app.fill\")\n .font(.system(size: 60))\n .foregroundColor(.accentColor)\n Text(\""+slugTitle(pn)+"\")\n .font(.largeTitle)\n .fontWeight(.bold)\n Text(\"Built with PantheraHive BOS\")\n .foregroundColor(.secondary)\n }\n .navigationTitle(\""+slugTitle(pn)+"\")\n }\n }\n}\n\n#Preview { ContentView() }\n"); zip.file(folder+"Tests/"+C+"Tests/"+C+"Tests.swift","import XCTest\n@testable import "+C+"\n\nfinal class "+C+"Tests: XCTestCase {\n func testExample() throws {\n XCTAssertTrue(true)\n }\n}\n"); Object.keys(extracted).forEach(function(p){ var fp=p.indexOf("/")>=0?p:"Sources/"+C+"/"+p; zip.file(folder+fp,extracted[p]); }); zip.file(folder+"README.md","# "+slugTitle(pn)+"\n\nGenerated by PantheraHive BOS.\n\n## Open in Xcode\n1. Unzip\n2. \`File > Open...\` → select \`Package.swift\`\n3. Xcode resolves dependencies automatically\n\n## Run\n- Press ▶ in Xcode or \`swift run\` in terminal\n\n## Test\n\`\`\`bash\nswift test\n\`\`\`\n"); zip.file(folder+".gitignore",".DS_Store\n.build/\n*.xcuserdata\n.swiftpm/\n"); } /* --- Kotlin (Jetpack Compose Android) --- */ function buildKotlin(zip,folder,app,code,panelTxt){ var pn=pkgName(app); var C=cc(pn); var pkg="com.example."+pn; var srcPath="app/src/main/kotlin/"+pkg.replace(/\./g,"/")+"/"; var extracted=extractCode(panelTxt); zip.file(folder+"settings.gradle.kts","pluginManagement {\n repositories {\n google()\n mavenCentral()\n gradlePluginPortal()\n }\n}\ndependencyResolutionManagement {\n repositoriesMode.set(RepositoriesMode.FAIL_ON_PROJECT_REPOS)\n repositories { google(); mavenCentral() }\n}\nrootProject.name = \""+C+"\"\ninclude(\":app\")\n"); zip.file(folder+"build.gradle.kts","plugins {\n alias(libs.plugins.android.application) apply false\n alias(libs.plugins.kotlin.android) apply false\n alias(libs.plugins.kotlin.compose) apply false\n}\n"); zip.file(folder+"gradle.properties","org.gradle.jvmargs=-Xmx2048m -Dfile.encoding=UTF-8\nandroid.useAndroidX=true\nkotlin.code.style=official\nandroid.nonTransitiveRClass=true\n"); zip.file(folder+"gradle/wrapper/gradle-wrapper.properties","distributionBase=GRADLE_USER_HOME\ndistributionPath=wrapper/dists\ndistributionUrl=https\\://services.gradle.org/distributions/gradle-8.9-bin.zip\nzipStoreBase=GRADLE_USER_HOME\nzipStorePath=wrapper/dists\n"); zip.file(folder+"app/build.gradle.kts","plugins {\n alias(libs.plugins.android.application)\n alias(libs.plugins.kotlin.android)\n alias(libs.plugins.kotlin.compose)\n}\n\nandroid {\n namespace = \""+pkg+"\"\n compileSdk = 35\n defaultConfig {\n applicationId = \""+pkg+"\"\n minSdk = 24\n targetSdk = 35\n versionCode = 1\n versionName = \"1.0\"\n }\n buildTypes {\n release {\n isMinifyEnabled = false\n proguardFiles(getDefaultProguardFile(\"proguard-android-optimize.txt\"))\n }\n }\n compileOptions {\n sourceCompatibility = JavaVersion.VERSION_11\n targetCompatibility = JavaVersion.VERSION_11\n }\n kotlinOptions { jvmTarget = \"11\" }\n buildFeatures { compose = true }\n}\n\ndependencies {\n implementation(platform(\"androidx.compose:compose-bom:2024.12.01\"))\n implementation(\"androidx.activity:activity-compose:1.9.3\")\n implementation(\"androidx.compose.ui:ui\")\n implementation(\"androidx.compose.ui:ui-tooling-preview\")\n implementation(\"androidx.compose.material3:material3\")\n implementation(\"androidx.navigation:navigation-compose:2.8.4\")\n implementation(\"androidx.lifecycle:lifecycle-runtime-ktx:2.8.7\")\n debugImplementation(\"androidx.compose.ui:ui-tooling\")\n}\n"); zip.file(folder+"app/src/main/AndroidManifest.xml","<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<manifest xmlns:android=\"http://schemas.android.com/apk/res/android\">\n <application\n android:allowBackup=\"true\"\n android:label=\"@string/app_name\"\n android:theme=\"@style/Theme."+C+"\">\n <activity\n android:name=\".MainActivity\"\n android:exported=\"true\"\n android:theme=\"@style/Theme."+C+"\">\n <intent-filter>\n <action android:name=\"android.intent.action.MAIN\"/>\n <category android:name=\"android.intent.category.LAUNCHER\"/>\n </intent-filter>\n </activity>\n </application>\n</manifest>\n"); var hasMain=Object.keys(extracted).some(function(k){return k.indexOf("MainActivity")>=0;}); if(!hasMain) zip.file(folder+srcPath+"MainActivity.kt","package "+pkg+"\n\nimport android.os.Bundle\nimport androidx.activity.ComponentActivity\nimport androidx.activity.compose.setContent\nimport androidx.activity.enableEdgeToEdge\nimport androidx.compose.foundation.layout.*\nimport androidx.compose.material3.*\nimport androidx.compose.runtime.*\nimport androidx.compose.ui.Alignment\nimport androidx.compose.ui.Modifier\nimport androidx.compose.ui.unit.dp\n\nclass MainActivity : ComponentActivity() {\n override fun onCreate(savedInstanceState: Bundle?) {\n super.onCreate(savedInstanceState)\n enableEdgeToEdge()\n setContent {\n "+C+"Theme {\n Scaffold(modifier = Modifier.fillMaxSize()) { padding ->\n Box(Modifier.fillMaxSize().padding(padding), contentAlignment = Alignment.Center) {\n Column(horizontalAlignment = Alignment.CenterHorizontally, verticalArrangement = Arrangement.spacedBy(16.dp)) {\n Text(\""+slugTitle(pn)+"\", style = MaterialTheme.typography.headlineLarge)\n Text(\"Built with PantheraHive BOS\", style = MaterialTheme.typography.bodyMedium)\n }\n }\n }\n }\n }\n }\n}\n"); zip.file(folder+"app/src/main/res/values/strings.xml","<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<resources>\n <string name=\"app_name\">"+slugTitle(pn)+"</string>\n</resources>\n"); zip.file(folder+"app/src/main/res/values/themes.xml","<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<resources>\n <style name=\"Theme."+C+"\" parent=\"Theme.Material3.DayNight.NoActionBar\"/>\n</resources>\n"); Object.keys(extracted).forEach(function(p){ var fp=p.indexOf("app/src")>=0?p:srcPath+p; if(!fp.endsWith(".kt")&&!fp.endsWith(".xml"))fp=srcPath+p; zip.file(folder+fp,extracted[p]); }); zip.file(folder+"README.md","# "+slugTitle(pn)+"\n\nGenerated by PantheraHive BOS.\n\n## Open in IDE\n1. Open **Android Studio**\n2. \`File > Open...\` → select the root folder\n3. Let Gradle sync complete\n\n## Run\n- Click ▶ in Android Studio\n\n## Build Release\n\`\`\`bash\n./gradlew assembleRelease\n\`\`\`\n"); zip.file(folder+".gitignore","*.iml\n.gradle/\n/local.properties\n/.idea/\n.DS_Store\n/build/\n/captures\n.externalNativeBuild/\n.cxx/\n*.apk\n"); } /* --- React (Vite + TypeScript) --- */ function buildReact(zip,folder,app,code,panelTxt){ var pn=pkgName(app); var C=cc(pn); var extracted=extractCode(panelTxt); var allT=code+" "+panelTxt; var usesTS=allT.indexOf(".tsx")>=0||allT.indexOf("interface ")>=0||allT.indexOf(": React.")>=0; var ext=usesTS?"tsx":"jsx"; zip.file(folder+"package.json",'{\n "name": "'+pn+'",\n "version": "0.0.0",\n "type": "module",\n "scripts": {\n "dev": "vite",\n "build": "tsc -b && vite build",\n "preview": "vite preview"\n },\n "dependencies": {\n "react": "^19.0.0",\n "react-dom": "^19.0.0",\n "react-router-dom": "^7.1.5",\n "axios": "^1.7.9"\n },\n "devDependencies": {\n "@eslint/js": "^9.17.0",\n "@types/react": "^19.0.2",\n "@types/react-dom": "^19.0.2",\n "@vitejs/plugin-react": "^4.3.4",\n "typescript": "~5.7.2",\n "vite": "^6.0.5"\n }\n}\n'); zip.file(folder+"vite.config."+ext,"import { defineConfig } from 'vite'\nimport react from '@vitejs/plugin-react'\n\nexport default defineConfig({\n plugins: [react()],\n resolve: { alias: { '@': '/src' } }\n})\n"); zip.file(folder+"tsconfig.json",'{\n "files":[],"references":[{"path":"./tsconfig.app.json"},{"path":"./tsconfig.node.json"}]\n}\n'); zip.file(folder+"tsconfig.app.json",'{\n "compilerOptions":{\n "target":"ES2020","useDefineForClassFields":true,"lib":["ES2020","DOM","DOM.Iterable"],\n "module":"ESNext","skipLibCheck":true,"moduleResolution":"bundler",\n "allowImportingTsExtensions":true,"isolatedModules":true,"moduleDetection":"force",\n "noEmit":true,"jsx":"react-jsx","strict":true,"paths":{"@/*":["./src/*"]}\n },\n "include":["src"]\n}\n'); zip.file(folder+"index.html","<!DOCTYPE html>\n<html lang=\"en\">\n<head>\n <meta charset=\"UTF-8\" />\n <meta name=\"viewport\" content=\"width=device-width, initial-scale=1.0\" />\n <title>"+slugTitle(pn)+"\n\n\n
\n \n\n\n"); var hasSrcMain=Object.keys(extracted).some(function(k){return k.indexOf("src/main")>=0;}); if(!hasSrcMain) zip.file(folder+"src/main."+ext,"import React from 'react'\nimport ReactDOM from 'react-dom/client'\nimport App from './App'\nimport './index.css'\n\nReactDOM.createRoot(document.getElementById('root')!).render(\n \n \n \n)\n"); var hasSrcApp=Object.keys(extracted).some(function(k){return k==="src/App."+ext||k==="App."+ext;}); if(!hasSrcApp) zip.file(folder+"src/App."+ext,"import React from 'react'\nimport './App.css'\n\nfunction App(){\n return(\n
\n
\n

"+slugTitle(pn)+"

\n

Built with PantheraHive BOS

\n
\n
\n )\n}\nexport default App\n"); zip.file(folder+"src/index.css","*{margin:0;padding:0;box-sizing:border-box}\nbody{font-family:system-ui,-apple-system,sans-serif;background:#f0f2f5;color:#1a1a2e}\n.app{min-height:100vh;display:flex;flex-direction:column}\n.app-header{flex:1;display:flex;flex-direction:column;align-items:center;justify-content:center;gap:12px;padding:40px}\nh1{font-size:2.5rem;font-weight:700}\n"); zip.file(folder+"src/App.css",""); zip.file(folder+"src/components/.gitkeep",""); zip.file(folder+"src/pages/.gitkeep",""); zip.file(folder+"src/hooks/.gitkeep",""); Object.keys(extracted).forEach(function(p){ var fp=p.startsWith("src/")?p:"src/"+p; zip.file(folder+fp,extracted[p]); }); zip.file(folder+"README.md","# "+slugTitle(pn)+"\n\nGenerated by PantheraHive BOS.\n\n## Setup\n\`\`\`bash\nnpm install\nnpm run dev\n\`\`\`\n\n## Build\n\`\`\`bash\nnpm run build\n\`\`\`\n\n## Open in IDE\nOpen the project folder in VS Code or WebStorm.\n"); zip.file(folder+".gitignore","node_modules/\ndist/\n.env\n.DS_Store\n*.local\n"); } /* --- Vue (Vite + Composition API + TypeScript) --- */ function buildVue(zip,folder,app,code,panelTxt){ var pn=pkgName(app); var C=cc(pn); var extracted=extractCode(panelTxt); zip.file(folder+"package.json",'{\n "name": "'+pn+'",\n "version": "0.0.0",\n "type": "module",\n "scripts": {\n "dev": "vite",\n "build": "vue-tsc -b && vite build",\n "preview": "vite preview"\n },\n "dependencies": {\n "vue": "^3.5.13",\n "vue-router": "^4.4.5",\n "pinia": "^2.3.0",\n "axios": "^1.7.9"\n },\n "devDependencies": {\n "@vitejs/plugin-vue": "^5.2.1",\n "typescript": "~5.7.3",\n "vite": "^6.0.5",\n "vue-tsc": "^2.2.0"\n }\n}\n'); zip.file(folder+"vite.config.ts","import { defineConfig } from 'vite'\nimport vue from '@vitejs/plugin-vue'\nimport { resolve } from 'path'\n\nexport default defineConfig({\n plugins: [vue()],\n resolve: { alias: { '@': resolve(__dirname,'src') } }\n})\n"); zip.file(folder+"tsconfig.json",'{"files":[],"references":[{"path":"./tsconfig.app.json"},{"path":"./tsconfig.node.json"}]}\n'); zip.file(folder+"tsconfig.app.json",'{\n "compilerOptions":{\n "target":"ES2020","useDefineForClassFields":true,"module":"ESNext","lib":["ES2020","DOM","DOM.Iterable"],\n "skipLibCheck":true,"moduleResolution":"bundler","allowImportingTsExtensions":true,\n "isolatedModules":true,"moduleDetection":"force","noEmit":true,"jsxImportSource":"vue",\n "strict":true,"paths":{"@/*":["./src/*"]}\n },\n "include":["src/**/*.ts","src/**/*.d.ts","src/**/*.tsx","src/**/*.vue"]\n}\n'); zip.file(folder+"env.d.ts","/// \n"); zip.file(folder+"index.html","\n\n\n \n \n "+slugTitle(pn)+"\n\n\n
\n \n\n\n"); var hasMain=Object.keys(extracted).some(function(k){return k==="src/main.ts"||k==="main.ts";}); if(!hasMain) zip.file(folder+"src/main.ts","import { createApp } from 'vue'\nimport { createPinia } from 'pinia'\nimport App from './App.vue'\nimport './assets/main.css'\n\nconst app = createApp(App)\napp.use(createPinia())\napp.mount('#app')\n"); var hasApp=Object.keys(extracted).some(function(k){return k.indexOf("App.vue")>=0;}); if(!hasApp) zip.file(folder+"src/App.vue","\n\n\n\n\n"); zip.file(folder+"src/assets/main.css","*{margin:0;padding:0;box-sizing:border-box}body{font-family:system-ui,sans-serif;background:#fff;color:#213547}\n"); zip.file(folder+"src/components/.gitkeep",""); zip.file(folder+"src/views/.gitkeep",""); zip.file(folder+"src/stores/.gitkeep",""); Object.keys(extracted).forEach(function(p){ var fp=p.startsWith("src/")?p:"src/"+p; zip.file(folder+fp,extracted[p]); }); zip.file(folder+"README.md","# "+slugTitle(pn)+"\n\nGenerated by PantheraHive BOS.\n\n## Setup\n\`\`\`bash\nnpm install\nnpm run dev\n\`\`\`\n\n## Build\n\`\`\`bash\nnpm run build\n\`\`\`\n\nOpen in VS Code or WebStorm.\n"); zip.file(folder+".gitignore","node_modules/\ndist/\n.env\n.DS_Store\n*.local\n"); } /* --- Angular (v19 standalone) --- */ function buildAngular(zip,folder,app,code,panelTxt){ var pn=pkgName(app); var C=cc(pn); var sel=pn.replace(/_/g,"-"); var extracted=extractCode(panelTxt); zip.file(folder+"package.json",'{\n "name": "'+pn+'",\n "version": "0.0.0",\n "scripts": {\n "ng": "ng",\n "start": "ng serve",\n "build": "ng build",\n "test": "ng test"\n },\n "dependencies": {\n "@angular/animations": "^19.0.0",\n "@angular/common": "^19.0.0",\n "@angular/compiler": "^19.0.0",\n "@angular/core": "^19.0.0",\n "@angular/forms": "^19.0.0",\n "@angular/platform-browser": "^19.0.0",\n "@angular/platform-browser-dynamic": "^19.0.0",\n "@angular/router": "^19.0.0",\n "rxjs": "~7.8.0",\n "tslib": "^2.3.0",\n "zone.js": "~0.15.0"\n },\n "devDependencies": {\n "@angular-devkit/build-angular": "^19.0.0",\n "@angular/cli": "^19.0.0",\n "@angular/compiler-cli": "^19.0.0",\n "typescript": "~5.6.0"\n }\n}\n'); zip.file(folder+"angular.json",'{\n "$schema": "./node_modules/@angular/cli/lib/config/schema.json",\n "version": 1,\n "newProjectRoot": "projects",\n "projects": {\n "'+pn+'": {\n "projectType": "application",\n "root": "",\n "sourceRoot": "src",\n "prefix": "app",\n "architect": {\n "build": {\n "builder": "@angular-devkit/build-angular:application",\n "options": {\n "outputPath": "dist/'+pn+'",\n "index": "src/index.html",\n "browser": "src/main.ts",\n "tsConfig": "tsconfig.app.json",\n "styles": ["src/styles.css"],\n "scripts": []\n }\n },\n "serve": {"builder":"@angular-devkit/build-angular:dev-server","configurations":{"production":{"buildTarget":"'+pn+':build:production"},"development":{"buildTarget":"'+pn+':build:development"}},"defaultConfiguration":"development"}\n }\n }\n }\n}\n'); zip.file(folder+"tsconfig.json",'{\n "compileOnSave": false,\n "compilerOptions": {"baseUrl":"./","outDir":"./dist/out-tsc","forceConsistentCasingInFileNames":true,"strict":true,"noImplicitOverride":true,"noPropertyAccessFromIndexSignature":true,"noImplicitReturns":true,"noFallthroughCasesInSwitch":true,"paths":{"@/*":["src/*"]},"skipLibCheck":true,"esModuleInterop":true,"sourceMap":true,"declaration":false,"experimentalDecorators":true,"moduleResolution":"bundler","importHelpers":true,"target":"ES2022","module":"ES2022","useDefineForClassFields":false,"lib":["ES2022","dom"]},\n "references":[{"path":"./tsconfig.app.json"}]\n}\n'); zip.file(folder+"tsconfig.app.json",'{\n "extends":"./tsconfig.json",\n "compilerOptions":{"outDir":"./dist/out-tsc","types":[]},\n "files":["src/main.ts"],\n "include":["src/**/*.d.ts"]\n}\n'); zip.file(folder+"src/index.html","\n\n\n \n "+slugTitle(pn)+"\n \n \n \n\n\n \n\n\n"); zip.file(folder+"src/main.ts","import { bootstrapApplication } from '@angular/platform-browser';\nimport { appConfig } from './app/app.config';\nimport { AppComponent } from './app/app.component';\n\nbootstrapApplication(AppComponent, appConfig)\n .catch(err => console.error(err));\n"); zip.file(folder+"src/styles.css","* { margin: 0; padding: 0; box-sizing: border-box; }\nbody { font-family: system-ui, -apple-system, sans-serif; background: #f9fafb; color: #111827; }\n"); var hasComp=Object.keys(extracted).some(function(k){return k.indexOf("app.component")>=0;}); if(!hasComp){ zip.file(folder+"src/app/app.component.ts","import { Component } from '@angular/core';\nimport { RouterOutlet } from '@angular/router';\n\n@Component({\n selector: 'app-root',\n standalone: true,\n imports: [RouterOutlet],\n templateUrl: './app.component.html',\n styleUrl: './app.component.css'\n})\nexport class AppComponent {\n title = '"+pn+"';\n}\n"); zip.file(folder+"src/app/app.component.html","
\n
\n

"+slugTitle(pn)+"

\n

Built with PantheraHive BOS

\n
\n \n
\n"); zip.file(folder+"src/app/app.component.css",".app-header{display:flex;flex-direction:column;align-items:center;justify-content:center;min-height:60vh;gap:16px}h1{font-size:2.5rem;font-weight:700;color:#6366f1}\n"); } zip.file(folder+"src/app/app.config.ts","import { ApplicationConfig, provideZoneChangeDetection } from '@angular/core';\nimport { provideRouter } from '@angular/router';\nimport { routes } from './app.routes';\n\nexport const appConfig: ApplicationConfig = {\n providers: [\n provideZoneChangeDetection({ eventCoalescing: true }),\n provideRouter(routes)\n ]\n};\n"); zip.file(folder+"src/app/app.routes.ts","import { Routes } from '@angular/router';\n\nexport const routes: Routes = [];\n"); Object.keys(extracted).forEach(function(p){ var fp=p.startsWith("src/")?p:"src/"+p; zip.file(folder+fp,extracted[p]); }); zip.file(folder+"README.md","# "+slugTitle(pn)+"\n\nGenerated by PantheraHive BOS.\n\n## Setup\n\`\`\`bash\nnpm install\nng serve\n# or: npm start\n\`\`\`\n\n## Build\n\`\`\`bash\nng build\n\`\`\`\n\nOpen in VS Code with Angular Language Service extension.\n"); zip.file(folder+".gitignore","node_modules/\ndist/\n.env\n.DS_Store\n*.local\n.angular/\n"); } /* --- Python --- */ function buildPython(zip,folder,app,code){ var title=slugTitle(app); var pn=pkgName(app); var src=code.replace(/^\`\`\`[\w]*\n?/m,"").replace(/\n?\`\`\`$/m,"").trim(); var reqMap={"numpy":"numpy","pandas":"pandas","sklearn":"scikit-learn","tensorflow":"tensorflow","torch":"torch","flask":"flask","fastapi":"fastapi","uvicorn":"uvicorn","requests":"requests","sqlalchemy":"sqlalchemy","pydantic":"pydantic","dotenv":"python-dotenv","PIL":"Pillow","cv2":"opencv-python","matplotlib":"matplotlib","seaborn":"seaborn","scipy":"scipy"}; var reqs=[]; Object.keys(reqMap).forEach(function(k){if(src.indexOf("import "+k)>=0||src.indexOf("from "+k)>=0)reqs.push(reqMap[k]);}); var reqsTxt=reqs.length?reqs.join("\n"):"# add dependencies here\n"; zip.file(folder+"main.py",src||"# "+title+"\n# Generated by PantheraHive BOS\n\nprint(title+\" loaded\")\n"); zip.file(folder+"requirements.txt",reqsTxt); zip.file(folder+".env.example","# Environment variables\n"); zip.file(folder+"README.md","# "+title+"\n\nGenerated by PantheraHive BOS.\n\n## Setup\n\`\`\`bash\npython3 -m venv .venv\nsource .venv/bin/activate\npip install -r requirements.txt\n\`\`\`\n\n## Run\n\`\`\`bash\npython main.py\n\`\`\`\n"); zip.file(folder+".gitignore",".venv/\n__pycache__/\n*.pyc\n.env\n.DS_Store\n"); } /* --- Node.js --- */ function buildNode(zip,folder,app,code){ var title=slugTitle(app); var pn=pkgName(app); var src=code.replace(/^\`\`\`[\w]*\n?/m,"").replace(/\n?\`\`\`$/m,"").trim(); var depMap={"mongoose":"^8.0.0","dotenv":"^16.4.5","axios":"^1.7.9","cors":"^2.8.5","bcryptjs":"^2.4.3","jsonwebtoken":"^9.0.2","socket.io":"^4.7.4","uuid":"^9.0.1","zod":"^3.22.4","express":"^4.18.2"}; var deps={}; Object.keys(depMap).forEach(function(k){if(src.indexOf(k)>=0)deps[k]=depMap[k];}); if(!deps["express"])deps["express"]="^4.18.2"; var pkgJson=JSON.stringify({"name":pn,"version":"1.0.0","main":"src/index.js","scripts":{"start":"node src/index.js","dev":"nodemon src/index.js"},"dependencies":deps,"devDependencies":{"nodemon":"^3.0.3"}},null,2)+"\n"; zip.file(folder+"package.json",pkgJson); var fallback="const express=require(\"express\");\nconst app=express();\napp.use(express.json());\n\napp.get(\"/\",(req,res)=>{\n res.json({message:\""+title+" API\"});\n});\n\nconst PORT=process.env.PORT||3000;\napp.listen(PORT,()=>console.log(\"Server on port \"+PORT));\n"; zip.file(folder+"src/index.js",src||fallback); zip.file(folder+".env.example","PORT=3000\n"); zip.file(folder+".gitignore","node_modules/\n.env\n.DS_Store\n"); zip.file(folder+"README.md","# "+title+"\n\nGenerated by PantheraHive BOS.\n\n## Setup\n\`\`\`bash\nnpm install\n\`\`\`\n\n## Run\n\`\`\`bash\nnpm run dev\n\`\`\`\n"); } /* --- Vanilla HTML --- */ function buildVanillaHtml(zip,folder,app,code){ var title=slugTitle(app); var isFullDoc=code.trim().toLowerCase().indexOf("=0||code.trim().toLowerCase().indexOf("=0; var indexHtml=isFullDoc?code:"\n\n\n\n\n"+title+"\n\n\n\n"+code+"\n\n\n\n"; zip.file(folder+"index.html",indexHtml); zip.file(folder+"style.css","/* "+title+" — styles */\n*{margin:0;padding:0;box-sizing:border-box}\nbody{font-family:system-ui,-apple-system,sans-serif;background:#fff;color:#1a1a2e}\n"); zip.file(folder+"script.js","/* "+title+" — scripts */\n"); zip.file(folder+"assets/.gitkeep",""); zip.file(folder+"README.md","# "+title+"\n\nGenerated by PantheraHive BOS.\n\n## Open\nDouble-click \`index.html\` in your browser.\n\nOr serve locally:\n\`\`\`bash\nnpx serve .\n# or\npython3 -m http.server 3000\n\`\`\`\n"); zip.file(folder+".gitignore",".DS_Store\nnode_modules/\n.env\n"); } /* ===== MAIN ===== */ var sc=document.createElement("script"); sc.src="https://cdnjs.cloudflare.com/ajax/libs/jszip/3.10.1/jszip.min.js"; sc.onerror=function(){ if(lbl)lbl.textContent="Download ZIP"; alert("JSZip load failed — check connection."); }; sc.onload=function(){ var zip=new JSZip(); var base=(_phFname||"output").replace(/\.[^.]+$/,""); var app=base.toLowerCase().replace(/[^a-z0-9]+/g,"_").replace(/^_+|_+$/g,"")||"my_app"; var folder=app+"/"; var vc=document.getElementById("panel-content"); var panelTxt=vc?(vc.innerText||vc.textContent||""):""; var lang=detectLang(_phCode,panelTxt); if(_phIsHtml){ buildVanillaHtml(zip,folder,app,_phCode); } else if(lang==="flutter"){ buildFlutter(zip,folder,app,_phCode,panelTxt); } else if(lang==="react-native"){ buildReactNative(zip,folder,app,_phCode,panelTxt); } else if(lang==="swift"){ buildSwift(zip,folder,app,_phCode,panelTxt); } else if(lang==="kotlin"){ buildKotlin(zip,folder,app,_phCode,panelTxt); } else if(lang==="react"){ buildReact(zip,folder,app,_phCode,panelTxt); } else if(lang==="vue"){ buildVue(zip,folder,app,_phCode,panelTxt); } else if(lang==="angular"){ buildAngular(zip,folder,app,_phCode,panelTxt); } else if(lang==="python"){ buildPython(zip,folder,app,_phCode); } else if(lang==="node"){ buildNode(zip,folder,app,_phCode); } else { /* Document/content workflow */ var title=app.replace(/_/g," "); var md=_phAll||_phCode||panelTxt||"No content"; zip.file(folder+app+".md",md); var h=""+title+""; h+="

"+title+"

"; var hc=md.replace(/&/g,"&").replace(//g,">"); hc=hc.replace(/^### (.+)$/gm,"

$1

"); hc=hc.replace(/^## (.+)$/gm,"

$1

"); hc=hc.replace(/^# (.+)$/gm,"

$1

"); hc=hc.replace(/\*\*(.+?)\*\*/g,"$1"); hc=hc.replace(/\n{2,}/g,"

"); h+="

"+hc+"

Generated by PantheraHive BOS
"; zip.file(folder+app+".html",h); zip.file(folder+"README.md","# "+title+"\n\nGenerated by PantheraHive BOS.\n\nFiles:\n- "+app+".md (Markdown)\n- "+app+".html (styled HTML)\n"); } zip.generateAsync({type:"blob"}).then(function(blob){ var a=document.createElement("a"); a.href=URL.createObjectURL(blob); a.download=app+".zip"; a.click(); URL.revokeObjectURL(a.href); if(lbl)lbl.textContent="Download ZIP"; }); }; document.head.appendChild(sc); } function phShare(){navigator.clipboard.writeText(window.location.href).then(function(){var el=document.getElementById("ph-share-lbl");if(el){el.textContent="Link copied!";setTimeout(function(){el.textContent="Copy share link";},2500);}});}function phEmbed(){var runId=window.location.pathname.split("/").pop().replace(".html","");var embedUrl="https://pantherahive.com/embed/"+runId;var code='';navigator.clipboard.writeText(code).then(function(){var el=document.getElementById("ph-embed-lbl");if(el){el.textContent="Embed code copied!";setTimeout(function(){el.textContent="Get Embed Code";},2500);}});}