Spaces:
Running
Running
debug it
Browse files- README.md +9 -5
- components/footer.js +68 -0
- components/navbar.js +104 -0
- index.html +252 -19
- script.js +82 -0
- style.css +60 -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: PixelAlchemy Studio ✨
|
| 3 |
+
colorFrom: blue
|
| 4 |
+
colorTo: blue
|
| 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 |
+
|
components/footer.js
ADDED
|
@@ -0,0 +1,68 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
class CustomFooter extends HTMLElement {
|
| 2 |
+
connectedCallback() {
|
| 3 |
+
this.attachShadow({ mode: 'open' });
|
| 4 |
+
this.shadowRoot.innerHTML = `
|
| 5 |
+
<style>
|
| 6 |
+
footer {
|
| 7 |
+
background: #111827;
|
| 8 |
+
padding: 2rem;
|
| 9 |
+
margin-top: auto;
|
| 10 |
+
text-align: center;
|
| 11 |
+
border-top: 1px solid #1f2937;
|
| 12 |
+
}
|
| 13 |
+
|
| 14 |
+
.footer-content {
|
| 15 |
+
max-width: 1200px;
|
| 16 |
+
margin: 0 auto;
|
| 17 |
+
}
|
| 18 |
+
|
| 19 |
+
.footer-links {
|
| 20 |
+
display: flex;
|
| 21 |
+
justify-content: center;
|
| 22 |
+
gap: 1.5rem;
|
| 23 |
+
margin-bottom: 1rem;
|
| 24 |
+
}
|
| 25 |
+
|
| 26 |
+
.footer-link {
|
| 27 |
+
color: #9ca3af;
|
| 28 |
+
text-decoration: none;
|
| 29 |
+
font-size: 0.875rem;
|
| 30 |
+
transition: color 0.2s;
|
| 31 |
+
}
|
| 32 |
+
|
| 33 |
+
.footer-link:hover {
|
| 34 |
+
color: white;
|
| 35 |
+
}
|
| 36 |
+
|
| 37 |
+
.copyright {
|
| 38 |
+
color: #6b7280;
|
| 39 |
+
font-size: 0.75rem;
|
| 40 |
+
margin-top: 1rem;
|
| 41 |
+
}
|
| 42 |
+
|
| 43 |
+
@media (max-width: 768px) {
|
| 44 |
+
.footer-links {
|
| 45 |
+
flex-direction: column;
|
| 46 |
+
align-items: center;
|
| 47 |
+
gap: 0.5rem;
|
| 48 |
+
}
|
| 49 |
+
}
|
| 50 |
+
</style>
|
| 51 |
+
<footer>
|
| 52 |
+
<div class="footer-content">
|
| 53 |
+
<div class="footer-links">
|
| 54 |
+
<a href="/about.html" class="footer-link">About</a>
|
| 55 |
+
<a href="/privacy.html" class="footer-link">Privacy</a>
|
| 56 |
+
<a href="/terms.html" class="footer-link">Terms</a>
|
| 57 |
+
<a href="/contact.html" class="footer-link">Contact</a>
|
| 58 |
+
</div>
|
| 59 |
+
<p class="copyright">
|
| 60 |
+
© ${new Date().getFullYear()} PixelAlchemy Studio. All rights reserved.
|
| 61 |
+
</p>
|
| 62 |
+
</div>
|
| 63 |
+
</footer>
|
| 64 |
+
`;
|
| 65 |
+
}
|
| 66 |
+
}
|
| 67 |
+
|
| 68 |
+
customElements.define('custom-footer', CustomFooter);
|
components/navbar.js
ADDED
|
@@ -0,0 +1,104 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
class CustomNavbar extends HTMLElement {
|
| 2 |
+
connectedCallback() {
|
| 3 |
+
this.attachShadow({ mode: 'open' });
|
| 4 |
+
this.shadowRoot.innerHTML = `
|
| 5 |
+
<style>
|
| 6 |
+
nav {
|
| 7 |
+
background: linear-gradient(135deg, #111827 0%, #1f2937 100%);
|
| 8 |
+
padding: 1rem 2rem;
|
| 9 |
+
display: flex;
|
| 10 |
+
justify-content: space-between;
|
| 11 |
+
align-items: center;
|
| 12 |
+
box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.2);
|
| 13 |
+
}
|
| 14 |
+
|
| 15 |
+
.logo {
|
| 16 |
+
color: white;
|
| 17 |
+
font-weight: bold;
|
| 18 |
+
font-size: 1.5rem;
|
| 19 |
+
display: flex;
|
| 20 |
+
align-items: center;
|
| 21 |
+
background: linear-gradient(90deg, #8b5cf6 0%, #3b82f6 100%);
|
| 22 |
+
-webkit-background-clip: text;
|
| 23 |
+
-webkit-text-fill-color: transparent;
|
| 24 |
+
}
|
| 25 |
+
|
| 26 |
+
.nav-links {
|
| 27 |
+
display: flex;
|
| 28 |
+
gap: 1.5rem;
|
| 29 |
+
list-style: none;
|
| 30 |
+
margin: 0;
|
| 31 |
+
padding: 0;
|
| 32 |
+
}
|
| 33 |
+
|
| 34 |
+
.nav-link {
|
| 35 |
+
color: #d1d5db;
|
| 36 |
+
text-decoration: none;
|
| 37 |
+
font-weight: 500;
|
| 38 |
+
padding: 0.5rem 1rem;
|
| 39 |
+
border-radius: 0.5rem;
|
| 40 |
+
transition: all 0.2s ease;
|
| 41 |
+
display: flex;
|
| 42 |
+
align-items: center;
|
| 43 |
+
}
|
| 44 |
+
|
| 45 |
+
.nav-link:hover {
|
| 46 |
+
color: white;
|
| 47 |
+
background: rgba(255, 255, 255, 0.1);
|
| 48 |
+
}
|
| 49 |
+
|
| 50 |
+
.nav-link i {
|
| 51 |
+
margin-right: 0.5rem;
|
| 52 |
+
width: 18px;
|
| 53 |
+
height: 18px;
|
| 54 |
+
}
|
| 55 |
+
|
| 56 |
+
@media (max-width: 768px) {
|
| 57 |
+
nav {
|
| 58 |
+
flex-direction: column;
|
| 59 |
+
padding: 1rem;
|
| 60 |
+
}
|
| 61 |
+
|
| 62 |
+
.nav-links {
|
| 63 |
+
margin-top: 1rem;
|
| 64 |
+
flex-wrap: wrap;
|
| 65 |
+
justify-content: center;
|
| 66 |
+
}
|
| 67 |
+
}
|
| 68 |
+
</style>
|
| 69 |
+
<nav>
|
| 70 |
+
<div class="logo">
|
| 71 |
+
PixelAlchemy Studio
|
| 72 |
+
</div>
|
| 73 |
+
<ul class="nav-links">
|
| 74 |
+
<li>
|
| 75 |
+
<a href="/" class="nav-link">
|
| 76 |
+
<i data-feather="home"></i>
|
| 77 |
+
Home
|
| 78 |
+
</a>
|
| 79 |
+
</li>
|
| 80 |
+
<li>
|
| 81 |
+
<a href="/gallery.html" class="nav-link">
|
| 82 |
+
<i data-feather="image"></i>
|
| 83 |
+
Gallery
|
| 84 |
+
</a>
|
| 85 |
+
</li>
|
| 86 |
+
<li>
|
| 87 |
+
<a href="/tutorials.html" class="nav-link">
|
| 88 |
+
<i data-feather="book-open"></i>
|
| 89 |
+
Tutorials
|
| 90 |
+
</a>
|
| 91 |
+
</li>
|
| 92 |
+
<li>
|
| 93 |
+
<a href="/community.html" class="nav-link">
|
| 94 |
+
<i data-feather="users"></i>
|
| 95 |
+
Community
|
| 96 |
+
</a>
|
| 97 |
+
</li>
|
| 98 |
+
</ul>
|
| 99 |
+
</nav>
|
| 100 |
+
`;
|
| 101 |
+
}
|
| 102 |
+
}
|
| 103 |
+
|
| 104 |
+
customElements.define('custom-navbar', CustomNavbar);
|
index.html
CHANGED
|
@@ -1,19 +1,252 @@
|
|
| 1 |
-
<!
|
| 2 |
-
<html>
|
| 3 |
-
|
| 4 |
-
|
| 5 |
-
|
| 6 |
-
|
| 7 |
-
|
| 8 |
-
|
| 9 |
-
|
| 10 |
-
|
| 11 |
-
|
| 12 |
-
|
| 13 |
-
|
| 14 |
-
|
| 15 |
-
|
| 16 |
-
|
| 17 |
-
|
| 18 |
-
|
| 19 |
-
<
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 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>PixelAlchemy Studio | AI Photo Editor</title>
|
| 7 |
+
<link rel="stylesheet" href="style.css">
|
| 8 |
+
<!-- External Scripts -->
|
| 9 |
+
<script src="https://cdn.tailwindcss.com"></script>
|
| 10 |
+
<script src="https://cdn.jsdelivr.net/npm/feather-icons/dist/feather.min.js"></script>
|
| 11 |
+
<!-- TensorFlow only loaded if needed -->
|
| 12 |
+
</head>
|
| 13 |
+
<body class="bg-gray-900 text-white">
|
| 14 |
+
<custom-navbar></custom-navbar>
|
| 15 |
+
|
| 16 |
+
<main class="container mx-auto px-4 py-8">
|
| 17 |
+
<div class="grid grid-cols-1 lg:grid-cols-3 gap-8">
|
| 18 |
+
<!-- Editor Section -->
|
| 19 |
+
<div class="lg:col-span-2 bg-gray-800 rounded-xl p-6 shadow-2xl">
|
| 20 |
+
<div class="flex justify-between items-center mb-6">
|
| 21 |
+
<h2 class="text-2xl font-bold">AI Canvas</h2>
|
| 22 |
+
<div class="flex space-x-2">
|
| 23 |
+
<button id="undo-btn" class="bg-gray-700 hover:bg-gray-600 px-3 py-2 rounded-lg flex items-center">
|
| 24 |
+
<i data-feather="corner-up-left" class="mr-1"></i> Undo
|
| 25 |
+
</button>
|
| 26 |
+
<button id="redo-btn" class="bg-gray-700 hover:bg-gray-600 px-3 py-2 rounded-lg flex items-center">
|
| 27 |
+
<i data-feather="corner-up-right" class="mr-1"></i> Redo
|
| 28 |
+
</button>
|
| 29 |
+
</div>
|
| 30 |
+
</div>
|
| 31 |
+
|
| 32 |
+
<div class="relative bg-black rounded-lg overflow-hidden" style="height: 500px;">
|
| 33 |
+
<canvas id="editor-canvas" class="w-full h-full"></canvas>
|
| 34 |
+
<div id="tool-overlay" class="absolute top-0 left-0 w-full h-full pointer-events-none"></div>
|
| 35 |
+
</div>
|
| 36 |
+
|
| 37 |
+
<div class="mt-4 flex flex-wrap gap-2">
|
| 38 |
+
<button id="import-btn" class="bg-indigo-600 hover:bg-indigo-700 px-4 py-2 rounded-lg flex items-center">
|
| 39 |
+
<i data-feather="upload" class="mr-2"></i> Import
|
| 40 |
+
</button>
|
| 41 |
+
<button id="export-btn" class="bg-emerald-600 hover:bg-emerald-700 px-4 py-2 rounded-lg flex items-center">
|
| 42 |
+
<i data-feather="download" class="mr-2"></i> Export
|
| 43 |
+
</button>
|
| 44 |
+
<input type="file" id="file-input" accept="image/*" class="hidden">
|
| 45 |
+
</div>
|
| 46 |
+
</div>
|
| 47 |
+
|
| 48 |
+
<!-- Tools Panel -->
|
| 49 |
+
<div class="bg-gray-800 rounded-xl p-6 shadow-2xl">
|
| 50 |
+
<h2 class="text-2xl font-bold mb-6">Alchemy Tools</h2>
|
| 51 |
+
|
| 52 |
+
<div class="space-y-6">
|
| 53 |
+
<!-- Diffusion Controls -->
|
| 54 |
+
<div class="bg-gray-700 p-4 rounded-lg">
|
| 55 |
+
<h3 class="font-semibold text-lg mb-3 flex items-center">
|
| 56 |
+
<i data-feather="zap" class="mr-2"></i> Seedance 4.0
|
| 57 |
+
</h3>
|
| 58 |
+
|
| 59 |
+
<div class="space-y-4">
|
| 60 |
+
<div>
|
| 61 |
+
<label class="block text-sm mb-1">Prompt Magic</label>
|
| 62 |
+
<textarea id="diffusion-prompt" rows="2" class="w-full bg-gray-600 rounded p-2 text-sm" placeholder="Describe your magical edit..."></textarea>
|
| 63 |
+
</div>
|
| 64 |
+
|
| 65 |
+
<div class="grid grid-cols-2 gap-2">
|
| 66 |
+
<div>
|
| 67 |
+
<label class="block text-sm mb-1">Creativity</label>
|
| 68 |
+
<input id="creativity-slider" type="range" min="0" max="100" value="50" class="w-full">
|
| 69 |
+
</div>
|
| 70 |
+
<div>
|
| 71 |
+
<label class="block text-sm mb-1">Strength</label>
|
| 72 |
+
<input id="strength-slider" type="range" min="0" max="100" value="70" class="w-full">
|
| 73 |
+
</div>
|
| 74 |
+
</div>
|
| 75 |
+
|
| 76 |
+
<div>
|
| 77 |
+
<label class="block text-sm mb-1">Seed</label>
|
| 78 |
+
<div class="flex">
|
| 79 |
+
<input id="seed-input" type="number" class="bg-gray-600 rounded-l p-2 text-sm w-full" placeholder="Random">
|
| 80 |
+
<button id="random-seed-btn" class="bg-gray-500 hover:bg-gray-400 px-3 rounded-r">
|
| 81 |
+
<i data-feather="refresh-cw" class="w-4"></i>
|
| 82 |
+
</button>
|
| 83 |
+
</div>
|
| 84 |
+
</div>
|
| 85 |
+
|
| 86 |
+
<button id="apply-diffusion-btn" class="w-full bg-purple-600 hover:bg-purple-700 py-2 rounded-lg flex items-center justify-center">
|
| 87 |
+
<i data-feather="sparkles" class="mr-2"></i> Generate Magic
|
| 88 |
+
</button>
|
| 89 |
+
</div>
|
| 90 |
+
</div>
|
| 91 |
+
|
| 92 |
+
<!-- Chat Edit Panel -->
|
| 93 |
+
<div class="bg-gray-700 p-4 rounded-lg">
|
| 94 |
+
<h3 class="font-semibold text-lg mb-3 flex items-center">
|
| 95 |
+
<i data-feather="message-square" class="mr-2"></i> Chat Edit
|
| 96 |
+
</h3>
|
| 97 |
+
|
| 98 |
+
<div id="chat-messages" class="h-32 overflow-y-auto mb-3 bg-gray-600 rounded p-2 text-sm"></div>
|
| 99 |
+
|
| 100 |
+
<div class="flex">
|
| 101 |
+
<input id="chat-input" type="text" class="bg-gray-600 rounded-l p-2 text-sm w-full" placeholder="Ask the AI to edit (e.g., 'make background blurry')">
|
| 102 |
+
<button id="send-chat-btn" class="bg-blue-600 hover:bg-blue-700 px-3 rounded-r">
|
| 103 |
+
<i data-feather="send" class="w-4"></i>
|
| 104 |
+
</button>
|
| 105 |
+
</div>
|
| 106 |
+
</div>
|
| 107 |
+
|
| 108 |
+
<!-- Quick Tools -->
|
| 109 |
+
<div class="bg-gray-700 p-4 rounded-lg">
|
| 110 |
+
<h3 class="font-semibold text-lg mb-3">Quick Tools</h3>
|
| 111 |
+
|
| 112 |
+
<div class="grid grid-cols-3 gap-2">
|
| 113 |
+
<button class="tool-btn bg-gray-600 hover:bg-gray-500 p-2 rounded-lg flex flex-col items-center">
|
| 114 |
+
<i data-feather="droplet"></i>
|
| 115 |
+
<span class="text-xs mt-1">Colorize</span>
|
| 116 |
+
</button>
|
| 117 |
+
<button class="tool-btn bg-gray-600 hover:bg-gray-500 p-2 rounded-lg flex flex-col items-center">
|
| 118 |
+
<i data-feather="eye"></i>
|
| 119 |
+
<span class="text-xs mt-1">Enhance</span>
|
| 120 |
+
</button>
|
| 121 |
+
<button class="tool-btn bg-gray-600 hover:bg-gray-500 p-2 rounded-lg flex flex-col items-center">
|
| 122 |
+
<i data-feather="scissors"></i>
|
| 123 |
+
<span class="text-xs mt-1">Cutout</span>
|
| 124 |
+
</button>
|
| 125 |
+
<button class="tool-btn bg-gray-600 hover:bg-gray-500 p-2 rounded-lg flex flex-col items-center">
|
| 126 |
+
<i data-feather="sun"></i>
|
| 127 |
+
<span class="text-xs mt-1">Light</span>
|
| 128 |
+
</button>
|
| 129 |
+
<button class="tool-btn bg-gray-600 hover:bg-gray-500 p-2 rounded-lg flex flex-col items-center">
|
| 130 |
+
<i data-feather="sliders"></i>
|
| 131 |
+
<span class="text-xs mt-1">Filter</span>
|
| 132 |
+
</button>
|
| 133 |
+
<button class="tool-btn bg-gray-600 hover:bg-gray-500 p-2 rounded-lg flex flex-col items-center">
|
| 134 |
+
<i data-feather="rotate-cw"></i>
|
| 135 |
+
<span class="text-xs mt-1">Upscale</span>
|
| 136 |
+
</button>
|
| 137 |
+
</div>
|
| 138 |
+
</div>
|
| 139 |
+
</div>
|
| 140 |
+
</div>
|
| 141 |
+
</div>
|
| 142 |
+
</main>
|
| 143 |
+
|
| 144 |
+
<custom-footer></custom-footer>
|
| 145 |
+
|
| 146 |
+
<script src="components/navbar.js"></script>
|
| 147 |
+
<script src="components/footer.js"></script>
|
| 148 |
+
<script src="script.js"></script>
|
| 149 |
+
<!-- Initialize Feather Icons -->
|
| 150 |
+
<script>
|
| 151 |
+
document.addEventListener('DOMContentLoaded', () => {
|
| 152 |
+
feather.replace();
|
| 153 |
+
// Initialize canvas and tools
|
| 154 |
+
document.addEventListener('DOMContentLoaded', () => {
|
| 155 |
+
const canvas = document.getElementById('editor-canvas');
|
| 156 |
+
const ctx = canvas.getContext('2d');
|
| 157 |
+
|
| 158 |
+
// Set canvas size
|
| 159 |
+
function resizeCanvas() {
|
| 160 |
+
const container = canvas.parentElement;
|
| 161 |
+
canvas.width = container.clientWidth;
|
| 162 |
+
canvas.height = container.clientHeight;
|
| 163 |
+
|
| 164 |
+
// Draw placeholder
|
| 165 |
+
ctx.fillStyle = '#111';
|
| 166 |
+
ctx.fillRect(0, 0, canvas.width, canvas.height);
|
| 167 |
+
ctx.fillStyle = '#333';
|
| 168 |
+
ctx.font = '16px Arial';
|
| 169 |
+
ctx.textAlign = 'center';
|
| 170 |
+
ctx.fillText('Import an image or start with AI generation', canvas.width/2, canvas.height/2);
|
| 171 |
+
}
|
| 172 |
+
|
| 173 |
+
window.addEventListener('resize', resizeCanvas);
|
| 174 |
+
resizeCanvas();
|
| 175 |
+
|
| 176 |
+
// Handle file import
|
| 177 |
+
document.getElementById('import-btn').addEventListener('click', () => {
|
| 178 |
+
document.getElementById('file-input').click();
|
| 179 |
+
});
|
| 180 |
+
|
| 181 |
+
document.getElementById('file-input').addEventListener('change', (e) => {
|
| 182 |
+
const file = e.target.files[0];
|
| 183 |
+
if (file) {
|
| 184 |
+
const reader = new FileReader();
|
| 185 |
+
reader.onload = (event) => {
|
| 186 |
+
const img = new Image();
|
| 187 |
+
img.onload = () => {
|
| 188 |
+
canvas.width = img.width;
|
| 189 |
+
canvas.height = img.height;
|
| 190 |
+
ctx.drawImage(img, 0, 0);
|
| 191 |
+
};
|
| 192 |
+
img.src = event.target.result;
|
| 193 |
+
};
|
| 194 |
+
reader.readAsDataURL(file);
|
| 195 |
+
}
|
| 196 |
+
});
|
| 197 |
+
|
| 198 |
+
// Chat functionality
|
| 199 |
+
document.getElementById('send-chat-btn').addEventListener('click', () => {
|
| 200 |
+
const chatInput = document.getElementById('chat-input');
|
| 201 |
+
const chatMessages = document.getElementById('chat-messages');
|
| 202 |
+
|
| 203 |
+
if (chatInput.value.trim()) {
|
| 204 |
+
// Add user message
|
| 205 |
+
chatMessages.innerHTML += `<div class="text-right mb-2"><span class="bg-blue-600 rounded-lg px-3 py-1 inline-block">${chatInput.value}</span></div>`;
|
| 206 |
+
|
| 207 |
+
// Simulate AI response
|
| 208 |
+
setTimeout(() => {
|
| 209 |
+
chatMessages.innerHTML += `<div class="text-left mb-2"><span class="bg-gray-500 rounded-lg px-3 py-1 inline-block">Applying "${chatInput.value}" to your image...</span></div>`;
|
| 210 |
+
chatMessages.scrollTop = chatMessages.scrollHeight;
|
| 211 |
+
}, 800);
|
| 212 |
+
|
| 213 |
+
chatInput.value = '';
|
| 214 |
+
}
|
| 215 |
+
});
|
| 216 |
+
|
| 217 |
+
// Seedance generation
|
| 218 |
+
document.getElementById('apply-diffusion-btn').addEventListener('click', () => {
|
| 219 |
+
const prompt = document.getElementById('diffusion-prompt').value;
|
| 220 |
+
if (prompt.trim()) {
|
| 221 |
+
// Simulate generation
|
| 222 |
+
ctx.fillStyle = '#222';
|
| 223 |
+
ctx.fillRect(0, 0, canvas.width, canvas.height);
|
| 224 |
+
ctx.fillStyle = '#eee';
|
| 225 |
+
ctx.font = '16px Arial';
|
| 226 |
+
ctx.textAlign = 'center';
|
| 227 |
+
ctx.fillText(`Generating magic with: "${prompt}"`, canvas.width/2, canvas.height/2);
|
| 228 |
+
|
| 229 |
+
setTimeout(() => {
|
| 230 |
+
// Simulate finished generation
|
| 231 |
+
ctx.fillStyle = '#111';
|
| 232 |
+
ctx.fillRect(0, 0, canvas.width, canvas.height);
|
| 233 |
+
ctx.fillStyle = '#4ade80';
|
| 234 |
+
ctx.font = 'bold 24px Arial';
|
| 235 |
+
ctx.textAlign = 'center';
|
| 236 |
+
ctx.fillText('Your AI masterpiece is ready!', canvas.width/2, canvas.height/2 - 20);
|
| 237 |
+
ctx.fillStyle = '#aaa';
|
| 238 |
+
ctx.font = '14px Arial';
|
| 239 |
+
ctx.fillText('(This would show your actual generated image)', canvas.width/2, canvas.height/2 + 20);
|
| 240 |
+
}, 2500);
|
| 241 |
+
}
|
| 242 |
+
});
|
| 243 |
+
|
| 244 |
+
// Random seed
|
| 245 |
+
document.getElementById('random-seed-btn').addEventListener('click', () => {
|
| 246 |
+
document.getElementById('seed-input').value = Math.floor(Math.random() * 1000000);
|
| 247 |
+
});
|
| 248 |
+
});
|
| 249 |
+
</script>
|
| 250 |
+
<script src="https://deepsite.hf.co/deepsite-badge.js"></script>
|
| 251 |
+
</body>
|
| 252 |
+
</html>
|
script.js
ADDED
|
@@ -0,0 +1,82 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
|
| 2 |
+
// Shared functionality across the app
|
| 3 |
+
class PixelAlchemyApp {
|
| 4 |
+
constructor() {
|
| 5 |
+
this.historyStack = [];
|
| 6 |
+
this.currentHistoryIndex = -1;
|
| 7 |
+
}
|
| 8 |
+
|
| 9 |
+
init() {
|
| 10 |
+
console.log('PixelAlchemy Studio initialized');
|
| 11 |
+
|
| 12 |
+
// Initialize components
|
| 13 |
+
this.setupExport();
|
| 14 |
+
this.setupTools();
|
| 15 |
+
}
|
| 16 |
+
|
| 17 |
+
setupExport() {
|
| 18 |
+
const exportBtn = document.getElementById('export-btn');
|
| 19 |
+
if (exportBtn) {
|
| 20 |
+
exportBtn.addEventListener('click', () => {
|
| 21 |
+
const canvas = document.getElementById('editor-canvas');
|
| 22 |
+
if (canvas) {
|
| 23 |
+
const link = document.createElement('a');
|
| 24 |
+
link.download = 'pixelalchemy-edit.png';
|
| 25 |
+
link.href = canvas.toDataURL('image/png');
|
| 26 |
+
link.click();
|
| 27 |
+
}
|
| 28 |
+
});
|
| 29 |
+
}
|
| 30 |
+
}
|
| 31 |
+
|
| 32 |
+
setupTools() {
|
| 33 |
+
document.querySelectorAll('.tool-btn').forEach(btn => {
|
| 34 |
+
btn.addEventListener('click', function() {
|
| 35 |
+
const toolName = this.querySelector('span')?.textContent;
|
| 36 |
+
if (toolName) {
|
| 37 |
+
console.log(`Selected tool: ${toolName}`);
|
| 38 |
+
// In a real app, this would activate the specific tool
|
| 39 |
+
}
|
| 40 |
+
});
|
| 41 |
+
});
|
| 42 |
+
}
|
| 43 |
+
|
| 44 |
+
// Simulated AI functions
|
| 45 |
+
async generateDiffusionImage(prompt, strength, creativity, seed) {
|
| 46 |
+
if (!prompt) return { success: false, message: "Prompt is required" };
|
| 47 |
+
|
| 48 |
+
console.log(`Generating image with prompt: ${prompt}`);
|
| 49 |
+
// This would call the actual Seedance 4.0 API
|
| 50 |
+
return new Promise(resolve => {
|
| 51 |
+
setTimeout(() => {
|
| 52 |
+
resolve({
|
| 53 |
+
success: true,
|
| 54 |
+
image: null, // Would be the generated image data
|
| 55 |
+
message: "Successfully generated image"
|
| 56 |
+
});
|
| 57 |
+
}, 1500);
|
| 58 |
+
});
|
| 59 |
+
}
|
| 60 |
+
|
| 61 |
+
async processChatEdit(command, imageData) {
|
| 62 |
+
if (!command) return { success: false, message: "Command is required" };
|
| 63 |
+
|
| 64 |
+
console.log(`Processing chat command: ${command}`);
|
| 65 |
+
// This would call an AI editing API
|
| 66 |
+
return new Promise(resolve => {
|
| 67 |
+
setTimeout(() => {
|
| 68 |
+
resolve({
|
| 69 |
+
success: true,
|
| 70 |
+
image: null, // Would be the modified image
|
| 71 |
+
message: `Applied: ${command}`
|
| 72 |
+
});
|
| 73 |
+
}, 1000);
|
| 74 |
+
});
|
| 75 |
+
}
|
| 76 |
+
}
|
| 77 |
+
|
| 78 |
+
// Initialize the app when DOM is ready
|
| 79 |
+
document.addEventListener('DOMContentLoaded', () => {
|
| 80 |
+
const app = new PixelAlchemyApp();
|
| 81 |
+
app.init();
|
| 82 |
+
});
|
style.css
CHANGED
|
@@ -1,28 +1,70 @@
|
|
|
|
|
|
|
|
| 1 |
body {
|
| 2 |
-
|
| 3 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 4 |
}
|
| 5 |
|
| 6 |
-
|
| 7 |
-
|
| 8 |
-
|
|
|
|
|
|
|
| 9 |
}
|
| 10 |
|
| 11 |
-
|
| 12 |
-
|
| 13 |
-
|
| 14 |
-
|
| 15 |
-
|
|
|
|
| 16 |
}
|
| 17 |
|
| 18 |
-
|
| 19 |
-
|
| 20 |
-
|
| 21 |
-
|
| 22 |
-
border: 1px solid lightgray;
|
| 23 |
-
border-radius: 16px;
|
| 24 |
}
|
| 25 |
|
| 26 |
-
|
| 27 |
-
|
|
|
|
| 28 |
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700&display=swap');
|
| 2 |
+
|
| 3 |
body {
|
| 4 |
+
font-family: 'Inter', sans-serif;
|
| 5 |
+
min-height: 100vh;
|
| 6 |
+
display: flex;
|
| 7 |
+
flex-direction: column;
|
| 8 |
+
}
|
| 9 |
+
|
| 10 |
+
/* Custom scrollbar */
|
| 11 |
+
::-webkit-scrollbar {
|
| 12 |
+
width: 8px;
|
| 13 |
+
height: 8px;
|
| 14 |
+
}
|
| 15 |
+
|
| 16 |
+
::-webkit-scrollbar-track {
|
| 17 |
+
background: #2d3748;
|
| 18 |
+
}
|
| 19 |
+
|
| 20 |
+
::-webkit-scrollbar-thumb {
|
| 21 |
+
background: #4a5568;
|
| 22 |
+
border-radius: 4px;
|
| 23 |
+
}
|
| 24 |
+
|
| 25 |
+
::-webkit-scrollbar-thumb:hover {
|
| 26 |
+
background: #718096;
|
| 27 |
}
|
| 28 |
|
| 29 |
+
/* Tool buttons hover effect */
|
| 30 |
+
.tool-btn:hover {
|
| 31 |
+
transform: translateY(-2px);
|
| 32 |
+
box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.2);
|
| 33 |
+
transition: all 0.2s ease;
|
| 34 |
}
|
| 35 |
|
| 36 |
+
/* Canvas styling */
|
| 37 |
+
#editor-canvas {
|
| 38 |
+
image-rendering: -moz-crisp-edges;
|
| 39 |
+
image-rendering: -webkit-crisp-edges;
|
| 40 |
+
image-rendering: pixelated;
|
| 41 |
+
image-rendering: crisp-edges;
|
| 42 |
}
|
| 43 |
|
| 44 |
+
/* Chat messages styling */
|
| 45 |
+
#chat-messages div {
|
| 46 |
+
word-wrap: break-word;
|
| 47 |
+
animation: fadeIn 0.3s ease;
|
|
|
|
|
|
|
| 48 |
}
|
| 49 |
|
| 50 |
+
@keyframes fadeIn {
|
| 51 |
+
from { opacity: 0; transform: translateY(5px); }
|
| 52 |
+
to { opacity: 1; transform: translateY(0); }
|
| 53 |
}
|
| 54 |
+
|
| 55 |
+
/* Range slider styling */
|
| 56 |
+
input[type="range"] {
|
| 57 |
+
-webkit-appearance: none;
|
| 58 |
+
height: 6px;
|
| 59 |
+
background: #4a5568;
|
| 60 |
+
border-radius: 3px;
|
| 61 |
+
}
|
| 62 |
+
|
| 63 |
+
input[type="range"]::-webkit-slider-thumb {
|
| 64 |
+
-webkit-appearance: none;
|
| 65 |
+
width: 16px;
|
| 66 |
+
height: 16px;
|
| 67 |
+
background: #8b5cf6;
|
| 68 |
+
border-radius: 50%;
|
| 69 |
+
cursor: pointer;
|
| 70 |
+
}
|