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|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 16 |
</body>
|
| 17 |
</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>π₯ NexaClothes - AI Sexy Image Generator</title>
|
| 7 |
+
<style>
|
| 8 |
+
* { margin: 0; padding: 0; box-sizing: border-box; }
|
| 9 |
+
body {
|
| 10 |
+
font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
|
| 11 |
+
background: linear-gradient(135deg, #667eea 0%, #764ba2 50%, #f093fb 100%);
|
| 12 |
+
min-height: 100vh;
|
| 13 |
+
color: white;
|
| 14 |
+
overflow-x: hidden;
|
| 15 |
+
}
|
| 16 |
+
.container {
|
| 17 |
+
max-width: 1200px;
|
| 18 |
+
margin: 0 auto;
|
| 19 |
+
padding: 20px;
|
| 20 |
+
}
|
| 21 |
+
.header {
|
| 22 |
+
text-align: center;
|
| 23 |
+
margin-bottom: 30px;
|
| 24 |
+
}
|
| 25 |
+
.header h1 {
|
| 26 |
+
font-size: 3em;
|
| 27 |
+
background: linear-gradient(45deg, #ff6b6b, #4ecdc4, #45b7d1);
|
| 28 |
+
-webkit-background-clip: text;
|
| 29 |
+
-webkit-text-fill-color: transparent;
|
| 30 |
+
margin-bottom: 10px;
|
| 31 |
+
}
|
| 32 |
+
.upload-zone {
|
| 33 |
+
border: 3px dashed #ff6b6b;
|
| 34 |
+
border-radius: 20px;
|
| 35 |
+
padding: 40px;
|
| 36 |
+
text-align: center;
|
| 37 |
+
background: rgba(255,255,255,0.1);
|
| 38 |
+
backdrop-filter: blur(10px);
|
| 39 |
+
margin-bottom: 30px;
|
| 40 |
+
cursor: pointer;
|
| 41 |
+
transition: all 0.3s;
|
| 42 |
+
}
|
| 43 |
+
.upload-zone:hover {
|
| 44 |
+
border-color: #4ecdc4;
|
| 45 |
+
background: rgba(255,255,255,0.2);
|
| 46 |
+
}
|
| 47 |
+
.upload-zone.dragover {
|
| 48 |
+
border-color: #4ecdc4;
|
| 49 |
+
transform: scale(1.02);
|
| 50 |
+
}
|
| 51 |
+
#photo-preview {
|
| 52 |
+
max-width: 300px;
|
| 53 |
+
max-height: 400px;
|
| 54 |
+
border-radius: 15px;
|
| 55 |
+
margin: 20px 0;
|
| 56 |
+
box-shadow: 0 20px 40px rgba(0,0,0,0.3);
|
| 57 |
+
}
|
| 58 |
+
.clothes-grid {
|
| 59 |
+
display: grid;
|
| 60 |
+
grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
|
| 61 |
+
gap: 20px;
|
| 62 |
+
margin: 30px 0;
|
| 63 |
+
}
|
| 64 |
+
.clothes-card {
|
| 65 |
+
background: rgba(255,255,255,0.1);
|
| 66 |
+
padding: 20px;
|
| 67 |
+
border-radius: 15px;
|
| 68 |
+
backdrop-filter: blur(10px);
|
| 69 |
+
border: 1px solid rgba(255,255,255,0.2);
|
| 70 |
+
}
|
| 71 |
+
.clothes-card select, .clothes-card input {
|
| 72 |
+
width: 100%;
|
| 73 |
+
padding: 12px;
|
| 74 |
+
border: none;
|
| 75 |
+
border-radius: 10px;
|
| 76 |
+
background: rgba(255,255,255,0.9);
|
| 77 |
+
margin: 10px 0;
|
| 78 |
+
font-size: 16px;
|
| 79 |
+
}
|
| 80 |
+
.btn {
|
| 81 |
+
background: linear-gradient(45deg, #ff6b6b, #ee5a24);
|
| 82 |
+
color: white;
|
| 83 |
+
border: none;
|
| 84 |
+
padding: 15px 30px;
|
| 85 |
+
border-radius: 50px;
|
| 86 |
+
font-size: 18px;
|
| 87 |
+
font-weight: bold;
|
| 88 |
+
cursor: pointer;
|
| 89 |
+
transition: all 0.3s;
|
| 90 |
+
width: 100%;
|
| 91 |
+
margin: 10px 0;
|
| 92 |
+
}
|
| 93 |
+
.btn:hover {
|
| 94 |
+
transform: translateY(-2px);
|
| 95 |
+
box-shadow: 0 10px 25px rgba(255,107,107,0.4);
|
| 96 |
+
}
|
| 97 |
+
.btn-success {
|
| 98 |
+
background: linear-gradient(45deg, #4ecdc4, #44a08d);
|
| 99 |
+
}
|
| 100 |
+
.image-container {
|
| 101 |
+
text-align: center;
|
| 102 |
+
margin: 40px 0;
|
| 103 |
+
}
|
| 104 |
+
#generated-image {
|
| 105 |
+
max-width: 100%;
|
| 106 |
+
max-height: 500px;
|
| 107 |
+
border-radius: 20px;
|
| 108 |
+
box-shadow: 0 25px 50px rgba(0,0,0,0.4);
|
| 109 |
+
border: 5px solid #4ecdc4;
|
| 110 |
+
}
|
| 111 |
+
.status {
|
| 112 |
+
background: rgba(0,0,0,0.3);
|
| 113 |
+
padding: 20px;
|
| 114 |
+
border-radius: 15px;
|
| 115 |
+
margin: 20px 0;
|
| 116 |
+
font-family: monospace;
|
| 117 |
+
max-height: 300px;
|
| 118 |
+
overflow-y: auto;
|
| 119 |
+
}
|
| 120 |
+
@keyframes pulse {
|
| 121 |
+
0%, 100% { opacity: 1; }
|
| 122 |
+
50% { opacity: 0.7; }
|
| 123 |
+
}
|
| 124 |
+
.loading { animation: pulse 1.5s infinite; }
|
| 125 |
+
</style>
|
| 126 |
+
</head>
|
| 127 |
<body>
|
| 128 |
+
<div class="container">
|
| 129 |
+
<div class="header">
|
| 130 |
+
<h1>π₯ NexaClothes</h1>
|
| 131 |
+
<p>AI Sexy Clothes Changer β’ Upload β Change β Generate</p>
|
| 132 |
+
</div>
|
| 133 |
+
|
| 134 |
+
<!-- UPLOAD ZONE -->
|
| 135 |
+
<div class="upload-zone" onclick="document.getElementById('photo').click()">
|
| 136 |
+
<h3>πΈ Drop Your Photo Here</h3>
|
| 137 |
+
<p>or click to select (JPG/PNG)</p>
|
| 138 |
+
<input type="file" id="photo" accept="image/*" style="display:none">
|
| 139 |
+
<img id="photo-preview" style="display:none">
|
| 140 |
+
</div>
|
| 141 |
+
|
| 142 |
+
<!-- CLOTHES CHANGER -->
|
| 143 |
+
<div class="clothes-grid">
|
| 144 |
+
<div class="clothes-card">
|
| 145 |
+
<h3>π Top</h3>
|
| 146 |
+
<select id="top">
|
| 147 |
+
<option>crop_top_black</option>
|
| 148 |
+
<option>sheer_top_white</option>
|
| 149 |
+
<option>bikini_top_red</option>
|
| 150 |
+
<option>mesh_top</option>
|
| 151 |
+
</select>
|
| 152 |
+
<button class="btn" onclick="changeClothes('top')">Change Top</button>
|
| 153 |
+
</div>
|
| 154 |
+
|
| 155 |
+
<div class="clothes-card">
|
| 156 |
+
<h3>π Bra</h3>
|
| 157 |
+
<select id="bra">
|
| 158 |
+
<option>pushup_black</option>
|
| 159 |
+
<option>lace_pink</option>
|
| 160 |
+
<option>(none)</option>
|
| 161 |
+
</select>
|
| 162 |
+
<button class="btn" onclick="changeClothes('bra')">Change Bra</button>
|
| 163 |
+
</div>
|
| 164 |
+
|
| 165 |
+
<div class="clothes-card">
|
| 166 |
+
<h3>π Boobs</h3>
|
| 167 |
+
<select id="boobs">
|
| 168 |
+
<option>visible</option>
|
| 169 |
+
<option>nipple_show</option>
|
| 170 |
+
<option>enhanced</option>
|
| 171 |
+
</select>
|
| 172 |
+
<button class="btn" onclick="changeClothes('boobs')">Set Visibility</button>
|
| 173 |
+
</div>
|
| 174 |
+
|
| 175 |
+
<div class="clothes-card">
|
| 176 |
+
<h3>π Bottom</h3>
|
| 177 |
+
<select id="bottom">
|
| 178 |
+
<option>miniskirt_red</option>
|
| 179 |
+
<option>thong_visible</option>
|
| 180 |
+
<option>hotpants_black</option>
|
| 181 |
+
</select>
|
| 182 |
+
<button class="btn" onclick="changeClothes('bottom')">Change Bottom</button>
|
| 183 |
+
</div>
|
| 184 |
+
</div>
|
| 185 |
+
|
| 186 |
+
<!-- GENERATE BUTTON -->
|
| 187 |
+
<div style="text-align:center; margin:40px 0">
|
| 188 |
+
<button class="btn btn-success" style="font-size:22px; padding:20px 60px" onclick="generateImage()">
|
| 189 |
+
π¨ AI GENERATE SEXY IMAGE
|
| 190 |
+
</button>
|
| 191 |
+
</div>
|
| 192 |
+
|
| 193 |
+
<!-- RESULT -->
|
| 194 |
+
<div class="image-container" id="image-container" style="display:none">
|
| 195 |
+
<h2>β¨ Your New Sexy Look</h2>
|
| 196 |
+
<img id="generated-image" alt="Generated">
|
| 197 |
+
</div>
|
| 198 |
+
|
| 199 |
+
<!-- STATUS -->
|
| 200 |
+
<div class="status" id="status">π Upload photo β Change clothes β Generate image!</div>
|
| 201 |
+
</div>
|
| 202 |
+
|
| 203 |
+
<script>
|
| 204 |
+
const API_BASE = location.origin;
|
| 205 |
+
const USER_ID = 'nexa_user';
|
| 206 |
+
let originalPhoto = null;
|
| 207 |
+
|
| 208 |
+
// Drag & Drop
|
| 209 |
+
const uploadZone = document.querySelector('.upload-zone');
|
| 210 |
+
uploadZone.addEventListener('dragover', (e) => {
|
| 211 |
+
e.preventDefault();
|
| 212 |
+
uploadZone.classList.add('dragover');
|
| 213 |
+
});
|
| 214 |
+
uploadZone.addEventListener('dragleave', () => {
|
| 215 |
+
uploadZone.classList.remove('dragover');
|
| 216 |
+
});
|
| 217 |
+
uploadZone.addEventListener('drop', async (e) => {
|
| 218 |
+
e.preventDefault();
|
| 219 |
+
uploadZone.classList.remove('dragover');
|
| 220 |
+
const file = e.dataTransfer.files[0];
|
| 221 |
+
await handleFile(file);
|
| 222 |
+
});
|
| 223 |
+
|
| 224 |
+
document.getElementById('photo').addEventListener('change', (e) => {
|
| 225 |
+
handleFile(e.target.files[0]);
|
| 226 |
+
});
|
| 227 |
+
|
| 228 |
+
async function handleFile(file) {
|
| 229 |
+
if (!file) return;
|
| 230 |
+
|
| 231 |
+
const formData = new FormData();
|
| 232 |
+
formData.append('photo', file);
|
| 233 |
+
formData.append('userId', USER_ID);
|
| 234 |
+
|
| 235 |
+
updateStatus('π€ Uploading photo...');
|
| 236 |
+
const r = await fetch(`${API_BASE}/api/upload-photo`, {
|
| 237 |
+
method: 'POST',
|
| 238 |
+
body: formData
|
| 239 |
+
});
|
| 240 |
+
const result = await r.json();
|
| 241 |
+
|
| 242 |
+
if (result.success) {
|
| 243 |
+
originalPhoto = URL.createObjectURL(file);
|
| 244 |
+
document.getElementById('photo-preview').src = originalPhoto;
|
| 245 |
+
document.getElementById('photo-preview').style.display = 'block';
|
| 246 |
+
updateStatus(`β
Photo uploaded! Now change clothes π`);
|
| 247 |
+
}
|
| 248 |
+
}
|
| 249 |
+
|
| 250 |
+
async function changeClothes(category) {
|
| 251 |
+
const select = document.getElementById(category);
|
| 252 |
+
const item = select.value === '(none)' ? null : select.value;
|
| 253 |
+
|
| 254 |
+
const r = await fetch(`${API_BASE}/api/avatar/${USER_ID}/clothes/${category}`, {
|
| 255 |
+
method: 'PATCH',
|
| 256 |
+
headers: { 'Content-Type': 'application/json' },
|
| 257 |
+
body: JSON.stringify({ item })
|
| 258 |
+
});
|
| 259 |
+
const result = await r.json();
|
| 260 |
+
updateStatus(`β
${category} changed to: ${item}`);
|
| 261 |
+
}
|
| 262 |
+
|
| 263 |
+
async function generateImage() {
|
| 264 |
+
updateStatus('π¨ Generating AI image...');
|
| 265 |
+
document.querySelector('.btn-success').textContent = 'Generating...';
|
| 266 |
+
document.querySelector('.btn-success').classList.add('loading');
|
| 267 |
+
|
| 268 |
+
const r = await fetch(`${API_BASE}/api/generate-image/${USER_ID}`);
|
| 269 |
+
const result = await r.json();
|
| 270 |
+
|
| 271 |
+
document.getElementById('generated-image').src = result.imageUrl;
|
| 272 |
+
document.getElementById('image-container').style.display = 'block';
|
| 273 |
+
updateStatus(`β¨ Generated! Prompt: ${result.prompt}`);
|
| 274 |
+
|
| 275 |
+
document.querySelector('.btn-success').textContent = 'β
IMAGE READY!';
|
| 276 |
+
document.querySelector('.btn-success').classList.remove('loading');
|
| 277 |
+
}
|
| 278 |
+
|
| 279 |
+
function updateStatus(text) {
|
| 280 |
+
document.getElementById('status').textContent = text;
|
| 281 |
+
}
|
| 282 |
+
</script>
|
| 283 |
</body>
|
| 284 |
</html>
|