Spaces:
Running
Running
ok so now make the internals and make it work
Browse files- README.md +9 -5
- index.html +369 -18
README.md
CHANGED
|
@@ -1,10 +1,14 @@
|
|
| 1 |
---
|
| 2 |
-
title:
|
| 3 |
-
|
| 4 |
-
|
| 5 |
-
|
| 6 |
sdk: static
|
| 7 |
pinned: false
|
|
|
|
|
|
|
| 8 |
---
|
| 9 |
|
| 10 |
-
|
|
|
|
|
|
|
|
|
| 1 |
---
|
| 2 |
+
title: CodeCleano AI Wizard 🧙♂️
|
| 3 |
+
colorFrom: yellow
|
| 4 |
+
colorTo: green
|
| 5 |
+
emoji: 🐳
|
| 6 |
sdk: static
|
| 7 |
pinned: false
|
| 8 |
+
tags:
|
| 9 |
+
- deepsite-v3
|
| 10 |
---
|
| 11 |
|
| 12 |
+
# Welcome to your new DeepSite project!
|
| 13 |
+
This project was created with [DeepSite](https://deepsite.hf.co).
|
| 14 |
+
|
index.html
CHANGED
|
@@ -1,19 +1,370 @@
|
|
| 1 |
-
<!
|
| 2 |
-
<html>
|
| 3 |
-
|
| 4 |
-
|
| 5 |
-
|
| 6 |
-
|
| 7 |
-
|
| 8 |
-
|
| 9 |
-
|
| 10 |
-
|
| 11 |
-
|
| 12 |
-
|
| 13 |
-
|
| 14 |
-
|
| 15 |
-
|
| 16 |
-
|
| 17 |
-
|
| 18 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 19 |
</html>
|
|
|
|
| 1 |
+
<!DOCTYPE html>
|
| 2 |
+
<html lang="en">
|
| 3 |
+
<head>
|
| 4 |
+
<meta charset="UTF-8">
|
| 5 |
+
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
| 6 |
+
<title>CodeCleano AI Wizard</title>
|
| 7 |
+
<script src="https://cdn.tailwindcss.com"></script>
|
| 8 |
+
<script src="https://unpkg.com/feather-icons"></script>
|
| 9 |
+
<script src="https://cdn.jsdelivr.net/npm/feather-icons/dist/feather.min.js"></script>
|
| 10 |
+
<script src="https://cdn.jsdelivr.net/npm/vanta@latest/dist/vanta.globe.min.js"></script>
|
| 11 |
+
<style>
|
| 12 |
+
.hero-gradient {
|
| 13 |
+
background: linear-gradient(135deg, #6e8efb 0%, #4a6cf7 100%);
|
| 14 |
+
}
|
| 15 |
+
.code-block {
|
| 16 |
+
font-family: 'Courier New', monospace;
|
| 17 |
+
background: #1e293b;
|
| 18 |
+
border-radius: 0.5rem;
|
| 19 |
+
}
|
| 20 |
+
.glow-effect {
|
| 21 |
+
box-shadow: 0 0 20px rgba(74, 108, 247, 0.5);
|
| 22 |
+
}
|
| 23 |
+
</style>
|
| 24 |
+
</head>
|
| 25 |
+
<body class="bg-gray-900 text-gray-100">
|
| 26 |
+
<!-- Vanta.js Globe Background -->
|
| 27 |
+
<div id="globe-bg" class="fixed top-0 left-0 w-full h-full -z-10"></div>
|
| 28 |
+
|
| 29 |
+
<!-- Navigation -->
|
| 30 |
+
<nav class="bg-gray-800/80 backdrop-blur-md fixed w-full z-50">
|
| 31 |
+
<div class="container mx-auto px-6 py-4">
|
| 32 |
+
<div class="flex justify-between items-center">
|
| 33 |
+
<div class="flex items-center space-x-2">
|
| 34 |
+
<i data-feather="cpu" class="text-blue-400"></i>
|
| 35 |
+
<span class="text-xl font-bold bg-clip-text text-transparent bg-gradient-to-r from-blue-400 to-purple-500">CodeCleano</span>
|
| 36 |
+
</div>
|
| 37 |
+
<div class="hidden md:flex space-x-8">
|
| 38 |
+
<a href="#" class="hover:text-blue-400 transition">Home</a>
|
| 39 |
+
<a href="#" class="hover:text-blue-400 transition">Features</a>
|
| 40 |
+
<a href="#" class="hover:text-blue-400 transition">Tutorial</a>
|
| 41 |
+
<a href="#" class="hover:text-blue-400 transition">API</a>
|
| 42 |
+
<a href="#" class="hover:text-blue-400 transition" onclick="document.getElementById('demo-modal').classList.remove('hidden')">Live Demo</a>
|
| 43 |
+
</div>
|
| 44 |
+
<button onclick="document.getElementById('demo-modal').classList.remove('hidden')" class="bg-blue-600 hover:bg-blue-700 px-4 py-2 rounded-lg font-medium transition">
|
| 45 |
+
Live Demo
|
| 46 |
+
</button>
|
| 47 |
+
</div>
|
| 48 |
+
</div>
|
| 49 |
+
</nav>
|
| 50 |
+
|
| 51 |
+
<!-- Hero Section -->
|
| 52 |
+
<section class="hero-gradient min-h-screen flex items-center pt-20">
|
| 53 |
+
<div class="container mx-auto px-6 py-16">
|
| 54 |
+
<div class="flex flex-col md:flex-row items-center">
|
| 55 |
+
<div class="md:w-1/2 mb-12 md:mb-0">
|
| 56 |
+
<h1 class="text-4xl md:text-6xl font-bold leading-tight mb-6">
|
| 57 |
+
Transform Messy Code<br>
|
| 58 |
+
<span class="bg-clip-text text-transparent bg-gradient-to-r from-yellow-300 to-yellow-500">Into Clean Art</span>
|
| 59 |
+
</h1>
|
| 60 |
+
<p class="text-lg md:text-xl text-gray-200 mb-8 max-w-lg">
|
| 61 |
+
Your AI-powered code janitor that understands, analyzes, and refactors code automatically. Perfect for beginners and pros alike.
|
| 62 |
+
</p>
|
| 63 |
+
<div class="flex flex-col sm:flex-row space-y-4 sm:space-y-0 sm:space-x-4">
|
| 64 |
+
<button onclick="document.getElementById('demo-modal').classList.remove('hidden')" class="bg-white text-blue-600 hover:bg-gray-100 px-8 py-3 rounded-lg font-bold text-lg transition">
|
| 65 |
+
Try Demo
|
| 66 |
+
</button>
|
| 67 |
+
<button class="border-2 border-white text-white hover:bg-white hover:text-blue-600 px-8 py-3 rounded-lg font-bold text-lg transition">
|
| 68 |
+
Watch Tutorial
|
| 69 |
+
</button>
|
| 70 |
+
</div>
|
| 71 |
+
</div>
|
| 72 |
+
<div class="md:w-1/2 relative">
|
| 73 |
+
<div class="code-block p-6 glow-effect transform rotate-1">
|
| 74 |
+
<div class="flex mb-4">
|
| 75 |
+
<div class="w-3 h-3 rounded-full bg-red-500 mr-2"></div>
|
| 76 |
+
<div class="w-3 h-3 rounded-full bg-yellow-500 mr-2"></div>
|
| 77 |
+
<div class="w-3 h-3 rounded-full bg-green-500"></div>
|
| 78 |
+
</div>
|
| 79 |
+
<pre class="text-green-400 overflow-x-auto"><code class="text-sm"># Before AI Cleanup
|
| 80 |
+
def messy(x,y,z):
|
| 81 |
+
a=x+y
|
| 82 |
+
b=a*z
|
| 83 |
+
if(b>100):
|
| 84 |
+
return True
|
| 85 |
+
else:return False
|
| 86 |
+
|
| 87 |
+
# After AI Cleanup
|
| 88 |
+
def calculate_profit(revenue, cost, multiplier):
|
| 89 |
+
total = revenue + cost
|
| 90 |
+
result = total * multiplier
|
| 91 |
+
return result > 100</code></pre>
|
| 92 |
+
</div>
|
| 93 |
+
<div class="absolute -bottom-8 -right-8 bg-purple-600/20 w-64 h-64 rounded-full filter blur-3xl -z-10"></div>
|
| 94 |
+
</div>
|
| 95 |
+
</div>
|
| 96 |
+
</div>
|
| 97 |
+
</section>
|
| 98 |
+
|
| 99 |
+
<!-- Features Section -->
|
| 100 |
+
<section class="py-20 bg-gray-800/50 backdrop-blur-sm">
|
| 101 |
+
<div class="container mx-auto px-6">
|
| 102 |
+
<h2 class="text-3xl md:text-4xl font-bold text-center mb-16">
|
| 103 |
+
<span class="bg-clip-text text-transparent bg-gradient-to-r from-blue-400 to-purple-500">
|
| 104 |
+
How CodeCleano Works
|
| 105 |
+
</span>
|
| 106 |
+
</h2>
|
| 107 |
+
|
| 108 |
+
<div class="grid md:grid-cols-3 gap-12">
|
| 109 |
+
<!-- Feature 1 -->
|
| 110 |
+
<div class="bg-gray-800/70 p-8 rounded-xl hover:transform hover:-translate-y-2 transition duration-300 border border-gray-700/50">
|
| 111 |
+
<div class="w-14 h-14 bg-blue-500/10 rounded-lg flex items-center justify-center mb-6">
|
| 112 |
+
<i data-feather="code" class="text-blue-400 w-6 h-6"></i>
|
| 113 |
+
</div>
|
| 114 |
+
<h3 class="text-xl font-bold mb-3">Code Analysis</h3>
|
| 115 |
+
<p class="text-gray-300">
|
| 116 |
+
Our AI parses your code structure, identifies patterns, and detects inefficiencies using advanced static analysis.
|
| 117 |
+
</p>
|
| 118 |
+
</div>
|
| 119 |
+
|
| 120 |
+
<!-- Feature 2 -->
|
| 121 |
+
<div class="bg-gray-800/70 p-8 rounded-xl hover:transform hover:-translate-y-2 transition duration-300 border border-gray-700/50">
|
| 122 |
+
<div class="w-14 h-14 bg-purple-500/10 rounded-lg flex items-center justify-center mb-6">
|
| 123 |
+
<i data-feather="refresh-cw" class="text-purple-400 w-6 h-6"></i>
|
| 124 |
+
</div>
|
| 125 |
+
<h3 class="text-xl font-bold mb-3">Smart Refactoring</h3>
|
| 126 |
+
<p class="text-gray-300">
|
| 127 |
+
Automatically applies best practices like variable renaming, function extraction, and complexity reduction.
|
| 128 |
+
</p>
|
| 129 |
+
</div>
|
| 130 |
+
|
| 131 |
+
<!-- Feature 3 -->
|
| 132 |
+
<div class="bg-gray-800/70 p-8 rounded-xl hover:transform hover:-translate-y-2 transition duration-300 border border-gray-700/50">
|
| 133 |
+
<div class="w-14 h-14 bg-green-500/10 rounded-lg flex items-center justify-center mb-6">
|
| 134 |
+
<i data-feather="zap" class="text-green-400 w-6 h-6"></i>
|
| 135 |
+
</div>
|
| 136 |
+
<h3 class="text-xl font-bold mb-3">Performance Boost</h3>
|
| 137 |
+
<p class="text-gray-300">
|
| 138 |
+
Optimizes algorithms, reduces complexity, and suggests faster alternatives while preserving functionality.
|
| 139 |
+
</p>
|
| 140 |
+
</div>
|
| 141 |
+
</div>
|
| 142 |
+
</div>
|
| 143 |
+
</section>
|
| 144 |
+
|
| 145 |
+
<!-- Tutorial Section -->
|
| 146 |
+
<section class="py-20 bg-gray-900">
|
| 147 |
+
<div class="container mx-auto px-6">
|
| 148 |
+
<div class="text-center mb-16">
|
| 149 |
+
<h2 class="text-3xl md:text-4xl font-bold mb-4">
|
| 150 |
+
Build Your Own Code AI
|
| 151 |
+
</h2>
|
| 152 |
+
<p class="text-xl text-gray-400 max-w-3xl mx-auto">
|
| 153 |
+
Follow our step-by-step guide to create your own code optimization AI
|
| 154 |
+
</p>
|
| 155 |
+
</div>
|
| 156 |
+
|
| 157 |
+
<div class="grid md:grid-cols-2 gap-12 items-center">
|
| 158 |
+
<div class="space-y-8">
|
| 159 |
+
<!-- Step 1 -->
|
| 160 |
+
<div class="flex items-start">
|
| 161 |
+
<div class="bg-blue-600 text-white w-10 h-10 rounded-full flex items-center justify-center flex-shrink-0 mr-4 mt-1">1</div>
|
| 162 |
+
<div>
|
| 163 |
+
<h3 class="text-xl font-bold mb-2">Choose Your Platform</h3>
|
| 164 |
+
<p class="text-gray-300">
|
| 165 |
+
Start with Python and Jupyter Notebook for experimentation. Then move to:
|
| 166 |
+
<ul class="list-disc list-inside mt-2 text-gray-400">
|
| 167 |
+
<li>Google Colab (free GPU)</li>
|
| 168 |
+
<li>VS Code with Python extension</li>
|
| 169 |
+
<li>Docker for deployment</li>
|
| 170 |
+
</ul>
|
| 171 |
+
</p>
|
| 172 |
+
</div>
|
| 173 |
+
</div>
|
| 174 |
+
|
| 175 |
+
<!-- Step 2 -->
|
| 176 |
+
<div class="flex items-start">
|
| 177 |
+
<div class="bg-blue-600 text-white w-10 h-10 rounded-full flex items-center justify-center flex-shrink-0 mr-4 mt-1">2</div>
|
| 178 |
+
<div>
|
| 179 |
+
<h3 class="text-xl font-bold mb-2">Essential Libraries</h3>
|
| 180 |
+
<p class="text-gray-300">
|
| 181 |
+
Install these Python packages:
|
| 182 |
+
<div class="code-block p-4 my-2">
|
| 183 |
+
<pre class="text-sm text-green-400">pip install transformers torch astor libcst pytest</pre>
|
| 184 |
+
</div>
|
| 185 |
+
We'll use HuggingFace Transformers for the AI core and AST parsing for code analysis.
|
| 186 |
+
</p>
|
| 187 |
+
</div>
|
| 188 |
+
</div>
|
| 189 |
+
|
| 190 |
+
<!-- Step 3 -->
|
| 191 |
+
<div class="flex items-start">
|
| 192 |
+
<div class="bg-blue-600 text-white w-10 h-10 rounded-full flex items-center justify-center flex-shrink-0 mr-4 mt-1">3</div>
|
| 193 |
+
<div>
|
| 194 |
+
<h3 class="text-xl font-bold mb-2">Training Process</h3>
|
| 195 |
+
<p class="text-gray-300">
|
| 196 |
+
1. Collect code examples (GitHub is great)<br>
|
| 197 |
+
2. Create "before/after" refactored pairs<br>
|
| 198 |
+
3. Fine-tune a model like CodeT5<br>
|
| 199 |
+
4. Validate with test cases
|
| 200 |
+
</p>
|
| 201 |
+
</div>
|
| 202 |
+
</div>
|
| 203 |
+
</div>
|
| 204 |
+
|
| 205 |
+
<div class="bg-gray-800/70 p-8 rounded-xl border border-gray-700/50">
|
| 206 |
+
<div class="code-block p-6">
|
| 207 |
+
<div class="flex mb-4">
|
| 208 |
+
<div class="w-3 h-3 rounded-full bg-red-500 mr-2"></div>
|
| 209 |
+
<div class="w-3 h-3 rounded-full bg-yellow-500 mr-2"></div>
|
| 210 |
+
<div class="w-3 h-3 rounded-full bg-green-500"></div>
|
| 211 |
+
</div>
|
| 212 |
+
<pre class="text-green-400 overflow-x-auto text-sm"><code># Sample training script
|
| 213 |
+
from transformers import T5ForConditionalGeneration, Trainer
|
| 214 |
+
|
| 215 |
+
model = T5ForConditionalGeneration.from_pretrained("Salesforce/codet5-base")
|
| 216 |
+
|
| 217 |
+
trainer = Trainer(
|
| 218 |
+
model=model,
|
| 219 |
+
train_dataset=code_dataset,
|
| 220 |
+
args=training_args
|
| 221 |
+
)
|
| 222 |
+
|
| 223 |
+
trainer.train()
|
| 224 |
+
|
| 225 |
+
# Saving the model
|
| 226 |
+
model.save_pretrained("code_cleaner_model")</code></pre>
|
| 227 |
+
</div>
|
| 228 |
+
</div>
|
| 229 |
+
</div>
|
| 230 |
+
</div>
|
| 231 |
+
</section>
|
| 232 |
+
|
| 233 |
+
<!-- CTA Section -->
|
| 234 |
+
<section class="py-20 bg-gradient-to-r from-purple-900/40 to-blue-900/40">
|
| 235 |
+
<div class="container mx-auto px-6 text-center">
|
| 236 |
+
<h2 class="text-3xl md:text-5xl font-bold mb-8 max-w-4xl mx-auto">
|
| 237 |
+
Ready to Transform Your Coding Workflow?
|
| 238 |
+
</h2>
|
| 239 |
+
<p class="text-xl text-gray-300 mb-12 max-w-2xl mx-auto">
|
| 240 |
+
Join thousands of developers who save hours every week with automated code optimization.
|
| 241 |
+
</p>
|
| 242 |
+
<div class="flex flex-col sm:flex-row justify-center space-y-4 sm:space-y-0 sm:space-x-4">
|
| 243 |
+
<button class="bg-blue-600 hover:bg-blue-700 px-8 py-4 rounded-lg font-bold text-lg transition">
|
| 244 |
+
Start Free Trial
|
| 245 |
+
</button>
|
| 246 |
+
<button class="bg-white/10 hover:bg-white/20 border border-white/20 px-8 py-4 rounded-lg font-bold text-lg transition">
|
| 247 |
+
Watch Demo Video
|
| 248 |
+
</button>
|
| 249 |
+
</div>
|
| 250 |
+
</div>
|
| 251 |
+
</section>
|
| 252 |
+
<!-- Demo Modal -->
|
| 253 |
+
<div id="demo-modal" class="hidden fixed inset-0 bg-black bg-opacity-70 z-50 flex items-center justify-center p-4">
|
| 254 |
+
<div class="bg-gray-800 rounded-xl max-w-4xl w-full max-h-[90vh] overflow-auto">
|
| 255 |
+
<div class="p-6">
|
| 256 |
+
<div class="flex justify-between items-center mb-4">
|
| 257 |
+
<h3 class="text-2xl font-bold">Code Cleaning Demo</h3>
|
| 258 |
+
<button onclick="document.getElementById('demo-modal').classList.add('hidden')" class="text-gray-400 hover:text-white">
|
| 259 |
+
<i data-feather="x"></i>
|
| 260 |
+
</button>
|
| 261 |
+
</div>
|
| 262 |
+
|
| 263 |
+
<div class="grid md:grid-cols-2 gap-6 mb-6">
|
| 264 |
+
<div>
|
| 265 |
+
<label class="block text-gray-300 mb-2">Input Your Code</label>
|
| 266 |
+
<textarea id="code-editor" class="w-full h-64 bg-gray-900 text-gray-100 p-4 rounded-lg font-mono" placeholder="Paste your messy code here..."></textarea>
|
| 267 |
+
</div>
|
| 268 |
+
<div>
|
| 269 |
+
<label class="block text-gray-300 mb-2">Cleaned Result</label>
|
| 270 |
+
<div id="result-container" class="w-full h-64 bg-gray-900 p-4 rounded-lg overflow-auto">
|
| 271 |
+
<p class="text-gray-500 italic">Your cleaned code will appear here...</p>
|
| 272 |
+
</div>
|
| 273 |
+
</div>
|
| 274 |
+
</div>
|
| 275 |
+
|
| 276 |
+
<div class="flex justify-center">
|
| 277 |
+
<button id="process-btn" class="bg-blue-600 hover:bg-blue-700 px-8 py-3 rounded-lg font-bold text-lg transition">
|
| 278 |
+
Clean My Code
|
| 279 |
+
</button>
|
| 280 |
+
</div>
|
| 281 |
+
</div>
|
| 282 |
+
</div>
|
| 283 |
+
</div>
|
| 284 |
+
|
| 285 |
+
<!-- Footer -->
|
| 286 |
+
<footer class="bg-gray-900/80 py-12 border-t border-gray-800">
|
| 287 |
+
<div class="container mx-auto px-6">
|
| 288 |
+
<div class="flex flex-col md:flex-row justify-between items-center">
|
| 289 |
+
<div class="flex items-center space-x-2 mb-6 md:mb-0">
|
| 290 |
+
<i data-feather="cpu" class="text-blue-400"></i>
|
| 291 |
+
<span class="text-xl font-bold bg-clip-text text-transparent bg-gradient-to-r from-blue-400 to-purple-500">CodeCleano</span>
|
| 292 |
+
</div>
|
| 293 |
+
<div class="flex space-x-6">
|
| 294 |
+
<a href="#" class="text-gray-400 hover:text-blue-400 transition">
|
| 295 |
+
<i data-feather="github"></i>
|
| 296 |
+
</a>
|
| 297 |
+
<a href="#" class="text-gray-400 hover:text-blue-400 transition">
|
| 298 |
+
<i data-feather="twitter"></i>
|
| 299 |
+
</a>
|
| 300 |
+
<a href="#" class="text-gray-400 hover:text-blue-400 transition">
|
| 301 |
+
<i data-feather="linkedin"></i>
|
| 302 |
+
</a>
|
| 303 |
+
<a href="#" class="text-gray-400 hover:text-blue-400 transition">
|
| 304 |
+
<i data-feather="youtube"></i>
|
| 305 |
+
</a>
|
| 306 |
+
</div>
|
| 307 |
+
</div>
|
| 308 |
+
<div class="border-t border-gray-800 mt-8 pt-8 text-center text-gray-500">
|
| 309 |
+
<p>© 2023 CodeCleano AI. All rights reserved. Made with <i data-feather="heart" class="w-4 h-4 inline text-red-400"></i> for developers</p>
|
| 310 |
+
</div>
|
| 311 |
+
</div>
|
| 312 |
+
</footer>
|
| 313 |
+
<script>
|
| 314 |
+
// Initialize Vanta.js globe
|
| 315 |
+
VANTA.GLOBE({
|
| 316 |
+
el: "#globe-bg",
|
| 317 |
+
mouseControls: true,
|
| 318 |
+
touchControls: true,
|
| 319 |
+
gyroControls: false,
|
| 320 |
+
minHeight: 200.00,
|
| 321 |
+
minWidth: 200.00,
|
| 322 |
+
scale: 1.00,
|
| 323 |
+
scaleMobile: 1.00,
|
| 324 |
+
color: 0x3b82f6,
|
| 325 |
+
backgroundColor: 0x111827,
|
| 326 |
+
size: 0.8
|
| 327 |
+
});
|
| 328 |
+
|
| 329 |
+
// Code Processing Functionality
|
| 330 |
+
const codeEditor = document.getElementById('code-editor');
|
| 331 |
+
const processBtn = document.getElementById('process-btn');
|
| 332 |
+
const resultContainer = document.getElementById('result-container');
|
| 333 |
+
|
| 334 |
+
processBtn.addEventListener('click', async () => {
|
| 335 |
+
const code = codeEditor.value;
|
| 336 |
+
if (!code.trim()) return;
|
| 337 |
+
|
| 338 |
+
processBtn.disabled = true;
|
| 339 |
+
processBtn.innerHTML = '<i data-feather="loader" class="animate-spin"></i> Processing...';
|
| 340 |
+
feather.replace();
|
| 341 |
+
|
| 342 |
+
try {
|
| 343 |
+
// Using a mock API for demonstration
|
| 344 |
+
// In production, replace with your actual API endpoint
|
| 345 |
+
const response = await fetch('https://api.mocki.io/v2/c4d7a195/gpt-3', {
|
| 346 |
+
method: 'POST',
|
| 347 |
+
headers: {
|
| 348 |
+
'Content-Type': 'application/json',
|
| 349 |
+
},
|
| 350 |
+
body: JSON.stringify({
|
| 351 |
+
prompt: `Refactor this code following best practices:\n\n${code}\n\nRefactored code:`,
|
| 352 |
+
max_tokens: 1000
|
| 353 |
+
})
|
| 354 |
+
});
|
| 355 |
+
|
| 356 |
+
const data = await response.json();
|
| 357 |
+
resultContainer.innerHTML = `<pre class="text-green-400 p-4 bg-gray-800 rounded-lg"><code>${data.choices[0].text.trim()}</code></pre>`;
|
| 358 |
+
} catch (error) {
|
| 359 |
+
resultContainer.innerHTML = `<div class="text-red-400 p-4 bg-gray-800 rounded-lg">Error: ${error.message}</div>`;
|
| 360 |
+
} finally {
|
| 361 |
+
processBtn.disabled = false;
|
| 362 |
+
processBtn.innerHTML = 'Clean My Code';
|
| 363 |
+
feather.replace();
|
| 364 |
+
}
|
| 365 |
+
});
|
| 366 |
+
|
| 367 |
+
feather.replace();
|
| 368 |
+
</script>
|
| 369 |
+
</body>
|
| 370 |
</html>
|