Website Code Generator
Run ID: 69cbe15461b1021a29a8d1a52026-03-31Web Development
PantheraHive BOS
BOS Dashboard

Workflow Step 1 of 2: Website Code Generation (websitebuildergenerate_site)

Objective: To automatically generate a comprehensive, production-ready set of HTML, CSS, and JavaScript files for your website, complete with a functional, interactive live preview. This foundational code serves as the initial blueprint, designed for immediate review and subsequent customization.


1. Website Blueprint & Core Structure (Initial Generation)

Based on the "Website Code Generator" workflow, and in the absence of specific design inputs at this initial stage, we will generate a robust, professional website structure adhering to modern web standards. This initial output is designed to be highly modular and easily customizable.

Default Professional Website Sections:

* Logo placeholder (text or image)

* Navigation menu (Home, About, Services, Portfolio, Contact, Blog - customizable)

* Call-to-Action (CTA) button

* Compelling headline

* Sub-headline/description

* Primary CTA button

* Background image/video placeholder

* Introduction to your business/brand

* Key values or mission statement

* Team photo/member profile placeholders (optional)

* Grid layout showcasing key offerings

* Icon/image placeholders for each service

* Short descriptions and "Learn More" links

* Showcase of work or product categories

* Image gallery or carousel placeholder

* Slider or grid displaying customer feedback

* Client name and photo placeholders

* Reinforce a key action (e.g., "Get a Quote," "Start Your Project")

* Contact form placeholder (Name, Email, Message)

* Location map placeholder (Google Maps embed)

* Contact details (phone, email, address)

* Copyright information

* Quick links (Privacy Policy, Terms of Service)

* Social media icons (Facebook, Twitter, LinkedIn, Instagram)


2. Detailed Code Generation & Best Practices

The generated code will adhere to industry best practices, ensuring a high-quality, maintainable, and performant website.

2.1. HTML Structure (index.html)

2.2. CSS Styling (style.css or modular CSS)

2.3. JavaScript Functionality (script.js)

* Smooth scrolling for navigation links.

* Responsive navigation toggle (hamburger menu for mobile).

* Basic form validation (client-side placeholders).

* Placeholder for a simple image carousel/slider if a portfolio/testimonial section is included.

2.4. File Structure

The generated output will be organized into a logical folder structure:

text • 220 chars
your-website-name/
├── index.html
├── css/
│   └── style.css
├── js/
│   └── script.js
├── img/
│   └── (placeholder images will be generated here, or instructions for adding your own)
└── README.md (brief instructions)
Sandboxed live preview

3. Live Preview & Initial Review

Immediately upon generation, a live, interactive preview of your new website will be made available.

  • Instant Visualization: See your website come to life in real-time, reflecting the generated code.
  • Responsive Testing: The preview will allow you to simulate different device sizes (desktop, tablet, mobile) to ensure the responsive design functions as intended.
  • Interactive Elements: Test navigation, button clicks, and other JavaScript-driven components directly within the preview.
  • Direct Feedback Loop: This preview is the primary interface for your initial review and to provide feedback for refinements.

4. Deliverables for Step 1

Upon completion of this step, you will receive:

  • A complete index.html file: The main structure of your website.
  • A complete style.css file: All the styling rules for your website.
  • A complete script.js file: All the interactive functionalities.
  • A structured folder containing all assets: Organized for easy deployment and management.
  • A unique URL for your live preview: Accessible instantly for review and testing.
  • A README.md file: Providing basic instructions on how to use and customize the generated code.

5. Next Steps: Customization & Iteration (Leading to Step 2)

This initial generation provides a robust foundation. The next stage (Step 2) will focus on refining and customizing this output to perfectly match your specific brand, content, and functional requirements.

To proceed to Step 2, please review the generated live preview and consider the following:

  • Content: What specific text, images, and videos do you want for each section?
  • Branding: What are your brand colors, fonts, and logo?
  • Specific Features: Are there any unique functionalities or integrations you require?
  • Layout Adjustments: Any specific layout preferences or section reordering?

Please provide your detailed feedback and specific requirements to initiate the refinement process. We are ready to transform this robust template into your unique digital presence.

websitebuilder Output

Website Code Generator: Deployment Ready!

Step 2 of 2: Code Generation & Deployment Readiness

Congratulations! Your complete website code has been successfully generated and is now ready for review, preview, and deployment. We have packaged all the necessary HTML, CSS, and JavaScript files to bring your vision to life.


1. Your Website Code Output

Below you will find the complete, production-ready code for your website. This includes structured HTML, styled CSS, and interactive JavaScript.

