jjj / index.html
Jayreddin's picture
undefined - Follow Up Deployment
8aa12d8 verified
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Puter Automate - n8n-like Automation Platform</title>
<script src="https://js.puter.com/v2/"></script>
<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">
<script>
tailwind.config = {
theme: {
extend: {
colors: {
primary: '#4f46e5',
secondary: '#818cf8',
dark: '#0f172a',
light: '#f8fafc'
}
}
}
}
</script>
<style>
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700&display=swap');
body {
font-family: 'Inter', sans-serif;
background-color: #f1f5f9;
overflow-x: hidden;
}
.node {
transition: all 0.3s ease;
box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
}
.node:hover {
transform: translateY(-2px);
box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
}
.connector {
position: absolute;
background-color: #94a3b8;
border-radius: 50%;
cursor: pointer;
z-index: 10;
}
.connector:hover {
background-color: #4f46e5;
transform: scale(1.2);
}
.connection-line {
position: absolute;
height: 2px;
background-color: #94a3b8;
transform-origin: 0 0;
z-index: 1;
}
.workflow-canvas {
min-height: 500px;
background-image: radial-gradient(#cbd5e1 1px, transparent 1px);
background-size: 20px 20px;
}
.sidebar {
transition: all 0.3s ease;
}
.sidebar.collapsed {
width: 70px;
}
.sidebar.expanded {
width: 280px;
}
.node-list-item {
transition: all 0.2s ease;
}
.node-list-item:hover {
background-color: #e2e8f0;
transform: translateX(5px);
}
.pulse {
animation: pulse 2s infinite;
}
@keyframes pulse {
0% { box-shadow: 0 0 0 0 rgba(79, 70, 229, 0.4); }
70% { box-shadow: 0 0 0 10px rgba(79, 70, 229, 0); }
100% { box-shadow: 0 0 0 0 rgba(79, 70, 229, 0); }
}
.workflow-item {
transition: all 0.2s ease;
}
.workflow-item:hover {
background-color: #e0e7ff;
}
.dragging {
opacity: 0.7;
transform: scale(0.95);
}
</style>
</head>
<body class="bg-slate-100 text-slate-800">
<!-- Main App Container -->
<div class="flex flex-col h-screen max-w-7xl mx-auto">
<!-- Header -->
<header class="bg-white shadow-sm py-4 px-6 flex items-center justify-between">
<div class="flex items-center space-x-3">
<div class="bg-indigo-600 text-white p-2 rounded-lg">
<i class="fas fa-robot text-xl"></i>
</div>
<h1 class="text-2xl font-bold text-slate-800">Puter<span class="text-indigo-600">Automate</span></h1>
</div>
<div class="flex items-center space-x-4">
<button class="hidden md:flex items-center space-x-1 bg-indigo-100 hover:bg-indigo-200 text-indigo-700 px-4 py-2 rounded-lg transition">
<i class="fas fa-plus"></i>
<span>New Workflow</span>
</button>
<button class="bg-indigo-600 hover:bg-indigo-700 text-white px-4 py-2 rounded-lg transition flex items-center">
<i class="fas fa-save mr-2"></i>
<span>Save</span>
</button>
<div class="w-10 h-10 rounded-full bg-indigo-100 flex items-center justify-center">
<i class="fas fa-user text-indigo-600"></i>
</div>
</div>
</header>
<!-- Main Content -->
<div class="flex flex-1 overflow-hidden">
<!-- Sidebar -->
<div id="sidebar" class="sidebar expanded bg-white shadow-md flex flex-col">
<div class="p-4 border-b">
<div class="flex justify-between items-center">
<h2 class="font-semibold text-lg">Workflows</h2>
<button id="toggle-sidebar" class="text-slate-500 hover:text-slate-700">
<i class="fas fa-chevron-left"></i>
</button>
</div>
</div>
<div class="p-4 border-b">
<div class="relative">
<input type="text" placeholder="Search workflows..." class="w-full pl-10 pr-4 py-2 rounded-lg border border-slate-300 focus:outline-none focus:ring-2 focus:ring-indigo-200">
<i class="fas fa-search absolute left-3 top-3 text-slate-400"></i>
</div>
</div>
<div class="overflow-y-auto flex-1">
<div class="p-4">
<div class="flex justify-between items-center mb-2">
<h3 class="text-sm font-semibold text-slate-500 uppercase tracking-wider">Recent</h3>
<button id="new-workflow-btn" class="text-xs bg-indigo-100 hover:bg-indigo-200 text-indigo-700 px-2 py-1 rounded">
<i class="fas fa-plus mr-1"></i>New
</button>
</div>
<div class="space-y-2">
<div class="workflow-item bg-indigo-50 border-l-4 border-indigo-500 p-3 rounded-r-lg">
<div class="flex justify-between">
<span class="font-medium">Email Notification System</span>
<span class="text-xs text-slate-500">Today</span>
</div>
<div class="flex items-center mt-2 text-xs text-slate-500">
<i class="fas fa-circle text-green-500 mr-1"></i>
<span>Active</span>
</div>
</div>
<div class="workflow-item p-3 rounded-lg hover:bg-slate-50">
<div class="flex justify-between">
<span class="font-medium">File Backup Automation</span>
<span class="text-xs text-slate-500">Yesterday</span>
</div>
<div class="flex items-center mt-2 text-xs text-slate-500">
<i class="fas fa-circle text-yellow-500 mr-1"></i>
<span>Draft</span>
</div>
</div>
<div class="workflow-item p-3 rounded-lg hover:bg-slate-50">
<div class="flex justify-between">
<span class="font-medium">Social Media Poster</span>
<span class="text-xs text-slate-500">May 12</span>
</div>
<div class="flex items-center mt-2 text-xs text-slate-500">
<i class="fas fa-circle text-green-500 mr-1"></i>
<span>Active</span>
</div>
</div>
</div>
</div>
<div class="p-4 border-t">
<h3 class="text-sm font-semibold text-slate-500 uppercase tracking-wider mb-2">Node Library</h3>
<div class="space-y-2">
<div class="node-list-item p-3 rounded-lg cursor-move bg-white border border-slate-200 flex items-center" data-node-type="trigger">
<div class="w-8 h-8 rounded-full bg-indigo-100 flex items-center justify-center mr-3">
<i class="fas fa-bolt text-indigo-600"></i>
</div>
<div>
<div class="font-medium">Trigger</div>
<div class="text-xs text-slate-500">Starts workflow execution</div>
</div>
</div>
<div class="node-list-item p-3 rounded-lg cursor-move bg-white border border-slate-200 flex items-center" data-node-type="action">
<div class="w-8 h-8 rounded-full bg-green-100 flex items-center justify-center mr-3">
<i class="fas fa-cogs text-green-600"></i>
</div>
<div>
<div class="font-medium">Action</div>
<div class="text-xs text-slate-500">Performs an operation</div>
</div>
</div>
<div class="node-list-item p-3 rounded-lg cursor-move bg-white border border-slate-200 flex items-center" data-node-type="puter-file">
<div class="w-8 h-8 rounded-full bg-blue-100 flex items-center justify-center mr-3">
<i class="fas fa-file text-blue-600"></i>
</div>
<div>
<div class="font-medium">Puter File</div>
<div class="text-xs text-slate-500">File operations on Puter</div>
</div>
</div>
<div class="node-list-item p-3 rounded-lg cursor-move bg-white border border-slate-200 flex items-center" data-node-type="puter-ai">
<div class="w-8 h-8 rounded-full bg-purple-100 flex items-center justify-center mr-3">
<i class="fas fa-robot text-purple-600"></i>
</div>
<div>
<div class="font-medium">Puter AI</div>
<div class="text-xs text-slate-500">AI capabilities via Puter</div>
</div>
</div>
<div class="node-list-item p-3 rounded-lg cursor-move bg-white border border-slate-200 flex items-center" data-node-type="email">
<div class="w-8 h-8 rounded-full bg-red-100 flex items-center justify-center mr-3">
<i class="fas fa-envelope text-red-600"></i>
</div>
<div>
<div class="font-medium">Email</div>
<div class="text-xs text-slate-500">Send/receive emails</div>
</div>
</div>
</div>
<div>
<div class="font-medium">Email Trigger</div>
<div class="text-xs text-slate-500">Triggers on new emails</div>
</div>
</div>
<div class="node-list-item p-3 rounded-lg cursor-move bg-white border border-slate-200 flex items-center">
<div class="w-8 h-8 rounded-full bg-green-100 flex items-center justify-center mr-3">
<i class="fas fa-file-alt text-green-600"></i>
</div>
<div>
<div class="font-medium">File Processor</div>
<div class="text-xs text-slate-500">Processes files in directory</div>
</div>
</div>
<div class="node-list-item p-3 rounded-lg cursor-move bg-white border border-slate-200 flex items-center">
<div class="w-8 h-8 rounded-full bg-purple-100 flex items-center justify-center mr-3">
<i class="fas fa-database text-purple-600"></i>
</div>
<div>
<div class="font-medium">Database Query</div>
<div class="text-xs text-slate-500">Queries Puter database</div>
</div>
</div>
<div class="node-list-item p-3 rounded-lg cursor-move bg-white border border-slate-200 flex items-center">
<div class="w-8 h-8 rounded-full bg-yellow-100 flex items-center justify-center mr-3">
<i class="fas fa-bolt text-yellow-600"></i>
</div>
<div>
<div class="font-medium">Webhook</div>
<div class="text-xs text-slate-500">Receives HTTP requests</div>
</div>
</div>
</div>
</div>
</div>
</div>
<!-- Main Workflow Area -->
<div class="flex-1 flex flex-col overflow-hidden">
<!-- Toolbar -->
<div class="bg-white border-b py-3 px-4 flex items-center justify-between">
<div class="flex space-x-2">
<button class="p-2 rounded-lg hover:bg-slate-100">
<i class="fas fa-play text-green-600"></i>
</button>
<button class="p-2 rounded-lg hover:bg-slate-100">
<i class="fas fa-pause text-yellow-600"></i>
</button>
<button class="p-2 rounded-lg hover:bg-slate-100">
<i class="fas fa-stop text-red-600"></i>
</button>
<div class="border-l mx-2 h-6 self-center"></div>
<button class="p-2 rounded-lg hover:bg-slate-100">
<i class="fas fa-undo"></i>
</button>
<button class="p-2 rounded-lg hover:bg-slate-100">
<i class="fas fa-redo"></i>
</button>
</div>
<div class="flex items-center space-x-4">
<div class="text-sm bg-slate-100 px-3 py-1 rounded-full">
<span class="text-slate-500">Status:</span>
<span class="text-green-600 font-medium ml-1">Active</span>
</div>
<button class="text-slate-500 hover:text-slate-700">
<i class="fas fa-cog"></i>
</button>
</div>
</div>
<!-- Canvas Area -->
<div class="flex-1 overflow-auto relative workflow-canvas" id="canvas">
<!-- Connection lines will be drawn here -->
<div class="connection-line" style="width: 200px; transform: translate(200px, 150px) rotate(0deg);"></div>
<div class="connection-line" style="width: 150px; transform: translate(450px, 150px) rotate(0deg);"></div>
<!-- Nodes -->
<div class="node absolute bg-white rounded-xl p-4 w-64" style="top: 100px; left: 150px;">
<div class="flex justify-between items-start">
<div class="flex items-center">
<div class="w-10 h-10 rounded-full bg-indigo-100 flex items-center justify-center mr-3">
<i class="fas fa-envelope text-indigo-600"></i>
</div>
<div>
<h3 class="font-bold">Email Trigger</h3>
<p class="text-xs text-slate-500">When new email arrives</p>
</div>
</div>
<button class="text-slate-400 hover:text-slate-600">
<i class="fas fa-ellipsis-v"></i>
</button>
</div>
<div class="mt-4">
<div class="text-xs text-slate-500 mb-1">Configuration</div>
<div class="bg-slate-50 p-2 rounded text-sm">
Folder: Inbox
</div>
</div>
<!-- Connectors -->
<div class="connector" style="top: 50%; right: -10px;"></div>
</div>
<div class="node absolute bg-white rounded-xl p-4 w-64" style="top: 100px; left: 450px;">
<div class="flex justify-between items-start">
<div class="flex items-center">
<div class="w-10 h-10 rounded-full bg-green-100 flex items-center justify-center mr-3">
<i class="fas fa-file-alt text-green-600"></i>
</div>
<div>
<h3 class="font-bold">File Processor</h3>
<p class="text-xs text-slate-500">Process email attachments</p>
</div>
</div>
<button class="text-slate-400 hover:text-slate-600">
<i class="fas fa-ellipsis-v"></i>
</button>
</div>
<div class="mt-4">
<div class="text-xs text-slate-500 mb-1">Actions</div>
<div class="bg-slate-50 p-2 rounded text-sm">
Save to: /documents/emails
</div>
</div>
<!-- Connectors -->
<div class="connector" style="top: 50%; left: -10px;"></div>
<div class="connector" style="top: 50%; right: -10px;"></div>
</div>
<div class="node absolute bg-white rounded-xl p-4 w-64" style="top: 100px; left: 750px;">
<div class="flex justify-between items-start">
<div class="flex items-center">
<div class="w-10 h-10 rounded-full bg-purple-100 flex items-center justify-center mr-3">
<i class="fas fa-database text-purple-600"></i>
</div>
<div>
<h3 class="font-bold">Database</h3>
<p class="text-xs text-slate-500">Save processed data</p>
</div>
</div>
<button class="text-slate-400 hover:text-slate-600">
<i class="fas fa-ellipsis-v"></i>
</button>
</div>
<div class="mt-4">
<div class="text-xs text-slate-500 mb-1">Configuration</div>
<div class="bg-slate-50 p-2 rounded text-sm">
Table: email_records
</div>
</div>
<!-- Connectors -->
<div class="connector" style="top: 50%; left: -10px;"></div>
</div>
<!-- Floating action button -->
<button class="absolute bottom-6 right-6 bg-indigo-600 text-white p-4 rounded-full shadow-lg hover:bg-indigo-700 transition pulse">
<i class="fas fa-plus text-xl"></i>
</button>
<!-- Auth status indicator -->
<div id="auth-status" class="absolute top-4 right-4 bg-white rounded-lg shadow-md p-3 flex items-center">
<div id="auth-indicator" class="w-3 h-3 rounded-full bg-red-500 mr-2"></div>
<span id="auth-text" class="text-sm">Not authenticated</span>
</div>
</div>
</div>
</div>
<!-- Status Bar -->
<div class="bg-white border-t py-2 px-4 text-sm text-slate-500 flex justify-between">
<div>
<span id="workflow-name">Workflow: Email Processing</span>
<span class="mx-2"></span>
<span id="last-saved">Last saved: 2 minutes ago</span>
</div>
<div>
<span>Puter API Status: <span id="puter-status" class="text-green-600">Checking...</span></span>
<span class="mx-2"></span>
<span>Powered by <a href="https://developer.puter.com" target="_blank" class="text-indigo-600 hover:underline">Puter</a></span>
</div>
</div>
</div>
<script>
// Initialize Puter integration
async function initPuter() {
try {
// Check if user is signed in
const isSignedIn = await puter.auth.isSignedIn();
updateAuthStatus(isSignedIn);
if (!isSignedIn) {
// Try to sign in
await puter.auth.signIn();
updateAuthStatus(true);
}
// Update Puter status
document.getElementById('puter-status').textContent = 'Connected';
document.getElementById('puter-status').className = 'text-green-600';
// Load workflows from Puter FS
await loadWorkflows();
} catch (error) {
console.error('Puter initialization error:', error);
document.getElementById('puter-status').textContent = 'Error';
document.getElementById('puter-status').className = 'text-red-600';
}
}
function updateAuthStatus(isSignedIn) {
const indicator = document.getElementById('auth-indicator');
const text = document.getElementById('auth-text');
if (isSignedIn) {
indicator.className = 'w-3 h-3 rounded-full bg-green-500 mr-2';
text.textContent = 'Authenticated';
} else {
indicator.className = 'w-3 h-3 rounded-full bg-red-500 mr-2';
text.textContent = 'Not authenticated';
}
}
// Load workflows from Puter file system
async function loadWorkflows() {
try {
// Create workflows directory if it doesn't exist
try {
await puter.fs.mkdir('workflows');
} catch (e) {
// Directory already exists
}
// Read workflows directory
const workflows = await puter.fs.readdir('workflows');
console.log('Workflows loaded:', workflows);
// TODO: Update UI with loaded workflows
} catch (error) {
console.error('Error loading workflows:', error);
}
}
// Save workflow to Puter file system
async function saveWorkflow(workflowData) {
try {
const filename = `workflows/workflow-${Date.now()}.json`;
await puter.fs.write(filename, JSON.stringify(workflowData, null, 2));
console.log('Workflow saved:', filename);
return true;
} catch (error) {
console.error('Error saving workflow:', error);
return false;
}
}
// Toggle sidebar
document.getElementById('toggle-sidebar').addEventListener('click', function() {
const sidebar = document.getElementById('sidebar');
if (sidebar.classList.contains('expanded')) {
sidebar.classList.remove('expanded');
sidebar.classList.add('collapsed');
this.innerHTML = '<i class="fas fa-chevron-right"></i>';
} else {
sidebar.classList.remove('collapsed');
sidebar.classList.add('expanded');
this.innerHTML = '<i class="fas fa-chevron-left"></i>';
}
});
// New workflow button
document.getElementById('new-workflow-btn').addEventListener('click', function() {
// Clear canvas for new workflow
const canvas = document.getElementById('canvas');
canvas.innerHTML = `
<!-- Connection lines will be drawn here -->
<!-- Floating action button -->
<button class="absolute bottom-6 right-6 bg-indigo-600 text-white p-4 rounded-full shadow-lg hover:bg-indigo-700 transition pulse">
<i class="fas fa-plus text-xl"></i>
</button>
<!-- Auth status indicator -->
<div id="auth-status" class="absolute top-4 right-4 bg-white rounded-lg shadow-md p-3 flex items-center">
<div id="auth-indicator" class="w-3 h-3 rounded-full bg-red-500 mr-2"></div>
<span id="auth-text" class="text-sm">Not authenticated</span>
</div>
`;
document.getElementById('workflow-name').textContent = 'Workflow: Untitled';
document.getElementById('last-saved').textContent = 'Last saved: Never';
});
// Save button
document.querySelector('button.bg-indigo-600').addEventListener('click', async function() {
// Example workflow data
const workflowData = {
name: 'Email Processing',
nodes: [],
connections: [],
createdAt: new Date().toISOString()
};
const saved = await saveWorkflow(workflowData);
if (saved) {
document.getElementById('last-saved').textContent = `Last saved: ${new Date().toLocaleTimeString()}`;
}
});
// Drag and drop functionality for nodes
document.querySelectorAll('.node-list-item').forEach(item => {
item.addEventListener('dragstart', function(e) {
e.dataTransfer.setData('text/plain', this.getAttribute('data-node-type'));
this.classList.add('dragging');
});
item.addEventListener('dragend', function() {
this.classList.remove('dragging');
});
});
const canvas = document.getElementById('canvas');
canvas.addEventListener('dragover', function(e) {
e.preventDefault();
});
canvas.addEventListener('drop', function(e) {
e.preventDefault();
const nodeType = e.dataTransfer.getData('text/plain');
// Create a new node at drop position
const newNode = document.createElement('div');
newNode.className = 'node absolute bg-white rounded-xl p-4 w-64';
newNode.style.left = (e.clientX - 150) + 'px';
newNode.style.top = (e.clientY - 100) + 'px';
// Set node content based on type
let nodeContent = '';
let iconClass = '';
let bgColor = '';
switch(nodeType) {
case 'trigger':
iconClass = 'fas fa-bolt';
bgColor = 'bg-indigo-100';
nodeContent = `
<div class="flex justify-between items-start">
<div class="flex items-center">
<div class="w-10 h-10 rounded-full ${bgColor} flex items-center justify-center mr-3">
<i class="${iconClass} text-indigo-600"></i>
</div>
<div>
<h3 class="font-bold">Trigger</h3>
<p class="text-xs text-slate-500">Starts workflow</p>
</div>
</div>
<button class="text-slate-400 hover:text-slate-600">
<i class="fas fa-ellipsis-v"></i>
</button>
</div>
<div class="mt-4">
<div class="text-xs text-slate-500 mb-1">Configuration</div>
<div class="bg-slate-50 p-2 rounded text-sm">
Configure trigger
</div>
</div>
`;
break;
case 'action':
iconClass = 'fas fa-cogs';
bgColor = 'bg-green-100';
nodeContent = `
<div class="flex justify-between items-start">
<div class="flex items-center">
<div class="w-10 h-10 rounded-full ${bgColor} flex items-center justify-center mr-3">
<i class="${iconClass} text-green-600"></i>
</div>
<div>
<h3 class="font-bold">Action</h3>
<p class="text-xs text-slate-500">Performs operation</p>
</div>
</div>
<button class="text-slate-400 hover:text-slate-600">
<i class="fas fa-ellipsis-v"></i>
</button>
</div>
<div class="mt-4">
<div class="text-xs text-slate-500 mb-1">Configuration</div>
<div class="bg-slate-50 p-2 rounded text-sm">
Configure action
</div>
</div>
`;
break;
case 'puter-file':
iconClass = 'fas fa-file';
bgColor = 'bg-blue-100';
nodeContent = `
<div class="flex justify-between items-start">
<div class="flex items-center">
<div class="w-10 h-10 rounded-full ${bgColor} flex items-center justify-center mr-3">
<i class="${iconClass} text-blue-600"></i>
</div>
<div>
<h3 class="font-bold">Puter File</h3>
<p class="text-xs text-slate-500">File operations</p>
</div>
</div>
<button class="text-slate-400 hover:text-slate-600">
<i class="fas fa-ellipsis-v"></i>
</button>
</div>
<div class="mt-4">
<div class="text-xs text-slate-500 mb-1">Configuration</div>
<div class="bg-slate-50 p-2 rounded text-sm">
Select file operation
</div>
</div>
`;
break;
case 'puter-ai':
iconClass = 'fas fa-robot';
bgColor = 'bg-purple-100';
nodeContent = `
<div class="flex justify-between items-start">
<div class="flex items-center">
<div class="w-10 h-10 rounded-full ${bgColor} flex items-center justify-center mr-3">
<i class="${iconClass} text-purple-600"></i>
</div>
<div>
<h3 class="font-bold">Puter AI</h3>
<p class="text-xs text-slate-500">AI capabilities</p>
</div>
</div>
<button class="text-slate-400 hover:text-slate-600">
<i class="fas fa-ellipsis-v"></i>
</button>
</div>
<div class="mt-4">
<div class="text-xs text-slate-500 mb-1">Configuration</div>
<div class="bg-slate-50 p-2 rounded text-sm">
Configure AI model
</div>
</div>
`;
break;
case 'email':
iconClass = 'fas fa-envelope';
bgColor = 'bg-red-100';
nodeContent = `
<div class="flex justify-between items-start">
<div class="flex items-center">
<div class="w-10 h-10 rounded-full ${bgColor} flex items-center justify-center mr-3">
<i class="${iconClass} text-red-600"></i>
</div>
<div>
<h3 class="font-bold">Email</h3>
<p class="text-xs text-slate-500">Send/receive emails</p>
</div>
</div>
<button class="text-slate-400 hover:text-slate-600">
<i class="fas fa-ellipsis-v"></i>
</button>
</div>
<div class="mt-4">
<div class="text-xs text-slate-500 mb-1">Configuration</div>
<div class="bg-slate-50 p-2 rounded text-sm">
Configure email settings
</div>
</div>
`;
break;
default:
iconClass = 'fas fa-cog';
bgColor = 'bg-indigo-100';
nodeContent = `
<div class="flex justify-between items-start">
<div class="flex items-center">
<div class="w-10 h-10 rounded-full ${bgColor} flex items-center justify-center mr-3">
<i class="${iconClass} text-indigo-600"></i>
</div>
<div>
<h3 class="font-bold">New Node</h3>
<p class="text-xs text-slate-500">Drag to configure</p>
</div>
</div>
<button class="text-slate-400 hover:text-slate-600">
<i class="fas fa-ellipsis-v"></i>
</button>
</div>
<div class="mt-4">
<div class="text-xs text-slate-500 mb-1">Configuration</div>
<div class="bg-slate-50 p-2 rounded text-sm">
Click to configure
</div>
</div>
`;
}
// Add connectors
nodeContent += `
<!-- Connectors -->
<div class="connector" style="top: 50%; left: -10px;"></div>
<div class="connector" style="top: 50%; right: -10px;"></div>
`;
newNode.innerHTML = nodeContent;
canvas.appendChild(newNode);
});
// Node interaction
document.addEventListener('click', function(e) {
// Check if clicked element is a node
if (e.target.closest('.node')) {
const node = e.target.closest('.node');
// Remove active class from all nodes
document.querySelectorAll('.node').forEach(n => {
n.classList.remove('ring-2', 'ring-indigo-500');
});
// Add active class to clicked node
node.classList.add('ring-2', 'ring-indigo-500');
}
});
// Workflow item interaction
document.querySelectorAll('.workflow-item').forEach(item => {
item.addEventListener('click', function() {
document.querySelectorAll('.workflow-item').forEach(i => {
i.classList.remove('bg-indigo-50', 'border-l-4', 'border-indigo-500');
});
this.classList.add('bg-indigo-50', 'border-l-4', 'border-indigo-500');
});
});
</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=Jayreddin/jjj" style="color: #fff;text-decoration: underline;" target="_blank" >Remix</a></p></body>
</html>