ai-appbuilder / index.html
S-Dreamer's picture
Update index.html
4096a00 verified
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>AI App Builder | Streamlit & Gradio Integration</title>
<script src="https://cdn.tailwindcss.com"></script>
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.4.0/css/all.min.css">
<style>
.gradient-bg {
background: linear-gradient(135deg, #6e8efb, #a777e3);
}
.code-block {
font-family: 'Courier New', monospace;
background-color: #2d3748;
color: #f7fafc;
border-radius: 0.5rem;
padding: 1rem;
overflow-x: auto;
}
.model-card:hover {
transform: translateY(-5px);
box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
}
.preview-window {
background-color: #f8f9fa;
border: 1px solid #e2e8f0;
border-radius: 0.5rem;
min-height: 300px;
}
.tab-active {
border-bottom: 3px solid #6e8efb;
color: #6e8efb;
font-weight: 600;
}
</style>
</head>
<body class="bg-gray-50">
<!-- Navigation -->
<nav class="gradient-bg text-white shadow-lg">
<div class="container mx-auto px-6 py-4">
<div class="flex items-center justify-between">
<div class="flex items-center space-x-4">
<i class="fas fa-robot text-2xl"></i>
<span class="text-xl font-bold">AI App Builder</span>
</div>
<div class="hidden md:flex items-center space-x-8">
<a href="<a href="about.html class="hover:text-gray-200">Features</a>
<a href="<a href="about.html class="hover:text-gray-200">Templates</a>
<a href="<a href="about.html class="hover:text-gray-200">Documentation</a>
<a href="<a href="about.html class="hover:text-gray-200">Pricing</a>
</div>
<button class="bg-white text-purple-600 px-4 py-2 rounded-md font-medium hover:bg-gray-100 transition">
Get Started
</button>
</div>
</div>
</nav>
<!-- Hero Section -->
<section class="gradient-bg text-white py-20">
<div class="container mx-auto px-6 text-center">
<h1 class="text-4xl md:text-6xl font-bold mb-6">Build AI Apps in Minutes</h1>
<p class="text-xl md:text-2xl mb-8 max-w-3xl mx-auto">
Create stunning Streamlit and Gradio applications with our no-code builder and multi-model AI integration.
</p>
<div class="flex flex-col md:flex-row justify-center gap-4">
<button class="bg-white text-purple-600 px-8 py-3 rounded-md font-bold hover:bg-gray-100 transition">
Start Building <i class="fas fa-arrow-right ml-2"></i>
</button>
<button class="bg-transparent border-2 border-white px-8 py-3 rounded-md font-bold hover:bg-white hover:text-purple-600 transition">
Watch Demo
</button>
</div>
</div>
</section>
<!-- Main App Builder -->
<section class="py-16">
<div class="container mx-auto px-6">
<div class="flex flex-col lg:flex-row gap-8">
<!-- Left Panel - Controls -->
<div class="w-full lg:w-1/3 bg-white rounded-xl shadow-md p-6">
<h2 class="text-2xl font-bold mb-6 text-gray-800">App Configuration</h2>
<!-- Model Selection -->
<div class="mb-8">
<h3 class="text-lg font-semibold mb-4 text-gray-700">Select AI Model</h3>
<div class="grid grid-cols-2 gap-4">
<div class="model-card bg-gray-50 p-4 rounded-lg cursor-pointer transition border border-gray-200 hover:border-purple-300">
<div class="flex items-center mb-2">
<i class="fas fa-brain text-purple-500 mr-2"></i>
<span class="font-medium">GPT-4</span>
</div>
<p class="text-sm text-gray-600">Advanced text generation</p>
</div>
<div class="model-card bg-gray-50 p-4 rounded-lg cursor-pointer transition border border-gray-200 hover:border-purple-300">
<div class="flex items-center mb-2">
<i class="fas fa-eye text-blue-500 mr-2"></i>
<span class="font-medium">DALL·E 3</span>
</div>
<p class="text-sm text-gray-600">Image generation</p>
</div>
<div class="model-card bg-gray-50 p-4 rounded-lg cursor-pointer transition border border-gray-200 hover:border-purple-300">
<div class="flex items-center mb-2">
<i class="fas fa-comments text-green-500 mr-2"></i>
<span class="font-medium">Claude 2</span>
</div>
<p class="text-sm text-gray-600">Conversational AI</p>
</div>
<div class="model-card bg-gray-50 p-4 rounded-lg cursor-pointer transition border border-gray-200 hover:border-purple-300">
<div class="flex items-center mb-2">
<i class="fas fa-microphone text-red-500 mr-2"></i>
<span class="font-medium">Whisper</span>
</div>
<p class="text-sm text-gray-600">Speech recognition</p>
</div>
</div>
</div>
<!-- Framework Selection -->
<div class="mb-8">
<h3 class="text-lg font-semibold mb-4 text-gray-700">App Framework</h3>
<div class="flex space-x-4">
<button id="streamlit-btn" class="framework-btn px-4 py-2 rounded-md bg-purple-100 text-purple-700 font-medium">
<i class="fab fa-python mr-2"></i> Streamlit
</button>
<button id="gradio-btn" class="framework-btn px-4 py-2 rounded-md bg-gray-200 text-gray-700 font-medium">
<i class="fas fa-sliders-h mr-2"></i> Gradio
</button>
</div>
</div>
<!-- Input Components -->
<div class="mb-8">
<h3 class="text-lg font-semibold mb-4 text-gray-700">Input Components</h3>
<div class="grid grid-cols-3 gap-2">
<div class="component-btn p-2 bg-gray-100 rounded text-center cursor-pointer hover:bg-purple-100">
<i class="fas fa-font block text-lg mb-1"></i>
<span class="text-xs">Text</span>
</div>
<div class="component-btn p-2 bg-gray-100 rounded text-center cursor-pointer hover:bg-purple-100">
<i class="fas fa-image block text-lg mb-1"></i>
<span class="text-xs">Image</span>
</div>
<div class="component-btn p-2 bg-gray-100 rounded text-center cursor-pointer hover:bg-purple-100">
<i class="fas fa-file-upload block text-lg mb-1"></i>
<span class="text-xs">File</span>
</div>
<div class="component-btn p-2 bg-gray-100 rounded text-center cursor-pointer hover:bg-purple-100">
<i class="fas fa-sliders-h block text-lg mb-1"></i>
<span class="text-xs">Slider</span>
</div>
<div class="component-btn p-2 bg-gray-100 rounded text-center cursor-pointer hover:bg-purple-100">
<i class="fas fa-check-square block text-lg mb-1"></i>
<span class="text-xs">Checkbox</span>
</div>
<div class="component-btn p-2 bg-gray-100 rounded text-center cursor-pointer hover:bg-purple-100">
<i class="fas fa-microphone block text-lg mb-1"></i>
<span class="text-xs">Audio</span>
</div>
</div>
</div>
<!-- App Settings -->
<div>
<h3 class="text-lg font-semibold mb-4 text-gray-700">App Settings</h3>
<div class="space-y-4">
<div>
<label class="block text-sm font-medium text-gray-700 mb-1">App Title</label>
<input type="text" class="w-full px-3 py-2 border border-gray-300 rounded-md" placeholder="My AI App">
</div>
<div>
<label class="block text-sm font-medium text-gray-700 mb-1">Theme</label>
<select class="w-full px-3 py-2 border border-gray-300 rounded-md">
<option>Light</option>
<option>Dark</option>
<option>Custom</option>
</select>
</div>
<div class="flex items-center">
<input type="checkbox" id="shareable" class="mr-2">
<label for="shareable" class="text-sm text-gray-700">Make shareable</label>
</div>
</div>
</div>
</div>
<!-- Right Panel - Preview and Code -->
<div class="w-full lg:w-2/3">
<!-- Tabs -->
<div class="flex border-b border-gray-200 mb-6">
<button id="preview-tab" class="tab-btn px-4 py-2 font-medium text-gray-600 mr-2 tab-active">Live Preview</button>
<button id="code-tab" class="tab-btn px-4 py-2 font-medium text-gray-600 mr-2">Generated Code</button>
<button id="deploy-tab" class="tab-btn px-4 py-2 font-medium text-gray-600">Deployment</button>
</div>
<!-- Preview Window -->
<div id="preview-content" class="preview-window p-6 mb-6">
<h3 class="text-xl font-bold mb-4 text-gray-800">App Preview</h3>
<div class="bg-white p-6 rounded-lg shadow-sm">
<div class="mb-4">
<label class="block text-sm font-medium text-gray-700 mb-1">Enter your prompt</label>
<textarea class="w-full px-3 py-2 border border-gray-300 rounded-md" rows="3" placeholder="Type something..."></textarea>
</div>
<div class="flex justify-between">
<div class="flex space-x-2">
<button class="px-3 py-1 bg-gray-100 text-gray-700 rounded text-sm">Clear</button>
<button class="px-3 py-1 bg-gray-100 text-gray-700 rounded text-sm">Examples</button>
</div>
<button class="px-4 py-1 bg-purple-600 text-white rounded hover:bg-purple-700">Submit</button>
</div>
</div>
<div class="bg-white p-4 mt-4 rounded-lg shadow-sm">
<div class="flex items-center mb-2">
<div class="w-8 h-8 rounded-full bg-purple-100 flex items-center justify-center mr-2">
<i class="fas fa-robot text-purple-600"></i>
</div>
<span class="font-medium">AI Response</span>
</div>
<div class="text-gray-700">
<p>This is where the AI-generated response will appear. The output will change based on the model you've selected and the input you provide.</p>
</div>
</div>
</div>
<!-- Code Window (Hidden by default) -->
<div id="code-content" class="hidden code-block mb-6">
<div class="flex justify-between items-center mb-4">
<h3 class="text-lg font-medium">Generated Python Code</h3>
<button class="copy-btn px-3 py-1 bg-gray-700 text-white rounded text-sm hover:bg-gray-600">
<i class="fas fa-copy mr-1"></i> Copy
</button>
</div>
<pre id="generated-code">
import streamlit as st
from transformers import pipeline
# Set up the page
st.set_page_config(page_title="My AI App", layout="wide")
st.title("My AI App")
# Initialize the model
@st.cache_resource
def load_model():
return pipeline("text-generation", model="gpt2")
model = load_model()
# User input
user_input = st.text_area("Enter your prompt", placeholder="Type something...")
# Generate response
if st.button("Submit"):
if user_input:
with st.spinner("Generating response..."):
response = model(user_input, max_length=100, num_return_sequences=1)
st.write(response[0]['generated_text'])
else:
st.warning("Please enter a prompt")
</pre>
</div>
<!-- Deployment Window (Hidden by default) -->
<div id="deploy-content" class="hidden bg-white p-6 rounded-lg shadow-sm">
<h3 class="text-xl font-bold mb-4 text-gray-800">Deployment Options</h3>
<div class="grid md:grid-cols-3 gap-6">
<div class="border border-gray-200 rounded-lg p-4 hover:border-purple-300 transition">
<div class="flex items-center mb-3">
<i class="fas fa-cloud text-blue-500 text-xl mr-2"></i>
<h4 class="font-medium">Streamlit Cloud</h4>
</div>
<p class="text-sm text-gray-600 mb-3">Deploy directly to Streamlit's free hosting service.</p>
<button class="w-full py-2 bg-blue-100 text-blue-700 rounded text-sm font-medium hover:bg-blue-200">Deploy</button>
</div>
<div class="border border-gray-200 rounded-lg p-4 hover:border-purple-300 transition">
<div class="flex items-center mb-3">
<i class="fab fa-github text-gray-800 text-xl mr-2"></i>
<h4 class="font-medium">GitHub</h4>
</div>
<p class="text-sm text-gray-600 mb-3">Push to GitHub repository for CI/CD integration.</p>
<button class="w-full py-2 bg-gray-100 text-gray-800 rounded text-sm font-medium hover:bg-gray-200">Export</button>
</div>
<div class="border border-gray-200 rounded-lg p-4 hover:border-purple-300 transition">
<div class="flex items-center mb-3">
<i class="fas fa-download text-purple-500 text-xl mr-2"></i>
<h4 class="font-medium">Download</h4>
</div>
<p class="text-sm text-gray-600 mb-3">Download as Python file to run locally or elsewhere.</p>
<button class="w-full py-2 bg-purple-100 text-purple-700 rounded text-sm font-medium hover:bg-purple-200">Download</button>
</div>
</div>
<div class="mt-6 p-4 bg-yellow-50 rounded-lg border border-yellow-200">
<div class="flex">
<i class="fas fa-info-circle text-yellow-500 mt-1 mr-2"></i>
<div>
<h4 class="font-medium text-yellow-800">Deployment Requirements</h4>
<p class="text-sm text-yellow-700 mt-1">Make sure you have Python 3.7+ installed. For GPU acceleration, ensure proper CUDA setup if using local deployment.</p>
</div>
</div>
</div>
</div>
<!-- Action Buttons -->
<div class="flex justify-end space-x-4 mt-6">
<button class="px-6 py-2 border border-gray-300 rounded-md font-medium text-gray-700 hover:bg-gray-50">
Save Draft
</button>
<button class="px-6 py-2 bg-purple-600 text-white rounded-md font-medium hover:bg-purple-700">
Export App <i class="fas fa-arrow-right ml-1"></i>
</button>
</div>
</div>
</div>
</div>
</section>
<!-- Features Section -->
<section class="py-16 bg-gray-100">
<div class="container mx-auto px-6">
<h2 class="text-3xl font-bold text-center mb-12 text-gray-800">Powerful Features</h2>
<div class="grid md:grid-cols-3 gap-8">
<div class="bg-white p-8 rounded-xl shadow-sm hover:shadow-md transition">
<div class="w-12 h-12 bg-purple-100 rounded-full flex items-center justify-center mb-4">
<i class="fas fa-bolt text-purple-600 text-xl"></i>
</div>
<h3 class="text-xl font-semibold mb-3 text-gray-800">Multi-Model Integration</h3>
<p class="text-gray-600">Seamlessly switch between different AI models including OpenAI, Anthropic, and open-source alternatives.</p>
</div>
<div class="bg-white p-8 rounded-xl shadow-sm hover:shadow-md transition">
<div class="w-12 h-12 bg-blue-100 rounded-full flex items-center justify-center mb-4">
<i class="fas fa-code text-blue-600 text-xl"></i>
</div>
<h3 class="text-xl font-semibold mb-3 text-gray-800">Real-Time Code Generation</h3>
<p class="text-gray-600">Get clean, production-ready Python code for both Streamlit and Gradio frameworks.</p>
</div>
<div class="bg-white p-8 rounded-xl shadow-sm hover:shadow-md transition">
<div class="w-12 h-12 bg-green-100 rounded-full flex items-center justify-center mb-4">
<i class="fas fa-share-alt text-green-600 text-xl"></i>
</div>
<h3 class="text-xl font-semibold mb-3 text-gray-800">One-Click Deployment</h3>
<p class="text-gray-600">Deploy your apps directly to Streamlit Cloud, Hugging Face Spaces, or export to GitHub.</p>
</div>
</div>
</div>
</section>
<!-- Footer -->
<footer class="bg-gray-900 text-white py-12">
<div class="container mx-auto px-6">
<div class="grid md:grid-cols-4 gap-8">
<div>
<h3 class="text-lg font-semibold mb-4">AI App Builder</h3>
<p class="text-gray-400">Build, customize and deploy AI applications in minutes without writing code.</p>
</div>
<div>
<h3 class="text-lg font-semibold mb-4">Resources</h3>
<ul class="space-y-2">
<li><a href="#" class="text-gray-400 hover:text-white">Documentation</a></li>
<li><a href="#" class="text-gray-400 hover:text-white">Tutorials</a></li>
<li><a href="#" class="text-gray-400 hover:text-white">API Reference</a></li>
<li><a href="#" class="text-gray-400 hover:text-white">Community</a></li>
</ul>
</div>
<div>
<h3 class="text-lg font-semibold mb-4">Company</h3>
<ul class="space-y-2">
<li><a href="#" class="text-gray-400 hover:text-white">About</a></li>
<li><a href="#" class="text-gray-400 hover:text-white">Blog</a></li>
<li><a href="#" class="text-gray-400 hover:text-white">Careers</a></li>
<li><a href="#" class="text-gray-400 hover:text-white">Contact</a></li>
</ul>
</div>
<div>
<h3 class="text-lg font-semibold mb-4">Subscribe</h3>
<p class="text-gray-400 mb-4">Get the latest updates and news.</p>
<div class="flex">
<input type="email" placeholder="Your email" class="px-4 py-2 bg-gray-800 text-white rounded-l-md focus:outline-none w-full">
<button class="bg-purple-600 px-4 py-2 rounded-r-md hover:bg-purple-700">
<i class="fas fa-paper-plane"></i>
</button>
</div>
</div>
</div>
<div class="border-t border-gray-800 mt-8 pt-8 flex flex-col md:flex-row justify-between items-center">
<p class="text-gray-400">© 2023 AI App Builder. All rights reserved.</p>
<div class="flex space-x-6 mt-4 md:mt-0">
<a href="#" class="text-gray-400 hover:text-white"><i class="fab fa-twitter"></i></a>
<a href="#" class="text-gray-400 hover:text-white"><i class="fab fa-github"></i></a>
<a href="#" class="text-gray-400 hover:text-white"><i class="fab fa-linkedin"></i></a>
<a href="#" class="text-gray-400 hover:text-white"><i class="fab fa-discord"></i></a>
</div>
</div>
</div>
</footer>
<script>
// Tab switching functionality
const tabs = ['preview', 'code', 'deploy'];
tabs.forEach(tab => {
const btn = document.getElementById(`${tab}-tab`);
const content = document.getElementById(`${tab}-content`);
btn.addEventListener('click', () => {
// Hide all content and remove active class from all tabs
tabs.forEach(t => {
document.getElementById(`${t}-content`).classList.add('hidden');
document.getElementById(`${t}-tab`).classList.remove('tab-active');
});
// Show selected content and add active class to clicked tab
content.classList.remove('hidden');
btn.classList.add('tab-active');
});
});
// Framework selection
const frameworks = ['streamlit', 'gradio'];
frameworks.forEach(framework => {
const btn = document.getElementById(`${framework}-btn`);
btn.addEventListener('click', () => {
// Remove active class from all framework buttons
frameworks.forEach(f => {
document.getElementById(`${f}-btn`).classList.remove('bg-purple-100', 'text-purple-700');
document.getElementById(`${f}-btn`).classList.add('bg-gray-200', 'text-gray-700');
});
// Add active class to clicked framework
btn.classList.remove('bg-gray-200', 'text-gray-700');
btn.classList.add('bg-purple-100', 'text-purple-700');
// Update the generated code based on framework
updateGeneratedCode(framework);
});
});
// Model selection
document.querySelectorAll('.model-card').forEach(card => {
card.addEventListener('click', () => {
// Remove selection from all cards
document.querySelectorAll('.model-card').forEach(c => {
c.classList.remove('border-purple-300', 'bg-purple-50');
});
// Add selection to clicked card
card.classList.add('border-purple-300', 'bg-purple-50');
// Update preview and code based on selected model
updateModelSelection(card.querySelector('span').textContent);
});
});
// Component selection
document.querySelectorAll('.component-btn').forEach(btn => {
btn.addEventListener('click', () => {
// Add component to preview and update code
addComponent(btn.querySelector('span').textContent);
});
});
// Copy code button
document.querySelector('.copy-btn').addEventListener('click', () => {
const code = document.getElementById('generated-code').textContent;
navigator.clipboard.writeText(code);
// Show copied feedback
const btn = document.querySelector('.copy-btn');
const originalText = btn.innerHTML;
btn.innerHTML = '<i class="fas fa-check mr-1"></i> Copied!';
setTimeout(() => {
btn.innerHTML = originalText;
}, 2000);
});
// Helper functions
function updateGeneratedCode(framework) {
const codeElement = document.getElementById('generated-code');
if (framework === 'streamlit') {
codeElement.textContent = `import streamlit as st
from transformers import pipeline
# Set up the page
st.set_page_config(page_title="My AI App", layout="wide")
st.title("My AI App")
# Initialize the model
@st.cache_resource
def load_model():
return pipeline("text-generation", model="gpt2")
model = load_model()
# User input
user_input = st.text_area("Enter your prompt", placeholder="Type something...")
# Generate response
if st.button("Submit"):
if user_input:
with st.spinner("Generating response..."):
response = model(user_input, max_length=100, num_return_sequences=1)
st.write(response[0]['generated_text'])
else:
st.warning("Please enter a prompt")`;
} else {
codeElement.textContent = `import gradio as gr
from transformers import pipeline
# Initialize the model
model = pipeline("text-generation", model="gpt2")
def generate_text(prompt):
if not prompt:
return "Please enter a prompt"
output = model(prompt, max_length=100, num_return_sequences=1)
return output[0]['generated_text']
# Create Gradio interface
demo = gr.Interface(
fn=generate_text,
inputs=gr.Textbox(placeholder="Type something...", label="Input"),
outputs=gr.Textbox(label="Generated Text"),
title="My AI App"
)
demo.launch()`;
}
}
function updateModelSelection(modelName) {
// In a real app, this would update the preview and code based on selected model
console.log(`Model changed to: ${modelName}`);
}
function addComponent(componentType) {
// In a real app, this would add the component to the preview and update code
console.log(`Adding component: ${componentType}`);
}
</script>
<p style="border-radius: 8px; text-align: center; font-size: 12px; color: #fff; margin-top: 16px;position: fixed; left: 8px; bottom: 8px; z-index: 10; background: rgba(0, 0, 0, 0.8); padding: 4px 8px;">Made with <img src="https://enzostvs-deepsite.hf.space/logo.svg" alt="DeepSite Logo" style="width: 16px; height: 16px; vertical-align: middle;display:inline-block;margin-right:3px;filter:brightness(0) invert(1);"><a href="https://enzostvs-deepsite.hf.space" style="color: #fff;text-decoration: underline;" target="_blank" >DeepSite</a> - 🧬 <a href="https://enzostvs-deepsite.hf.space?remix=S-Dreamer/ai-appbuilder" style="color: #fff;text-decoration: underline;" target="_blank" >Remix</a></p></body>
</html>