1.1. HTML Structure (index.html)

This file contains the foundational structure and content of your website.


<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Your Professional Website</title>
    <link rel="stylesheet" href="style.css">
</head>
<body>
    <header>
        <nav>
            <div class="logo">Your Company Name</div>
            <ul>
                <li><a href="#home">Home</a></li>
                <li><a href="#about">About Us</a></li>
                <li><a href="#services">Services</a></li>
                <li><a href="#contact">Contact</a></li>
            </ul>
        </nav>
        <div class="hero">
            <h1>Welcome to Your Future</h1>
            <p>Innovative solutions for a better tomorrow.</p>
            <a href="#contact" class="btn">Get Started</a>
        </div>
    </header>

    <main>
        <section id="about" class="section-padded">
            <h2>About Us</h2>
            <p>We are a leading provider of cutting-edge solutions, dedicated to excellence and customer satisfaction. Our mission is to empower businesses and individuals through technology.</p>
            <div class="features">
                <div class="feature-item">
                    <h3>Innovation</h3>
                    <p>Driving progress with creative and forward-thinking approaches.</p>
                </div>
                <div class="feature-item">
                    <h3>Quality</h3>
                    <p>Delivering reliable and high-performance products and services.</p>
                </div>
                <div class="feature-item">
                    <h3>Integrity</h3>
                    <p>Operating with transparency, honesty, and ethical standards.</p>
                </div>
            </div>
        </section>

        <section id="services" class="section-alt-bg section-padded">
            <h2>Our Services</h2>
            <div class="service-grid">
                <div class="service-item">
                    <h3>Web Development</h3>
                    <p>Custom website design and development tailored to your needs.</p>
                </div>
                <div class="service-item">
                    <h3>Digital Marketing</h3>
                    <p>Strategies to enhance your online presence and reach your audience.</p>
                </div>
                <div class="service-item">
                    <h3>Consulting</h3>
                    <p>Expert advice to optimize your operations and achieve goals.</p>
                </div>
            </div>
        </section>

        <section id="contact" class="section-padded">
            <h2>Contact Us</h2>
            <p>Have a question or want to start a project? Reach out to us!</p>
            <form id="contactForm">
                <div class="form-group">
                    <label for="name">Name:</label>
                    <input type="text" id="name" name="name" required>
                </div>
                <div class="form-group">
                    <label for="email">Email:</label>
                    <input type="email" id="email" name="email" required>
                </div>
                <div class="form-group">
                    <label for="message">Message:</label>
                    <textarea id="message" name="message" rows="5" required></textarea>
                </div>
                <button type="submit" class="btn">Send Message</button>
            </form>
            <p id="formStatus" style="margin-top: 15px;"></p>
        </section>
    </main>

    <footer>
        <p>&copy; 2023 Your Company Name. All rights reserved.</p>
        <div class="social-links">
            <a href="#" aria-label="Facebook"><img src="placeholder_facebook.png" alt="Facebook"></a>
            <a href="#" aria-label="Twitter"><img src="placeholder_twitter.png" alt="Twitter"></a>
            <a href="#" aria-label="LinkedIn"><img src="placeholder_linkedin.png" alt="LinkedIn"></a>
        </div>
    </footer>

    <script src="script.js"></script>
</body>
</html>

1.2. CSS Styling (style.css)

This file contains all the styling rules to make your website visually appealing and responsive.


/* General Styling */
:root {
    --primary-color: #007bff;
    --secondary-color: #6c757d;
    --dark-color: #343a40;
    --light-color: #f8f9fa;
    --white-color: #ffffff;
    --accent-color: #28a745;
}

body {
    font-family: 'Arial', sans-serif;
    margin: 0;
    line-height: 1.6;
    color: var(--dark-color);
    background-color: var(--light-color);
}

.section-padded {
    padding: 60px 20px;
    max-width: 1200px;
    margin: 0 auto;
}

.section-alt-bg {
    background-color: #e9ecef;
}

h1, h2, h3 {
    color: var(--dark-color);
    margin-bottom: 20px;
    text-align: center;
}

p {
    margin-bottom: 15px;
    text-align: center;
    max-width: 800px;
    margin-left: auto;
    margin-right: auto;
}

a {
    color: var(--primary-color);
    text-decoration: none;
}

a:hover {
    text-decoration: underline;
}

.btn {
    display: inline-block;
    background: var(--primary-color);
    color: var(--white-color);
    padding: 12px 25px;
    border-radius: 5px;
    text-decoration: none;
    transition: background-color 0.3s ease;
    border: none;
    cursor: pointer;
}

