Spaces:
Running
Running
File size: 26,319 Bytes
108675c | 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 565 566 567 568 569 570 571 572 573 574 575 576 577 578 579 580 581 582 583 584 585 586 587 588 589 590 591 592 593 594 595 596 597 598 599 600 601 602 603 604 605 606 607 608 609 610 611 612 613 614 615 616 617 618 619 620 621 622 623 624 625 626 627 628 629 630 631 632 633 634 635 636 637 638 639 640 641 642 643 644 645 646 647 648 649 650 651 652 653 654 655 656 657 658 659 660 661 662 663 664 665 666 667 668 669 670 671 672 673 674 675 676 677 678 679 680 681 682 683 684 685 686 687 688 689 690 691 692 693 694 695 696 697 698 699 700 701 702 703 704 705 706 707 708 709 710 711 712 713 714 715 716 717 718 719 720 721 722 723 724 725 726 727 728 729 730 731 732 733 734 735 736 737 738 739 740 741 742 743 744 745 746 747 748 749 750 751 752 753 754 755 756 757 758 759 760 761 762 763 764 765 766 767 768 769 770 771 772 773 774 775 776 777 778 779 780 781 782 783 784 785 786 787 788 789 790 791 792 793 794 795 796 797 798 799 800 801 802 803 804 805 806 807 808 | <!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Velvet AI - Generative Video Engine</title>
<!-- Fonts & Icons -->
<link rel="preconnect" href="https://fonts.googleapis.com">
<link rel="preconnect" href="https://fonts.gstatic.com" crossorigin>
<link href="https://fonts.googleapis.com/css2?family=Outfit:wght@300;400;500;600;700&display=swap" rel="stylesheet">
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.4.0/css/all.min.css">
<style>
:root {
--bg-body: #09090b;
--bg-panel: #18181b;
--bg-element: #27272a;
--primary: #e11d48; /* Pink/Red for the requested aesthetic */
--primary-hover: #be123c;
--accent: #8b5cf6;
--text-main: #ffffff;
--text-muted: #a1a1aa;
--border: #3f3f46;
--radius-lg: 16px;
--radius-md: 8px;
--radius-sm: 4px;
--shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.5);
--glow: 0 0 20px rgba(225, 29, 72, 0.3);
}
* {
box-sizing: border-box;
margin: 0;
padding: 0;
font-family: 'Outfit', sans-serif;
}
body {
background-color: var(--bg-body);
color: var(--text-main);
height: 100vh;
overflow: hidden;
display: flex;
}
/* --- Scrollbar --- */
::-webkit-scrollbar {
width: 6px;
}
::-webkit-scrollbar-track {
background: var(--bg-body);
}
::-webkit-scrollbar-thumb {
background: var(--border);
border-radius: 10px;
}
/* --- Sidebar --- */
.sidebar {
width: 260px;
background-color: var(--bg-panel);
border-right: 1px solid var(--border);
display: flex;
flex-direction: column;
padding: 1.5rem;
transition: transform 0.3s ease;
z-index: 50;
}
.logo {
font-size: 1.5rem;
font-weight: 700;
color: var(--primary);
margin-bottom: 2rem;
display: flex;
align-items: center;
gap: 0.5rem;
text-shadow: var(--glow);
}
.nav-menu {
list-style: none;
flex: 1;
}
.nav-item {
margin-bottom: 0.5rem;
}
.nav-link {
display: flex;
align-items: center;
gap: 1rem;
padding: 0.75rem 1rem;
color: var(--text-muted);
text-decoration: none;
border-radius: var(--radius-md);
transition: all 0.2s;
font-weight: 500;
}
.nav-link:hover, .nav-link.active {
background-color: var(--bg-element);
color: var(--text-main);
}
.nav-link.active {
border-left: 3px solid var(--primary);
}
.nav-link i {
width: 20px;
text-align: center;
}
.user-profile {
margin-top: auto;
padding-top: 1rem;
border-top: 1px solid var(--border);
display: flex;
align-items: center;
gap: 0.75rem;
}
.avatar {
width: 40px;
height: 40px;
border-radius: 50%;
background: linear-gradient(45deg, var(--primary), var(--accent));
display: flex;
align-items: center;
justify-content: center;
font-weight: bold;
}
.credits-badge {
background: rgba(225, 29, 72, 0.1);
color: var(--primary);
padding: 0.25rem 0.5rem;
border-radius: var(--radius-sm);
font-size: 0.75rem;
font-weight: 600;
border: 1px solid rgba(225, 29, 72, 0.2);
}
/* --- Main Content --- */
.main-content {
flex: 1;
display: flex;
flex-direction: column;
overflow: hidden;
position: relative;
}
/* --- Header --- */
.top-bar {
height: 70px;
border-bottom: 1px solid var(--border);
display: flex;
align-items: center;
justify-content: space-between;
padding: 0 2rem;
background-color: rgba(9, 9, 11, 0.8);
backdrop-filter: blur(10px);
z-index: 40;
}
.anycoder-link {
color: var(--text-muted);
text-decoration: none;
font-size: 0.875rem;
transition: color 0.2s;
display: flex;
align-items: center;
gap: 0.5rem;
}
.anycoder-link:hover {
color: var(--primary);
}
.mobile-menu-btn {
display: none;
background: none;
border: none;
color: var(--text-main);
font-size: 1.5rem;
cursor: pointer;
}
/* --- Generator Area --- */
.generator-container {
flex: 1;
display: flex;
overflow: hidden;
}
.controls-panel {
width: 400px;
padding: 2rem;
overflow-y: auto;
border-right: 1px solid var(--border);
}
.preview-panel {
flex: 1;
background-color: #000000;
display: flex;
flex-direction: column;
padding: 2rem;
overflow-y: auto;
}
/* --- Form Elements --- */
.form-group {
margin-bottom: 1.5rem;
}
.form-label {
display: block;
margin-bottom: 0.5rem;
font-size: 0.875rem;
font-weight: 500;
color: var(--text-muted);
display: flex;
justify-content: space-between;
}
.text-area {
width: 100%;
background-color: var(--bg-element);
border: 1px solid var(--border);
border-radius: var(--radius-md);
padding: 1rem;
color: var(--text-main);
resize: none;
height: 120px;
font-size: 0.95rem;
transition: border-color 0.2s;
}
.text-area:focus {
outline: none;
border-color: var(--primary);
}
.text-area::placeholder {
color: #52525b;
}
.slider-container {
display: flex;
align-items: center;
gap: 1rem;
}
input[type="range"] {
flex: 1;
height: 4px;
background: var(--bg-element);
border-radius: 2px;
appearance: none;
}
input[type="range"]::-webkit-slider-thumb {
appearance: none;
width: 16px;
height: 16px;
background: var(--primary);
border-radius: 50%;
cursor: pointer;
box-shadow: var(--glow);
}
.toggle-group {
display: flex;
justify-content: space-between;
align-items: center;
background: var(--bg-element);
padding: 0.75rem;
border-radius: var(--radius-md);
border: 1px solid var(--border);
}
.switch {
position: relative;
display: inline-block;
width: 44px;
height: 24px;
}
.switch input {
opacity: 0;
width: 0;
height: 0;
}
.slider {
position: absolute;
cursor: pointer;
top: 0;
left: 0;
right: 0;
bottom: 0;
background-color: #3f3f46;
transition: .4s;
border-radius: 24px;
}
.slider:before {
position: absolute;
content: "";
height: 18px;
width: 18px;
left: 3px;
bottom: 3px;
background-color: white;
transition: .4s;
border-radius: 50%;
}
input:checked + .slider {
background-color: var(--primary);
}
input:checked + .slider:before {
transform: translateX(20px);
}
.btn-generate {
width: 100%;
padding: 1rem;
background: linear-gradient(90deg, var(--primary), var(--accent));
border: none;
border-radius: var(--radius-md);
color: white;
font-weight: 700;
font-size: 1rem;
cursor: pointer;
transition: transform 0.2s, box-shadow 0.2s;
display: flex;
align-items: center;
justify-content: center;
gap: 0.5rem;
box-shadow: var(--glow);
}
.btn-generate:hover {
transform: translateY(-2px);
box-shadow: 0 0 30px rgba(225, 29, 72, 0.5);
}
.btn-generate:disabled {
opacity: 0.7;
cursor: not-allowed;
transform: none;
}
/* --- Select Box --- */
.select-box {
width: 100%;
padding: 0.75rem;
background: var(--bg-element);
border: 1px solid var(--border);
border-radius: var(--radius-md);
color: var(--text-main);
cursor: pointer;
}
/* --- Results Grid --- */
.results-grid {
display: grid;
grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
gap: 1.5rem;
}
.video-card {
background: var(--bg-panel);
border-radius: var(--radius-lg);
overflow: hidden;
border: 1px solid var(--border);
position: relative;
transition: transform 0.2s;
}
.video-card:hover {
transform: translateY(-5px);
border-color: var(--primary);
}
.video-placeholder {
width: 100%;
aspect-ratio: 16/9;
background: linear-gradient(135deg, #27272a 0%, #18181b 100%);
display: flex;
align-items: center;
justify-content: center;
position: relative;
}
.play-btn {
width: 50px;
height: 50px;
border-radius: 50%;
background: rgba(255,255,255,0.2);
backdrop-filter: blur(5px);
display: flex;
align-items: center;
justify-content: center;
color: white;
font-size: 1.2rem;
cursor: pointer;
transition: background 0.2s;
}
.play-btn:hover {
background: var(--primary);
}
.card-info {
padding: 1rem;
}
.card-prompt {
font-size: 0.9rem;
color: var(--text-main);
margin-bottom: 0.5rem;
white-space: nowrap;
overflow: hidden;
text-overflow: ellipsis;
}
.card-meta {
display: flex;
justify-content: space-between;
font-size: 0.75rem;
color: var(--text-muted);
}
.nsfw-badge {
background: #ef4444;
color: white;
font-size: 0.6rem;
padding: 2px 6px;
border-radius: 4px;
font-weight: bold;
text-transform: uppercase;
}
/* --- Loader --- */
.loader {
display: none;
width: 24px;
height: 24px;
border: 3px solid #ffffff;
border-bottom-color: transparent;
border-radius: 50%;
animation: rotation 1s linear infinite;
}
@keyframes rotation {
0% { transform: rotate(0deg); }
100% { transform: rotate(360deg); }
}
/* --- Responsive --- */
@media (max-width: 1024px) {
.generator-container {
flex-direction: column;
overflow-y: auto;
}
.controls-panel {
width: 100%;
border-right: none;
border-bottom: 1px solid var(--border);
height: auto;
flex: none;
}
.preview-panel {
height: auto;
min-height: 500px;
}
}
@media (max-width: 768px) {
.sidebar {
position: fixed;
height: 100%;
transform: translateX(-100%);
}
.sidebar.open {
transform: translateX(0);
}
.mobile-menu-btn {
display: block;
}
}
/* Custom aesthetic for NSFW theme hints (safe implementation) */
.warning-text {
color: #fbbf24;
font-size: 0.75rem;
margin-top: 0.5rem;
display: flex;
align-items: center;
gap: 0.5rem;
}
</style>
</head>
<body>
<!-- Sidebar Navigation -->
<aside class="sidebar" id="sidebar">
<div class="logo">
<i class="fa-solid fa-video"></i>
VELVET AI
</div>
<ul class="nav-menu">
<li class="nav-item">
<a href="#" class="nav-link active">
<i class="fa-solid fa-wand-magic-sparkles"></i> Generator
</a>
</li>
<li class="nav-item">
<a href="#" class="nav-link">
<i class="fa-solid fa-layer-group"></i> My Library
</a>
</li>
<li class="nav-item">
<a href="#" class="nav-link">
<i class="fa-solid fa-heart"></i> Favorites
</a>
</li>
<li class="nav-item">
<a href="#" class="nav-link">
<i class="fa-solid fa-fire"></i> Trending
</a>
</li>
<li class="nav-item">
<a href="#" class="nav-link">
<i class="fa-solid fa-gear"></i> Settings
</a>
</li>
</ul>
<div class="user-profile">
<div class="avatar">U</div>
<div>
<div style="font-weight: 600; font-size: 0.9rem;">User_001</div>
<div class="credits-badge">150 Credits</div>
</div>
</div>
</aside>
<!-- Main Content -->
<main class="main-content">
<!-- Top Header -->
<header class="top-bar">
<button class="mobile-menu-btn" id="menuBtn">
<i class="fa-solid fa-bars"></i>
</button>
<!-- Required Link -->
<a href="https://huggingface.co/spaces/akhaliq/anycoder" target="_blank" class="anycoder-link">
<i class="fa-solid fa-code"></i> Built with anycoder
</a>
<div style="display: flex; gap: 1rem;">
<button style="background:none; border:none; color:var(--text-muted); cursor:pointer;">
<i class="fa-solid fa-bell"></i>
</button>
</div>
</header>
<!-- Generator Interface -->
<div class="generator-container">
<!-- Left Controls -->
<section class="controls-panel">
<div class="form-group">
<label class="form-label">
Prompt
<span style="color: var(--primary); cursor: pointer; font-size: 0.75rem;">Randomize</span>
</label>
<textarea class="text-area" id="promptInput" placeholder="Describe your video fantasy... e.g., A futuristic cyberpunk nightclub with neon lights, cinematic lighting, 4k..."></textarea>
</div>
<div class="form-group">
<label class="form-label">Negative Prompt</label>
<input type="text" class="text-area" style="height: 45px; padding: 0.5rem 1rem;" placeholder="blurry, low quality, distorted">
</div>
<div class="form-group">
<label class="form-label">Model</label>
<select class="select-box">
<option>Velvet Realism v2.0</option>
<option>Anime Diffusion XL</option>
<option>3D Render Engine</option>
<option>Cinematic Motion</option>
</select>
</div>
<div class="form-group">
<div class="toggle-group">
<div>
<div style="font-weight: 600; font-size: 0.9rem;">NSFW / Adult Mode</div>
<div style="font-size: 0.75rem; color: var(--text-muted);">Enable explicit generation capabilities</div>
</div>
<label class="switch">
<input type="checkbox" id="nsfwToggle">
<span class="slider"></span>
</label>
</div>
<div class="warning-text" id="warningMsg" style="display: none;">
<i class="fa-solid fa-triangle-exclamation"></i>
<span>18+ Content enabled. Results are private.</span>
</div>
</div>
<div class="form-group">
<label class="form-label">
Guidance Scale
<span id="guidanceValue">7.5</span>
</label>
<div class="slider-container">
<span style="font-size: 0.8rem; color: var(--text-muted);">Creative</span>
<input type="range" min="1" max="20" value="7.5" step="0.5" id="guidanceSlider">
<span style="font-size: 0.8rem; color: var(--text-muted);">Strict</span>
</div>
</div>
<div class="form-group">
<label class="form-label">
Duration
<span id="durationValue">4s</span>
</label>
<div class="slider-container">
<input type="range" min="2" max="10" value="4" step="1" id="durationSlider">
</div>
</div>
<button class="btn-generate" id="generateBtn">
<span class="btn-text">Generate Video</span>
<span class="loader"></span>
<span style="font-size: 0.8rem; font-weight: 400; opacity: 0.8;">(5 Credits)</span>
</button>
</section>
<!-- Right Preview -->
<section class="preview-panel">
<h3 style="margin-bottom: 1.5rem; font-weight: 500;">Recent Generations</h3>
<div class="results-grid" id="resultsGrid">
<!-- Example Result Card -->
<div class="video-card">
<div class="video-placeholder">
<!-- Using a safe abstract gradient to represent video content -->
<div style="position: absolute; inset: 0; background: linear-gradient(45deg, #2e1065, #be123c); opacity: 0.5;"></div>
<div class="play-btn"><i class="fa-solid fa-play"></i></div>
<div style="position: absolute; top: 10px; right: 10px;" class="nsfw-badge">18+</div>
</div>
<div class="card-info">
<div class="card-prompt">Cyberpunk aesthetic, neon lights, raining street...</div>
<div class="card-meta">
<span><i class="fa-regular fa-clock"></i> 4s</span>
<span><i class="fa-solid fa-share-nodes"></i></span>
</div>
</div>
</div>
<div class="video-card">
<div class="video-placeholder">
<div style="position: absolute; inset: 0; background: linear-gradient(45deg, #0f172a, #334155); opacity: 0.8;"></div>
<div class="play-btn"><i class="fa-solid fa-play"></i></div>
</div>
<div class="card-info">
<div class="card-prompt">Abstract swirling smoke, purple and gold...</div>
<div class="card-meta">
<span><i class="fa-regular fa-clock"></i> 4s</span>
<span><i class="fa-solid fa-share-nodes"></i></span>
</div>
</div>
</div>
</div>
</section>
</div>
</main>
<script>
// --- Logic for UI Interactions ---
const generateBtn = document.getElementById('generateBtn');
const btnText = generateBtn.querySelector('.btn-text');
const loader = generateBtn.querySelector('.loader');
const resultsGrid = document.getElementById('resultsGrid');
const promptInput = document.getElementById('promptInput');
const nsfwToggle = document.getElementById('nsfwToggle');
const warningMsg = document.getElementById('warningMsg');
// Sliders
const guidanceSlider = document.getElementById('guidanceSlider');
const guidanceValue = document.getElementById('guidanceValue');
const durationSlider = document.getElementById('durationSlider');
const durationValue = document.getElementById('durationValue');
// Sidebar Mobile Toggle
const menuBtn = document.getElementById('menuBtn');
const sidebar = document.getElementById('sidebar');
menuBtn.addEventListener('click', () => {
sidebar.classList.toggle('open');
});
// Update slider values
guidanceSlider.addEventListener('input', (e) => {
guidanceValue.textContent = e.target.value;
});
durationSlider.addEventListener('input', (e) => {
durationValue.textContent = e.target.value + 's';
});
// NSFW Toggle Warning
nsfwToggle.addEventListener('change', (e) => {
if(e.target.checked) {
warningMsg.style.display = 'flex';
// Optional: Add a visual cue to the body or theme
document.documentElement.style.setProperty('--primary', '#ef4444');
} else {
warningMsg.style.display = 'none';
document.documentElement.style.setProperty('--primary', '#e11d48');
}
});
// Generate Functionality
generateBtn.addEventListener('click', () => {
const prompt = promptInput.value.trim();
if (!prompt) {
alert("Please enter a prompt first.");
return;
}
// UI Loading State
generateBtn.disabled = true;
btnText.style.display = 'none';
loader.style.display = 'block';
// Simulate API Generation Time (3 seconds)
setTimeout(() => {
// Reset UI
generateBtn.disabled = false;
btnText.style.display = 'block';
loader.style.display = 'none';
// Add new video card
addNewVideoCard(prompt);
}, 3000);
});
function addNewVideoCard(promptText) {
const isNsfw = nsfwToggle.checked;
const duration = durationSlider.value;
// Random gradient for placeholder
const hue1 = Math.floor(Math.random() * 360);
const hue2 = Math.floor(Math.random() * 360);
const card = document.createElement('div');
card.className = 'video-card';
card.innerHTML = `
<div class="video-placeholder">
<div style="position: absolute; inset: 0; background: linear-gradient(45deg, hsl(${hue1}, 60%, 20%), hsl(${hue2}, 60%, 30%)); opacity: 0.8;"></div>
<div class="play-btn"><i class="fa-solid fa-play"></i></div>
${isNsfw ? '<div style="position: absolute; top: 10px; right: 10px;" class="nsfw-badge">18+</div>' : ''}
</div>
<div class="card-info">
<div class="card-prompt">${promptText}</div>
<div class="card-meta">
<span><i class="fa-regular fa-clock"></i> ${duration}s</span>
<span><i class="fa-solid fa-share-nodes"></i></span>
</div>
</div>
`;
// Add animation class
card.style.animation = 'fadeIn 0.5s ease forwards';
// Insert at the beginning
resultsGrid.insertBefore(card, resultsGrid.firstChild);
}
// Close sidebar when clicking outside on mobile
document.addEventListener('click', (e) => {
if (window.innerWidth <= 768) {
if (!sidebar.contains(e.target) && !menuBtn.contains(e.target)) {
sidebar.classList.remove('open');
}
}
});
</script>
</body>
</html> |