nextnocode / index.html
MarcRyan's picture
Add 3 files
3b42511 verified
Raw History Blame Contribute Delete
24.4 kB
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>NextNoCode - AI-Powered No-Code Platform</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>
@keyframes float {
0%, 100% { transform: translateY(0); }
50% { transform: translateY(-10px); }
}
.floating {
animation: float 3s ease-in-out infinite;
}
.typewriter {
overflow: hidden;
border-right: .15em solid #3b82f6;
white-space: nowrap;
letter-spacing: .15em;
animation:
typing 3.5s steps(40, end),
blink-caret .75s step-end infinite;
}
@keyframes typing {
from { width: 0 }
to { width: 100% }
}
@keyframes blink-caret {
from, to { border-color: transparent }
50% { border-color: #3b82f6; }
}
.gradient-bg {
background: linear-gradient(135deg, #f0f9ff 0%, #e0f2fe 100%);
}
.editor-container {
height: calc(100vh - 200px);
}
.component:hover {
box-shadow: 0 0 0 2px #3b82f6;
}
.react-flow__node.selected .component {
box-shadow: 0 0 0 2px #3b82f6;
}
</style>
</head>
<body class="gradient-bg min-h-screen font-sans">
<!-- Navigation -->
<nav class="bg-white shadow-lg">
<div class="max-w-7xl mx-auto px-4 sm:px-6 lg:px-8">
<div class="flex justify-between h-16">
<div class="flex items-center">
<div class="flex-shrink-0 flex items-center">
<i class="fas fa-magic text-blue-500 text-2xl mr-2"></i>
<span class="text-xl font-bold text-gray-900">NextNoCode</span>
</div>
<div class="hidden sm:ml-6 sm:flex sm:space-x-8">
<a href="#" class="border-blue-500 text-gray-900 inline-flex items-center px-1 pt-1 border-b-2 text-sm font-medium">
Dashboard
</a>
<a href="#" class="border-transparent text-gray-500 hover:border-gray-300 hover:text-gray-700 inline-flex items-center px-1 pt-1 border-b-2 text-sm font-medium">
Templates
</a>
<a href="#" class="border-transparent text-gray-500 hover:border-gray-300 hover:text-gray-700 inline-flex items-center px-1 pt-1 border-b-2 text-sm font-medium">
Marketplace
</a>
<a href="#" class="border-transparent text-gray-500 hover:border-gray-300 hover:text-gray-700 inline-flex items-center px-1 pt-1 border-b-2 text-sm font-medium">
Docs
</a>
</div>
</div>
<div class="hidden sm:ml-6 sm:flex sm:items-center">
<button class="bg-blue-500 hover:bg-blue-600 text-white px-4 py-2 rounded-md text-sm font-medium flex items-center">
<i class="fas fa-rocket mr-2"></i> Publish
</button>
<div class="ml-3 relative">
<div>
<button type="button" class="bg-gray-800 flex text-sm rounded-full focus:outline-none focus:ring-2 focus:ring-offset-2 focus:ring-offset-gray-800 focus:ring-white" id="user-menu-button" aria-expanded="false" aria-haspopup="true">
<span class="sr-only">Open user menu</span>
<img class="h-8 w-8 rounded-full" src="https://images.unsplash.com/photo-1472099645785-5658abf4ff4e?ixlib=rb-1.2.1&ixid=eyJhcHBfaWQiOjEyMDd9&auto=format&fit=facearea&facepad=2&w=256&h=256&q=80" alt="">
</button>
</div>
</div>
</div>
<div class="-mr-2 flex items-center sm:hidden">
<button type="button" class="inline-flex items-center justify-center p-2 rounded-md text-gray-400 hover:text-gray-500 hover:bg-gray-100 focus:outline-none focus:ring-2 focus:ring-inset focus:ring-blue-500" aria-controls="mobile-menu" aria-expanded="false">
<span class="sr-only">Open main menu</span>
<i class="fas fa-bars"></i>
</button>
</div>
</div>
</div>
</nav>
<!-- Main Editor Area -->
<div class="flex h-screen pt-16">
<!-- Left Sidebar - Components -->
<div class="w-64 bg-white border-r border-gray-200 overflow-y-auto">
<div class="p-4">
<h3 class="text-lg font-medium text-gray-900 mb-4">Components</h3>
<div class="space-y-2">
<div class="component p-3 border border-gray-200 rounded-md cursor-move bg-gray-50" draggable="true" data-type="heading">
<i class="fas fa-heading text-blue-500 mr-2"></i> Heading
</div>
<div class="component p-3 border border-gray-200 rounded-md cursor-move bg-gray-50" draggable="true" data-type="paragraph">
<i class="fas fa-paragraph text-blue-500 mr-2"></i> Paragraph
</div>
<div class="component p-3 border border-gray-200 rounded-md cursor-move bg-gray-50" draggable="true" data-type="button">
<i class="fas fa-square text-blue-500 mr-2"></i> Button
</div>
<div class="component p-3 border border-gray-200 rounded-md cursor-move bg-gray-50" draggable="true" data-type="image">
<i class="fas fa-image text-blue-500 mr-2"></i> Image
</div>
<div class="component p-3 border border-gray-200 rounded-md cursor-move bg-gray-50" draggable="true" data-type="form">
<i class="fas fa-list text-blue-500 mr-2"></i> Form
</div>
<div class="component p-3 border border-gray-200 rounded-md cursor-move bg-gray-50" draggable="true" data-type="video">
<i class="fas fa-video text-blue-500 mr-2"></i> Video
</div>
</div>
<h3 class="text-lg font-medium text-gray-900 mt-6 mb-4">Layout</h3>
<div class="space-y-2">
<div class="component p-3 border border-gray-200 rounded-md cursor-move bg-gray-50" draggable="true" data-type="container">
<i class="fas fa-square-full text-blue-500 mr-2"></i> Container
</div>
<div class="component p-3 border border-gray-200 rounded-md cursor-move bg-gray-50" draggable="true" data-type="grid">
<i class="fas fa-th text-blue-500 mr-2"></i> Grid
</div>
<div class="component p-3 border border-gray-200 rounded-md cursor-move bg-gray-50" draggable="true" data-type="section">
<i class="fas fa-border-all text-blue-500 mr-2"></i> Section
</div>
</div>
</div>
</div>
<!-- Main Canvas -->
<div class="flex-1 overflow-auto editor-container">
<div class="p-8">
<div id="canvas" class="bg-white rounded-lg shadow-md p-6 mx-auto" style="width: 100%; min-height: 500px;">
<!-- This is where components will be dropped -->
<div class="text-center text-gray-400 py-20 empty-canvas">
<i class="fas fa-magic text-4xl mb-4"></i>
<p>Drag components here or describe what you want to build</p>
</div>
</div>
</div>
</div>
<!-- Right Sidebar - Properties -->
<div class="w-80 bg-white border-l border-gray-200 overflow-y-auto">
<div class="p-4">
<h3 class="text-lg font-medium text-gray-900 mb-4">Properties</h3>
<div id="properties-panel" class="space-y-4">
<div class="text-gray-500 text-center py-10">
<i class="fas fa-cube text-3xl mb-2"></i>
<p>Select a component to edit its properties</p>
</div>
</div>
<div class="mt-8">
<h3 class="text-lg font-medium text-gray-900 mb-4">AI Assistant</h3>
<div class="bg-blue-50 p-4 rounded-lg">
<div class="flex items-start mb-4">
<div class="flex-shrink-0">
<i class="fas fa-robot text-blue-500 text-xl"></i>
</div>
<div class="ml-3">
<p class="text-sm text-gray-700">Hi! I'm your AI assistant. Describe what you want to build and I'll help you create it.</p>
</div>
</div>
<textarea class="w-full border border-gray-300 rounded-md p-2 text-sm" rows="3" placeholder="Describe your website/app (e.g., 'Create a landing page for a SaaS product')"></textarea>
<button class="mt-2 bg-blue-500 hover:bg-blue-600 text-white px-3 py-1 rounded-md text-sm font-medium">
Generate
</button>
</div>
</div>
</div>
</div>
</div>
<!-- Preview/Code View Toggle -->
<div class="fixed bottom-4 right-4 flex space-x-2">
<button class="bg-white hover:bg-gray-100 text-gray-800 font-semibold py-2 px-4 border border-gray-400 rounded shadow flex items-center">
<i class="fas fa-eye mr-2"></i> Preview
</button>
<button class="bg-white hover:bg-gray-100 text-gray-800 font-semibold py-2 px-4 border border-gray-400 rounded shadow flex items-center">
<i class="fas fa-code mr-2"></i> Code
</button>
<button class="bg-blue-500 hover:bg-blue-600 text-white font-semibold py-2 px-4 border border-blue-700 rounded shadow flex items-center">
<i class="fas fa-rocket mr-2"></i> Publish
</button>
</div>
<script>
document.addEventListener('DOMContentLoaded', function() {
const canvas = document.getElementById('canvas');
const emptyCanvas = document.querySelector('.empty-canvas');
const propertiesPanel = document.getElementById('properties-panel');
// Handle drag and drop for components
document.querySelectorAll('.component').forEach(component => {
component.addEventListener('dragstart', function(e) {
e.dataTransfer.setData('text/plain', this.dataset.type);
});
});
canvas.addEventListener('dragover', function(e) {
e.preventDefault();
this.style.backgroundColor = '#f0f9ff';
});
canvas.addEventListener('dragleave', function() {
this.style.backgroundColor = '';
});
canvas.addEventListener('drop', function(e) {
e.preventDefault();
this.style.backgroundColor = '';
const componentType = e.dataTransfer.getData('text/plain');
addComponentToCanvas(componentType, e.clientX, e.clientY);
if (emptyCanvas) {
emptyCanvas.style.display = 'none';
}
});
function addComponentToCanvas(type, x, y) {
const component = document.createElement('div');
component.className = 'component p-4 border border-gray-200 rounded-md bg-white mb-4 relative';
component.dataset.type = type;
// Position the component near the drop location
const rect = canvas.getBoundingClientRect();
const relativeX = x - rect.left - 20;
const relativeY = y - rect.top - 20;
component.style.position = 'absolute';
component.style.left = `${relativeX}px`;
component.style.top = `${relativeY}px`;
// Add delete button
const deleteBtn = document.createElement('button');
deleteBtn.className = 'absolute top-1 right-1 text-gray-400 hover:text-red-500';
deleteBtn.innerHTML = '<i class="fas fa-times"></i>';
deleteBtn.onclick = function() {
component.remove();
if (canvas.querySelectorAll('.component').length === 0) {
emptyCanvas.style.display = 'block';
}
};
// Add component content based on type
switch(type) {
case 'heading':
component.innerHTML = '<h2 class="text-xl font-bold">Heading</h2>';
break;
case 'paragraph':
component.innerHTML = '<p>This is a paragraph of text. You can edit it by clicking here.</p>';
break;
case 'button':
component.innerHTML = '<button class="bg-blue-500 hover:bg-blue-600 text-white px-4 py-2 rounded">Button</button>';
break;
case 'image':
component.innerHTML = '<div class="bg-gray-200 w-full h-32 flex items-center justify-center"><i class="fas fa-image text-gray-400 text-2xl"></i></div>';
break;
case 'form':
component.innerHTML = `
<div class="space-y-3">
<input type="text" class="w-full border border-gray-300 rounded p-2" placeholder="Name">
<input type="email" class="w-full border border-gray-300 rounded p-2" placeholder="Email">
<button class="bg-blue-500 hover:bg-blue-600 text-white px-4 py-2 rounded">Submit</button>
</div>
`;
break;
case 'container':
component.innerHTML = '<div class="border-2 border-dashed border-gray-300 p-4 min-h-32">Container</div>';
break;
default:
component.innerHTML = `<div class="text-center py-4">${type}</div>`;
}
component.appendChild(deleteBtn);
canvas.appendChild(component);
// Make component draggable
makeDraggable(component);
// Show properties when component is clicked
component.addEventListener('click', function(e) {
if (e.target.tagName !== 'BUTTON' && e.target.tagName !== 'I') {
showPropertiesForComponent(type);
}
});
}
function makeDraggable(element) {
let pos1 = 0, pos2 = 0, pos3 = 0, pos4 = 0;
element.onmousedown = dragMouseDown;
function dragMouseDown(e) {
e = e || window.event;
e.preventDefault();
// Get the mouse cursor position at startup
pos3 = e.clientX;
pos4 = e.clientY;
document.onmouseup = closeDragElement;
document.onmousemove = elementDrag;
}
function elementDrag(e) {
e = e || window.event;
e.preventDefault();
// Calculate the new cursor position
pos1 = pos3 - e.clientX;
pos2 = pos4 - e.clientY;
pos3 = e.clientX;
pos4 = e.clientY;
// Set the element's new position
const rect = canvas.getBoundingClientRect();
let newTop = element.offsetTop - pos2;
let newLeft = element.offsetLeft - pos1;
// Constrain to canvas boundaries
newTop = Math.max(0, Math.min(newTop, rect.height - element.offsetHeight));
newLeft = Math.max(0, Math.min(newLeft, rect.width - element.offsetWidth));
element.style.top = newTop + "px";
element.style.left = newLeft + "px";
}
function closeDragElement() {
// Stop moving when mouse button is released
document.onmouseup = null;
document.onmousemove = null;
}
}
function showPropertiesForComponent(type) {
let propertiesHTML = '';
switch(type) {
case 'heading':
propertiesHTML = `
<div class="space-y-4">
<div>
<label class="block text-sm font-medium text-gray-700 mb-1">Text</label>
<input type="text" class="w-full border border-gray-300 rounded-md p-2" value="Heading">
</div>
<div>
<label class="block text-sm font-medium text-gray-700 mb-1">Size</label>
<select class="w-full border border-gray-300 rounded-md p-2">
<option>H1</option>
<option selected>H2</option>
<option>H3</option>
<option>H4</option>
</select>
</div>
<div>
<label class="block text-sm font-medium text-gray-700 mb-1">Color</label>
<input type="color" class="w-full h-10" value="#1f2937">
</div>
<div>
<label class="block text-sm font-medium text-gray-700 mb-1">Alignment</label>
<div class="flex space-x-2">
<button class="p-2 border rounded"><i class="fas fa-align-left"></i></button>
<button class="p-2 border rounded"><i class="fas fa-align-center"></i></button>
<button class="p-2 border rounded"><i class="fas fa-align-right"></i></button>
</div>
</div>
</div>
`;
break;
case 'button':
propertiesHTML = `
<div class="space-y-4">
<div>
<label class="block text-sm font-medium text-gray-700 mb-1">Text</label>
<input type="text" class="w-full border border-gray-300 rounded-md p-2" value="Button">
</div>
<div>
<label class="block text-sm font-medium text-gray-700 mb-1">Background Color</label>
<input type="color" class="w-full h-10" value="#3b82f6">
</div>
<div>
<label class="block text-sm font-medium text-gray-700 mb-1">Text Color</label>
<input type="color" class="w-full h-10" value="#ffffff">
</div>
<div>
<label class="block text-sm font-medium text-gray-700 mb-1">Action</label>
<select class="w-full border border-gray-300 rounded-md p-2">
<option>Link to URL</option>
<option>Submit Form</option>
<option>Open Modal</option>
</select>
</div>
</div>
`;
break;
default:
propertiesHTML = `
<div class="text-center py-10 text-gray-500">
<i class="fas fa-cog text-3xl mb-2"></i>
<p>Properties for ${type} will appear here</p>
</div>
`;
}
propertiesPanel.innerHTML = propertiesHTML;
}
// AI Assistant generate button
document.querySelector('#properties-panel button').addEventListener('click', function() {
const prompt = document.querySelector('#properties-panel textarea').value;
if (prompt.trim() === '') return;
// Simulate AI generation
setTimeout(() => {
// Clear canvas
canvas.querySelectorAll('.component').forEach(c => c.remove());
emptyCanvas.style.display = 'none';
// Add sample components based on prompt
if (prompt.toLowerCase().includes('landing page')) {
addComponentToCanvas('heading', 100, 100);
addComponentToCanvas('paragraph', 100, 150);
addComponentToCanvas('button', 100, 250);
} else if (prompt.toLowerCase().includes('contact form')) {
addComponentToCanvas('form', 100, 100);
} else {
// Default generic components
addComponentToCanvas('heading', 100, 100);
addComponentToCanvas('paragraph', 100, 150);
addComponentToCanvas('image', 100, 250);
}
// Show success message
alert('AI has generated components based on your description!');
}, 1500);
});
});
</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=MarcRyan/nextnocode" style="color: #fff;text-decoration: underline;" target="_blank" >Remix</a></p></body>
</html>