.btn:hover {
    background: #0056b3;
    text-decoration: none;
}

/* Header & Navigation */
header {
    background: var(--dark-color);
    color: var(--white-color);
    padding: 20px 0;
    position: relative;
    overflow: hidden; /* For hero content positioning */
}

nav {
    display: flex;
    justify-content: space-between;
    align-items: center;
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

.logo {
    font-size: 1.8em;
    font-weight: bold;
    color: var(--white-color);
}

nav ul {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
}

nav ul li {
    margin-left: 20px;
}

nav ul li a {
    color: var(--white-color);
    font-weight: bold;
    transition: color 0.3s ease;
}

nav ul li a:hover {
    color: var(--primary-color);
    text-decoration: none;
}

.hero {
    text-align: center;
    padding: 100px 20px;
    color: var(--white-color);
}

.hero h1 {
    font-size: 3.5em;
    margin-bottom: 15px;
    color: var(--white-color);
}

.hero p {
    font-size: 1.3em;
    margin-bottom: 30px;
    color: var(--white-color);
}

/* Features Section */
.features {
    display: flex;
    justify-content: space-around;
    flex-wrap: wrap;
    margin-top: 40px;
}

.feature-item {
    flex-basis: 30%;
    text-align: center;
    padding: 20px;
    border-radius: 8px;
    background-color: var(--white-color);
    box-shadow: 0 4px 8px rgba(0,0,0,0.1);
    margin: 15px;
    transition: transform 0.3s ease;
}

.feature-item:hover {
    transform: translateY(-5px);
}

.feature-item h3 {
    color: var(--primary-color);
    margin-top: 0;
}

/* Services Section */
.service-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 30px;
    margin-top: 40px;
}

.service-item {
    background-color: var(--white-color);
    padding: 30px;
    border-radius: 8px;
    box-shadow: 0 4px 8px rgba(0,0,0,0.1);
    text-align: center;
    transition: transform 0.3s ease;
}

.service-item:hover {
    transform: translateY(-5px);
}

.service-item h3 {
    color: var(--primary-color);
    margin-top: 0;
}

/* Contact Form */
#contactForm {
    max-width: 600px;
    margin: 40px auto 0;
    padding: 30px;
    background-color: var(--white-color);
    border-radius: 8px;
    box-shadow: 0 4px 8px rgba(0,0,0,0.1);
}

.form-group {
    margin-bottom: 20px;
    text-align: left;
}

.form-group label {
    display: block;
    margin-bottom: 8px;
    font-weight: bold;
}

.form-group input[type="text"],
.form-group input[type="email"],
.form-group textarea {
    width: 100%;
    padding: 12px;
    border: 1px solid #ced4da;
    border-radius: 5px;
    font-size: 1em;
    box-sizing: border-box; /* Include padding in width */
}

.form-group textarea {
    resize: vertical;
}

#contactForm .btn {
    width: 100%;
    padding: 15px;
    font-size: 1.1em;
}

/* Footer */
footer {
    background: var(--dark-color);
    color: var(--white-color);
    text-align: center;
    padding: 30px 20px;
    margin-top: 50px;
}

footer p {
    margin-bottom: 15px;
    color: var(--white-color);
}

.social-links a {
    display: inline-block;
    margin: 0 10px;
}

.social-links img {
    width: 30px;
    height: 30px;
    border-radius: 50%;
    transition: transform 0.3s ease;
}

.social-links img:hover {
    transform: scale(1.1);
}

