Spaces:
Running
Running
File size: 23,508 Bytes
5bde1a8 a32c269 5bde1a8 a32c269 5bde1a8 a32c269 5bde1a8 a32c269 5bde1a8 a32c269 5bde1a8 a32c269 5bde1a8 a32c269 5bde1a8 a32c269 5bde1a8 a32c269 5bde1a8 a32c269 5bde1a8 a32c269 5bde1a8 a32c269 5bde1a8 a32c269 5bde1a8 a32c269 5bde1a8 a32c269 5bde1a8 a32c269 5bde1a8 a32c269 5bde1a8 a32c269 5bde1a8 a32c269 5bde1a8 11b15a0 a32c269 11b15a0 a32c269 11b15a0 a32c269 11b15a0 a32c269 11b15a0 a32c269 11b15a0 a32c269 11b15a0 a32c269 11b15a0 a32c269 11b15a0 a32c269 11b15a0 57d24a3 5bde1a8 a32c269 5bde1a8 a32c269 5bde1a8 a32c269 5bde1a8 a32c269 5bde1a8 a32c269 5bde1a8 a32c269 57d24a3 a32c269 5bde1a8 a32c269 5bde1a8 a32c269 11b15a0 a32c269 5bde1a8 a32c269 5bde1a8 11b15a0 a32c269 11b15a0 a32c269 5bde1a8 a32c269 11b15a0 5bde1a8 a32c269 5bde1a8 a32c269 57d24a3 a32c269 5bde1a8 a32c269 57d24a3 5bde1a8 a32c269 5bde1a8 a32c269 5bde1a8 a32c269 5bde1a8 a32c269 11b15a0 a32c269 57d24a3 a32c269 11b15a0 a32c269 11b15a0 a32c269 57d24a3 11b15a0 a32c269 57d24a3 11b15a0 a32c269 57d24a3 a32c269 57d24a3 11b15a0 a32c269 11b15a0 5bde1a8 57d24a3 5bde1a8 |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 379 380 381 382 383 384 385 386 387 388 389 390 391 392 393 394 395 396 397 398 399 400 401 402 403 404 405 406 407 408 409 410 411 412 413 414 415 416 417 418 419 420 421 422 423 424 425 426 427 428 429 430 431 432 433 434 435 436 437 438 439 440 441 442 443 444 445 446 447 448 449 450 451 452 453 454 455 456 457 458 459 460 461 462 463 464 465 466 467 468 469 470 471 472 473 474 475 476 477 478 479 480 481 482 483 484 485 486 487 488 489 490 491 492 493 494 495 496 497 498 499 500 501 502 503 504 505 506 507 508 509 510 511 512 513 514 515 516 517 518 519 520 521 522 523 524 525 526 527 528 529 530 531 532 533 534 535 536 537 538 539 540 541 542 543 544 545 546 547 548 549 550 551 552 553 554 555 556 557 558 559 560 561 562 563 564 |
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Vibecode | Onchain Replit with Vibes</title>
<script src="https://cdn.tailwindcss.com"></script>
<link href="https://fonts.googleapis.com/css2?family=VT323&family=Press+Start+2P&family=IBM+Plex+Mono:wght@400;500&display=swap" rel="stylesheet">
<style>
:root {
--bg-dark: #0a0e14;
--neon-green: #00ff99;
--neon-cyan: #66fff9;
--neon-purple: #ab7cf9;
}
body {
background-color: var(--bg-dark);
color: white;
font-family: 'IBM Plex Mono', monospace;
overflow-x: hidden;
}
.pixel-font {
font-family: 'Press Start 2P', cursive;
}
.terminal-font {
font-family: 'VT323', monospace;
}
.neon-green {
color: var(--neon-green);
text-shadow: 0 0 5px var(--neon-green);
}
.neon-cyan {
color: var(--neon-cyan);
text-shadow: 0 0 5px var(--neon-cyan);
}
.neon-purple {
color: var(--neon-purple);
text-shadow: 0 0 5px var(--neon-purple);
}
.neon-glow {
box-shadow: 0 0 10px var(--neon-green), 0 0 20px var(--neon-purple);
}
.scanlines {
position: relative;
overflow: hidden;
}
.scanlines:before {
content: "";
position: absolute;
top: 0;
left: 0;
right: 0;
bottom: 0;
background: linear-gradient(
to bottom,
transparent 0%,
rgba(255, 255, 255, 0.05) 50%,
transparent 100%
);
background-size: 100% 4px;
pointer-events: none;
z-index: 10;
}
.glitch {
position: relative;
}
.glitch::before, .glitch::after {
content: attr(data-text);
position: absolute;
top: 0;
left: 0;
width: 100%;
height: 100%;
background: var(--bg-dark);
}
.glitch::before {
left: 2px;
text-shadow: -2px 0 var(--neon-purple);
clip: rect(44px, 450px, 56px, 0);
animation: glitch-anim 5s infinite linear alternate-reverse;
}
.glitch::after {
left: -2px;
text-shadow: -2px 0 var(--neon-cyan);
clip: rect(44px, 450px, 56px, 0);
animation: glitch-anim2 5s infinite linear alternate-reverse;
}
@keyframes glitch-anim {
0% { clip: rect(31px, 9999px, 94px, 0); }
10% { clip: rect(112px, 9999px, 76px, 0); }
20% { clip: rect(85px, 9999px, 77px, 0); }
30% { clip: rect(27px, 9999px, 97px, 0); }
40% { clip: rect(64px, 9999px, 98px, 0); }
50% { clip: rect(61px, 9999px, 85px, 0); }
60% { clip: rect(99px, 9999px, 114px, 0); }
70% { clip: rect(34px, 9999px, 115px, 0); }
80% { clip: rect(98px, 9999px, 129px, 0); }
90% { clip: rect(43px, 9999px, 96px, 0); }
100% { clip: rect(82px, 9999px, 64px, 0); }
}
@keyframes glitch-anim2 {
0% { clip: rect(65px, 9999px, 119px, 0); }
10% { clip: rect(144px, 9999px, 41px, 0); }
20% { clip: rect(6px, 9999px, 187px, 0); }
30% { clip: rect(133px, 9999px, 50px, 0); }
40% { clip: rect(115px, 9999px, 23px, 0); }
50% { clip: rect(187px, 9999px, 169px, 0); }
60% { clip: rect(40px, 9999px, 128px, 0); }
70% { clip: rect(45px, 9999px, 7px, 0); }
80% { clip: rect(24px, 9999px, 162px, 0); }
90% { clip: rect(138px, 9999px, 180px, 0); }
100% { clip: rect(6px, 9999px, 103px, 0); }
}
.typing {
border-right: 2px solid var(--neon-green);
animation: blink 0.75s step-end infinite;
}
@keyframes blink {
from, to { border-color: transparent; }
50% { border-color: var(--neon-green); }
}
.pixel-corners {
position: relative;
}
.pixel-corners::before, .pixel-corners::after {
content: '';
position: absolute;
width: 10px;
height: 10px;
border: 2px solid var(--neon-green);
}
.pixel-corners::before {
top: -5px;
left: -5px;
border-right: none;
border-bottom: none;
}
.pixel-corners::after {
bottom: -5px;
right: -5px;
border-left: none;
border-top: none;
}
.loading-dots:after {
content: '...';
animation: dots 1.5s steps(5, end) infinite;
display: inline-block;
width: 0;
overflow: hidden;
vertical-align: bottom;
}
@keyframes dots {
0%, 20% { width: 0; }
40% { width: 0.2em; }
60% { width: 0.4em; }
80% { width: 0.6em; }
100% { width: 0; }
}
/* Code syntax highlighting */
.code-snippet {
background-color: rgba(0,0,0,0.4);
padding: 12px;
border-radius: 4px;
border-left: 3px solid var(--neon-green);
font-family: 'IBM Plex Mono', monospace;
font-size: 0.9em;
overflow-x: auto;
margin: 10px 0;
}
.code-keyword { color: #ff79c6; }
.code-string { color: #f1fa8c; }
.code-comment { color: #6272a4; }
.code-function { color: #50fa7b; }
.code-variable { color: #8be9fd; }
.code-number { color: #bd93f9; }
</style>
</head>
<body class="scanlines min-h-screen">
<div class="container mx-auto px-4 py-8">
<!-- Header -->
<header class="flex flex-col items-center mb-12">
<h1 class="glitch text-5xl md:text-6xl mb-4 pixel-font neon-green" data-text="VIBECODE">VIBECODE</h1>
<p class="terminal-font text-xl neon-cyan mb-6">Onchain Replit with Vibes</p>
<div class="flex space-x-4">
<button class="terminal-font px-6 py-2 bg-transparent border-2 border-neon-green neon-green hover:bg-green-900/20 transition-all">
DOCS
</button>
<button class="terminal-font px-6 py-2 bg-neon-green text-black hover:bg-green-300 transition-all">
LAUNCH APP
</button>
</div>
</header>
<!-- Main Terminal -->
<div class="max-w-4xl mx-auto bg-black/70 border-2 border-neon-green rounded-lg overflow-hidden neon-glow">
<!-- Terminal Header -->
<div class="bg-gray-900 px-4 py-2 flex items-center">
<div class="flex space-x-2 mr-4">
<div class="w-3 h-3 rounded-full bg-red-500"></div>
<div class="w-3 h-3 rounded-full bg-yellow-500"></div>
<div class="w-3 h-3 rounded-full bg-green-500"></div>
</div>
<div class="terminal-font text-sm neon-green flex-1 text-center">
vibecode-terminal ~/launch-onchain-app
</div>
</div>
<!-- Terminal Content -->
<div class="p-4 h-96 overflow-y-auto terminal-font text-green-200" id="terminal-content">
<div class="mb-4">
<span class="neon-purple">user@vibecode:~$</span> <span class="neon-green">welcome to Vibecode</span>
</div>
<div class="mb-4">
<span class="neon-purple">user@vibecode:~$</span> <span class="neon-green">type your onchain creation prompt below</span>
</div>
<div class="mb-4">
<span class="neon-purple">user@vibecode:~$</span> <span class="neon-cyan">examples:</span>
</div>
<div class="mb-2 ml-8 text-gray-400">
> "Launch $VIBE token with 1% burn and 10% LP on Base"
</div>
<div class="mb-2 ml-8 text-gray-400">
> "Deploy an NFT mint for 777 images, free mint, 10% royalty"
</div>
<div class="mb-2 ml-8 text-gray-400">
> "Create a DAO with 30 day vesting and 5% treasury fee"
</div>
<div class="mb-6">
<span class="neon-purple">user@vibecode:~$</span> <span class="typing"></span>
</div>
<!-- Chat messages will appear here -->
<div id="chat-messages" class="space-y-4"></div>
</div>
<!-- Input Area -->
<div class="border-t border-neon-green/50 p-4 bg-gray-900/50">
<div class="flex">
<span class="terminal-font text-lg neon-purple mr-2">></span>
<input
type="text"
id="user-input"
class="terminal-font flex-1 bg-transparent border-none outline-none text-green-200 caret-green-500"
placeholder="Type your onchain creation prompt..."
autofocus
>
<button id="send-btn" class="terminal-font px-4 py-1 bg-neon-green text-black hover:bg-green-300 transition-all">
SEND
</button>
</div>
</div>
</div>
<!-- Features Grid -->
<div class="mt-16 grid grid-cols-1 md:grid-cols-3 gap-8">
<!-- Feature 1 -->
<div class="bg-gray-900/50 border border-neon-green/30 rounded-lg p-6 relative pixel-corners hover:neon-glow transition-all">
<div class="text-4xl neon-green mb-4">1</div>
<h3 class="terminal-font text-xl neon-cyan mb-3">Chat Interface</h3>
<p class="text-gray-300">
Natural language prompts to create tokens, NFTs, DAOs, and more. No coding required.
</p>
</div>
<!-- Feature 2 -->
<div class="bg-gray-900/50 border border-neon-green/30 rounded-lg p-6 relative pixel-corners hover:neon-glow transition-all">
<div class="text-4xl neon-green mb-4">2</div>
<h3 class="terminal-font text-xl neon-cyan mb-3">Auto Contracts</h3>
<p class="text-gray-300">
ERC20, ERC721, vesting, and LP contracts generated from your prompts.
</p>
</div>
<!-- Feature 3 -->
<div class="bg-gray-900/50 border border-neon-green/30 rounded-lg p-6 relative pixel-corners hover:neon-glow transition-all">
<div class="text-4xl neon-green mb-4">3</div>
<h3 class="terminal-font text-xl neon-cyan mb-3">Deploy Anywhere</h3>
<p class="text-gray-300">
Testnet for free, mainnet when ready. Base, Polygon, Zora, and Solana supported.
</p>
</div>
</div>
<!-- CTA Section -->
<div class="mt-20 text-center">
<h2 class="terminal-font text-3xl neon-green mb-6">Ready to launch your onchain app?</h2>
<button class="terminal-font px-8 py-3 bg-neon-green text-black text-lg hover:bg-green-300 transition-all">
START BUILDING NOW
</button>
</div>
<!-- Footer -->
<footer class="mt-20 pt-8 border-t border-neon-green/20 text-center text-gray-400 terminal-font">
<div class="mb-4">
<a href="#" class="mx-2 hover:text-neon-green transition-all">Twitter</a>
<a href="#" class="mx-2 hover:text-neon-green transition-all">Discord</a>
<a href="#" class="mx-2 hover:text-neon-green transition-all">GitHub</a>
</div>
<p>Vibecode © 2025 | Onchain Replit with Vibes</p>
</footer>
</div>
<script>
document.addEventListener('DOMContentLoaded', function() {
const userInput = document.getElementById('user-input');
const sendBtn = document.getElementById('send-btn');
const chatMessages = document.getElementById('chat-messages');
const terminalContent = document.getElementById('terminal-content');
// Gemini API Key
const GEMINI_API_KEY = "AIzaSyAX_-SVl0NpZ8Iv8mlkJ3olLbgxs_fTyGw";
const GEMINI_API_URL = "https://generativelanguage.googleapis.com/v1beta/models/gemini-2.0-flash:generateContent";
// Typing animation for the terminal prompt
const typingElement = document.querySelector('.typing');
const messages = [
"Launch $VIBE token with 1% burn...",
"Create NFT collection...",
"Deploy DAO with vesting...",
"Build onchain app..."
];
let messageIndex = 0;
let charIndex = 0;
let isDeleting = false;
function type() {
const currentMessage = messages[messageIndex];
if (isDeleting) {
typingElement.textContent = currentMessage.substring(0, charIndex - 1);
charIndex--;
} else {
typingElement.textContent = currentMessage.substring(0, charIndex + 1);
charIndex++;
}
if (!isDeleting && charIndex === currentMessage.length) {
isDeleting = true;
setTimeout(type, 2000);
} else if (isDeleting && charIndex === 0) {
isDeleting = false;
messageIndex = (messageIndex + 1) % messages.length;
setTimeout(type, 500);
} else {
const speed = isDeleting ? 50 : 100;
setTimeout(type, speed);
}
}
setTimeout(type, 1000);
// Handle user input
function sendMessage() {
const message = userInput.value.trim();
if (message) {
// Add user message
addMessage(message, 'user');
// Add loading indicator
const loadingId = addLoadingIndicator();
// Call Gemini API
callGeminiAPI(message)
.then(response => {
// Remove loading indicator
removeLoadingIndicator(loadingId);
// Add AI response
addMessage(formatResponse(response, message), 'ai');
// Scroll to bottom
terminalContent.scrollTop = terminalContent.scrollHeight;
})
.catch(error => {
// Remove loading indicator
removeLoadingIndicator(loadingId);
// Add error message
addMessage("Error processing your request. Please try again.", 'ai');
console.error("Gemini API Error:", error);
});
// Clear input
userInput.value = '';
}
}
function addMessage(text, sender) {
const messageDiv = document.createElement('div');
messageDiv.className = `flex ${sender === 'user' ? 'justify-end' : 'justify-start'}`;
const bubble = document.createElement('div');
bubble.className = `terminal-font max-w-3/4 rounded px-4 py-2 ${
sender === 'user'
? 'bg-neon-green/10 border border-neon-green/30 text-neon-green'
: 'bg-gray-800/50 border border-neon-purple/30 text-gray-300'
}`;
// Format the response with code highlighting if it contains code
if (sender === 'ai' && text.includes('```')) {
const formattedText = formatCodeBlocks(text);
bubble.innerHTML = formattedText;
} else {
bubble.textContent = text;
}
messageDiv.appendChild(bubble);
chatMessages.appendChild(messageDiv);
// Scroll to bottom
terminalContent.scrollTop = terminalContent.scrollHeight;
}
function addLoadingIndicator() {
const loadingId = 'loading-' + Date.now();
const loadingDiv = document.createElement('div');
loadingDiv.id = loadingId;
loadingDiv.className = 'flex justify-start';
const loadingBubble = document.createElement('div');
loadingBubble.className = 'terminal-font rounded px-4 py-2 bg-gray-800/50 border border-neon-purple/30 text-gray-300';
const loadingText = document.createElement('span');
loadingText.className = 'loading-dots';
loadingText.textContent = 'Generating smart contract';
loadingBubble.appendChild(loadingText);
loadingDiv.appendChild(loadingBubble);
chatMessages.appendChild(loadingDiv);
// Scroll to bottom
terminalContent.scrollTop = terminalContent.scrollHeight;
return loadingId;
}
function removeLoadingIndicator(loadingId) {
const loadingElement = document.getElementById(loadingId);
if (loadingElement) {
loadingElement.remove();
}
}
async function callGeminiAPI(message) {
// Construct prompt for blockchain context
const blockchainPrompt = `You are Vibecode AI, an expert in blockchain development and smart contract creation.
The user will give you a request related to creating tokens, NFTs, DAOs, or other blockchain applications.
Please respond with:
1. An explanation of what you'll create based on their request
2. The appropriate smart contract code (Solidity) to implement their request
3. Clear deployment instructions
Current user request: "${message}"`;
try {
const response = await fetch(`${GEMINI_API_URL}?key=${GEMINI_API_KEY}`, {
method: 'POST',
headers: {
'Content-Type': 'application/json'
},
body: JSON.stringify({
contents: [{
parts: [{
text: blockchainPrompt
}]
}]
})
});
if (!response.ok) {
throw new Error(`HTTP error! status: ${response.status}`);
}
const data = await response.json();
// Extract the text from the response
if (data.candidates &&
data.candidates[0] &&
data.candidates[0].content &&
data.candidates[0].content.parts &&
data.candidates[0].content.parts[0]) {
return data.candidates[0].content.parts[0].text;
} else {
throw new Error("Unexpected response format from Gemini API");
}
} catch (error) {
console.error("Error calling Gemini API:", error);
throw error;
}
}
function formatResponse(response, userRequest) {
// You can customize the formatting of the AI response here
return response;
}
function formatCodeBlocks(text) {
// Split the text by code blocks
const parts = text.split('```');
let result = '';
for (let i = 0; i < parts.length; i++) {
if (i % 2 === 0) {
// Regular text
result += parts[i];
} else {
// Code block
const codeLines = parts[i].split('\n');
const language = codeLines[0] || '';
const code = codeLines.slice(1).join('\n');
// Basic syntax highlighting for Solidity
let highlightedCode = code
.replace(/\b(contract|function|address|uint|string|bytes|mapping|struct|enum|bool|public|private|internal|external|view|pure|returns|memory|storage|calldata)\b/g, '<span class="code-keyword">$1</span>')
.replace(/(\/\/.*)/g, '<span class="code-comment">$1</span>')
.replace(/"([^"]*)"/g, '<span class="code-string">"$1"</span>')
.replace(/\b(\d+)\b/g, '<span class="code-number">$1</span>')
.replace(/\b(constructor|require|assert|emit)\b/g, '<span class="code-function">$1</span>')
.replace(/\b(msg|block|tx|address)\b/g, '<span class="code-variable">$1</span>');
result += `<div class="code-snippet">${highlightedCode}</div>`;
}
}
return result;
}
// Event listeners
sendBtn.addEventListener('click', sendMessage);
userInput.addEventListener('keypress', function(e) {
if (e.key === 'Enter') {
sendMessage();
}
});
});
</script>
</body>
</html> |