/* Responsive Design */
@media (max-width: 768px) {
    nav {
        flex-direction: column;
    }

    nav ul {
        margin-top: 15px;
        flex-wrap: wrap;
        justify-content: center;
    }

    nav ul li {
        margin: 0 10px 10px 10px;
    }

    .hero h1 {
        font-size: 2.5em;
    }

    .hero p {
        font-size: 1.1em;
    }

    .features {
        flex-direction: column;
        align-items: center;
    }

    .feature-item {
        flex-basis: 90%;
        margin: 15px 0;
    }

    .service-grid {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 480px) {
    .hero h1 {
        font-size: 2em;
    }

    .section-padded {
        padding: 40px 15px;
    }
}

1.3. JavaScript Interactivity (script.js)

This file adds dynamic behavior and interactivity to your website.


document.addEventListener('DOMContentLoaded', () => {
    // Smooth scrolling for navigation links
    document.querySelectorAll('nav ul li a').forEach(anchor => {
        anchor.addEventListener('click', function (e) {
            e.preventDefault();

            const targetId = this.getAttribute('href').substring(1);
            const targetElement = document.getElementById(targetId);

            if (targetElement) {
                window.scrollTo({
                    top: targetElement.offsetTop - (document.querySelector('nav').offsetHeight || 0), // Adjust for fixed header if any
                    behavior: 'smooth'
                });
            }
        });
    });

    // Handle contact form submission
    const contactForm = document.getElementById('contactForm');
    const formStatus = document.getElementById('formStatus');

    if (contactForm) {
        contactForm.addEventListener('submit', async (e) => {
            e.preventDefault(); // Prevent default form submission

            formStatus.textContent = 'Sending message...';
            formStatus.style.color = 'orange';

            const formData = new FormData(contactForm);
            const data = Object.fromEntries(formData.entries());

            // Simulate API call
            try {
                // In a real application, you would send this 'data' to a backend server
                // Example: const response = await fetch('/api/contact', {
                //     method: 'POST',
                //     headers: {
                //         'Content-Type': 'application/json'
                //     },
                //     body: JSON.stringify(data)
                // });
                // const result = await response.json();

                // For demonstration, we'll just wait a bit and show success/failure

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#### 1.2. CSS Styling (`style.css`)\n\nThis file contains all the styling rules to make your website visually appealing and responsive.\n\n```css\n/* General Styling */\n:root {\n --primary-color: #007bff;\n --secondary-color: #6c757d;\n --dark-color: #343a40;\n --light-color: #f8f9fa;\n --white-color: #ffffff;\n --accent-color: #28a745;\n}\n\nbody {\n font-family: 'Arial', sans-serif;\n margin: 0;\n line-height: 1.6;\n color: var(--dark-color);\n background-color: var(--light-color);\n}\n\n.section-padded {\n padding: 60px 20px;\n max-width: 1200px;\n margin: 0 auto;\n}\n\n.section-alt-bg {\n background-color: #e9ecef;\n}\n\nh1, h2, h3 {\n color: var(--dark-color);\n margin-bottom: 20px;\n text-align: center;\n}\n\np {\n margin-bottom: 15px;\n text-align: center;\n max-width: 800px;\n margin-left: auto;\n margin-right: auto;\n}\n\na {\n color: var(--primary-color);\n text-decoration: none;\n}\n\na:hover {\n text-decoration: underline;\n}\n\n.btn {\n display: inline-block;\n background: var(--primary-color);\n color: var(--white-color);\n padding: 12px 25px;\n border-radius: 5px;\n text-decoration: none;\n transition: background-color 0.3s ease;\n border: none;\n cursor: pointer;\n}\n\n.btn:hover {\n background: #0056b3;\n text-decoration: none;\n}\n\n/* Header & Navigation */\nheader {\n background: var(--dark-color);\n color: var(--white-color);\n padding: 20px 0;\n position: relative;\n overflow: hidden; /* For hero content positioning */\n}\n\nnav {\n display: flex;\n justify-content: space-between;\n align-items: center;\n max-width: 1200px;\n margin: 0 auto;\n padding: 0 20px;\n}\n\n.logo {\n font-size: 1.8em;\n font-weight: bold;\n color: var(--white-color);\n}\n\nnav ul {\n list-style: none;\n margin: 0;\n padding: 0;\n display: flex;\n}\n\nnav ul li {\n margin-left: 20px;\n}\n\nnav ul li a {\n color: var(--white-color);\n font-weight: bold;\n transition: color 0.3s ease;\n}\n\nnav ul li a:hover {\n color: var(--primary-color);\n text-decoration: none;\n}\n\n.hero {\n text-align: center;\n padding: 100px 20px;\n color: var(--white-color);\n}\n\n.hero h1 {\n font-size: 3.5em;\n margin-bottom: 15px;\n color: var(--white-color);\n}\n\n.hero p {\n font-size: 1.3em;\n margin-bottom: 30px;\n color: var(--white-color);\n}\n\n/* Features Section */\n.features {\n display: flex;\n justify-content: space-around;\n flex-wrap: wrap;\n margin-top: 40px;\n}\n\n.feature-item {\n flex-basis: 30%;\n text-align: center;\n padding: 20px;\n border-radius: 8px;\n background-color: var(--white-color);\n box-shadow: 0 4px 8px rgba(0,0,0,0.1);\n margin: 15px;\n transition: transform 0.3s ease;\n}\n\n.feature-item:hover {\n transform: translateY(-5px);\n}\n\n.feature-item h3 {\n color: var(--primary-color);\n margin-top: 0;\n}\n\n/* Services Section */\n.service-grid {\n display: grid;\n grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));\n gap: 30px;\n margin-top: 40px;\n}\n\n.service-item {\n background-color: var(--white-color);\n padding: 30px;\n border-radius: 8px;\n box-shadow: 0 4px 8px rgba(0,0,0,0.1);\n text-align: center;\n transition: transform 0.3s ease;\n}\n\n.service-item:hover {\n transform: translateY(-5px);\n}\n\n.service-item h3 {\n color: var(--primary-color);\n margin-top: 0;\n}\n\n/* Contact Form */\n#contactForm {\n max-width: 600px;\n margin: 40px auto 0;\n padding: 30px;\n background-color: var(--white-color);\n border-radius: 8px;\n box-shadow: 0 4px 8px rgba(0,0,0,0.1);\n}\n\n.form-group {\n margin-bottom: 20px;\n text-align: left;\n}\n\n.form-group label {\n display: block;\n margin-bottom: 8px;\n font-weight: bold;\n}\n\n.form-group input[type=\"text\"],\n.form-group input[type=\"email\"],\n.form-group textarea {\n width: 100%;\n padding: 12px;\n border: 1px solid #ced4da;\n border-radius: 5px;\n font-size: 1em;\n box-sizing: border-box; /* Include padding in width */\n}\n\n.form-group textarea {\n resize: vertical;\n}\n\n#contactForm .btn {\n width: 100%;\n padding: 15px;\n font-size: 1.1em;\n}\n\n/* Footer */\nfooter {\n background: var(--dark-color);\n color: var(--white-color);\n text-align: center;\n padding: 30px 20px;\n margin-top: 50px;\n}\n\nfooter p {\n margin-bottom: 15px;\n color: var(--white-color);\n}\n\n.social-links a {\n display: inline-block;\n margin: 0 10px;\n}\n\n.social-links img {\n width: 30px;\n height: 30px;\n border-radius: 50%;\n transition: transform 0.3s ease;\n}\n\n.social-links img:hover {\n transform: scale(1.1);\n}\n\n/* Responsive Design */\n@media (max-width: 768px) {\n nav {\n flex-direction: column;\n }\n\n nav ul {\n margin-top: 15px;\n flex-wrap: wrap;\n justify-content: center;\n }\n\n nav ul li {\n margin: 0 10px 10px 10px;\n }\n\n .hero h1 {\n font-size: 2.5em;\n }\n\n .hero p {\n font-size: 1.1em;\n }\n\n .features {\n flex-direction: column;\n align-items: center;\n }\n\n .feature-item {\n flex-basis: 90%;\n margin: 15px 0;\n }\n\n .service-grid {\n grid-template-columns: 1fr;\n }\n}\n\n@media (max-width: 480px) {\n .hero h1 {\n font-size: 2em;\n }\n\n .section-padded {\n padding: 40px 15px;\n }\n}\n```\n\n#### 1.3. JavaScript Interactivity (`script.js`)\n\nThis file adds dynamic behavior and interactivity to your website.\n\n```javascript\ndocument.addEventListener('DOMContentLoaded', () => {\n // Smooth scrolling for navigation links\n document.querySelectorAll('nav ul li a').forEach(anchor => {\n anchor.addEventListener('click', function (e) {\n e.preventDefault();\n\n const targetId = this.getAttribute('href').substring(1);\n const targetElement = document.getElementById(targetId);\n\n if (targetElement) {\n window.scrollTo({\n top: targetElement.offsetTop - (document.querySelector('nav').offsetHeight || 0), // Adjust for fixed header if any\n behavior: 'smooth'\n });\n }\n });\n });\n\n // Handle contact form submission\n const contactForm = document.getElementById('contactForm');\n const formStatus = document.getElementById('formStatus');\n\n if (contactForm) {\n contactForm.addEventListener('submit', async (e) => {\n e.preventDefault(); // Prevent default form submission\n\n formStatus.textContent = 'Sending message...';\n formStatus.style.color = 'orange';\n\n const formData = new FormData(contactForm);\n const data = Object.fromEntries(formData.entries());\n\n // Simulate API call\n try {\n // In a real application, you would send this 'data' to a backend server\n // Example: const response = await fetch('/api/contact', {\n // method: 'POST',\n // headers: {\n // 'Content-Type': 'application/json'\n // },\n // body: JSON.stringify(data)\n // });\n // const result = await response.json();\n\n // For demonstration, we'll just wait a bit and show success/failure\n";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?""+vc.innerHTML+"":"

No content

";}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=' 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("