Spaces:
Running
Running
Upload folder using huggingface_hub
Browse files1234567891011121314151617181920212223242526272829303132334353637383940414243456784546474849505152535491011565758596061626364656667686970711213147374151617187677787980818283848586871920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677788990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514434435436437438439440441442443444445446447448449450451452453454455456457458459460461462515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565466467468469566567568569570471571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631473474475476477478479480481482483484485486487488489490491492493494632633634635636637638639640497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527641642643644645646647648649650651652653654655656657658659660661529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668662670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737663664665666667668669670671739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770672673674675676677678679680681682683684685686772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824687688689690691692693826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938<!DOCTYPE html><html lang="fr"><head> <meta charset="UTF-8"> <meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=no"> <title>Telegram Web (Simulation)</title> <!-- Importation de la police Roboto (Police standard de Telegram) --> <link href="https://fonts.googleapis.com/css2?family=Roboto:wght@300;400;500;700&display=swap" rel="stylesheet"> <!-- Importation des icônes FontAwesome --> <link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.4.0/css/all.min.css">
<style> /* ========================================= VARIABLES CSS & RESET ========================================= */ :root { --tg-blue: #3390ec; --tg-bg: #1d242d; /* Fond sombre style "Dark Mode" ou classique */ --tg-sidebar-bg: #17212b; --tg-chat-bg: #0e1621; --tg-item-hover: #202b36; --tg-text-primary: #ffffff; --tg-text-secondary: #7f91a4; --tg-green-msg: #2b5278; --tg-white-msg: #182533; --tg-input-bg: #242f3d; --tg-border: #0e1621; --scrollbar-thumb: #2f3844; --header-height: 60px; }
/* Mode Clair par défaut si préféré, mais je vais faire un thème sombre car c'est très populaire pour les "fake" modernes */ * { box-sizing: border-box; margin: 0; padding: 0; outline: none; -webkit-tap-highlight-color: transparent; }<head> <meta charset="UTF-8"> <meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=no"> <title>AI Video Generator Studio</title>
body { font-family: 'Roboto', sans-serif; background-color: var(--tg-bg); color: var(--tg-text-primary); height: 100vh; overflow: hidden; display: flex; justify-content: center; align-items: center; } <!-- Importation de la police Inter (Moderne et clean) --> <link href="https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700&display=swap" rel="stylesheet">
/* Lien obligatoire "Built with anycoder" */ .anycoder-credit { position: absolute; top: 5px; left: 10px; font-size: 0.75rem; color: var(--tg-text-secondary); z-index: 1000; text-decoration: none; opacity: 0.7; transition: opacity 0.3s; } .anycoder-credit:hover { opacity: 1; color: var(--tg-blue); } <!-- Importation des icônes FontAwesome --> <link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.4.0/css/all.min.css">
/* ========================================= STRUCTURE PRINCIPALE (GRID) <style> /* ========================================= VARIABLES CSS & RESET ========================================= */ .app-container { display: grid; grid-template-columns: 380px 1fr; width: 100%; height: 100%; max-width: 1600px; background-color: var(--tg-bg); box-shadow: 0 0 20px rgba(0,0,0,0.5); }
/* ========================================= SIDEBAR (LISTE DES CONTACTS) :root { --bg-body: #09090b; --bg-sidebar: #121214; --bg-card: #18181b; --bg-input: #27272a; --primary: #8b5cf6; /* Violet */ --primary-hover: #7c3aed; --accent: #ec4899; /* Rose */ --text-main: #ffffff; --text-secondary: #a1a1aa; --border: #27272a; --success: #10b981; --radius-md: 12px; --radius-lg: 16px; --header-height: 70px; }
* { box-sizing: border-box; margin: 0; padding: 0; outline: none; -webkit-tap-highlight-color: transparent; }
body { font-family: 'Inter', sans-serif; background-color: var(--bg-body); color: var(--text-main); height: 100vh; overflow: hidden; /* Prevent body scroll, handle inside containers */ display: flex; }
/* Lien obligatoire "Built with anycoder" */ .anycoder-credit { position: fixed; bottom: 10px; left: 50%; transform: translateX(-50%); font-size: 0.8rem; color: var(--text-secondary); z-index: 1000; text-decoration: none; opacity: 0.6; transition: opacity 0.3s; background: rgba(0,0,0,0.5); padding: 4px 12px; border-radius: 20px; backdrop-filter: blur(4px); }
.anycoder-credit:hover { opacity: 1; color: var(--primary); }
/* ========================================= LAYOUT PRINCIPAL ========================================= */ .sidebar { background-color: var(--tg-sidebar-bg); border-right: 1px solid #000; display: flex; flex-direction: column; height: 100%; position: relative; z-index: 2; }
/* Sidebar Header */ .sidebar-header { height: var(--header-height); padding: 10px 15px; display: flex; align-items: center; gap: 15px; background-color: var(--tg-sidebar-bg); }
.menu-btn { background: none; border: none; color: var(--tg-text-secondary); font-size: 1.2rem; cursor: pointer; transition: color 0.2s; } .menu-btn:hover { color: var(--tg-text-primary); }
.search-bar { flex: 1; background-color: #242f3d; border-radius: 20px; padding: 8px 15px; display: flex; align-items: center; color: var(--tg-text-secondary); }
.search-bar input { background: transparent; border: none; color: var(--tg-text-primary); width: 100%; margin-left: 10px; font-size: 0.95rem; }
/* Contact List */ .contact-list { flex: 1; overflow-y: auto; scrollbar-width: thin; scrollbar-color: var(--scrollbar-thumb) transparent; }
.contact-list::-webkit-scrollbar { width: 6px; } .contact-list::-webkit-scrollbar-thumb { background-color: var(--scrollbar-thumb); border-radius: 3px; }
.contact-item { display: flex; padding: 10px 15px; cursor: pointer; transition: background 0.2s; align-items: center; }
.contact-item:hover { background-color: var(--tg-item-hover); }
.contact-item.active { background-color: var(--tg-blue); } .contact-item.active .last-message, .contact-item.active .time, .contact-item.active .name { color: #fff; }
.avatar { width: 50px; height: 50px; border-radius: 50%; object-fit: cover; margin-right: 15px; background-color: #ccc; }
.contact-info { flex: 1; display: flex; flex-direction: column; justify-content: center; overflow: hidden; }
.top-row { display: flex; justify-content: space-between; margin-bottom: 4px; }
.name { font-weight: 500; font-size: 1rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.time { font-size: 0.75rem; color: var(--tg-text-secondary); }
.bottom-row { display: flex; justify-content: space-between; align-items: center; }
.last-message { color: var(--tg-text-secondary); font-size: 0.85rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 200px; }
.unread-badge { background-color: var(--tg-blue); color: white; font-size: 0.75rem; padding: 2px 6px; border-radius: 10px; min-width: 20px; text-align: center; font-weight: bold; }
/* ========================================= CHAT AREA .app-container { display: flex; width: 100%; height: 100%; }
/* SIDEBAR */ .sidebar { width: 260px; background-color: var(--bg-sidebar); border-right: 1px solid var(--border); display: flex; flex-direction: column; padding: 20px; transition: transform 0.3s ease; }
.logo { font-size: 1.5rem; font-weight: 700; color: var(--text-main); margin-bottom: 40px; display: flex; align-items: center; gap: 10px; }
.logo i { color: var(--primary); }
.nav-menu { list-style: none; flex: 1; }
.nav-item { margin-bottom: 8px; }
.nav-link { display: flex; align-items: center; gap: 12px; padding: 12px 16px; color: var(--text-secondary); 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-input); color: var(--text-main); }
.nav-link.active { border-left: 3px solid var(--primary); }
.user-profile { display: flex; align-items: center; gap: 10px; padding-top: 20px; border-top: 1px solid var(--border); }
.avatar-small { width: 36px; height: 36px; border-radius: 50%; background: linear-gradient(45deg, var(--primary), var(--accent)); }
/* MAIN CONTENT */ .main-content { flex: 1; display: flex; flex-direction: column; overflow: hidden; position: relative; }
.top-bar { height: var(--header-height); border-bottom: 1px solid var(--border); display: flex; align-items: center; justify-content: space-between; padding: 0 30px; }
.page-title { font-size: 1.2rem; font-weight: 600; }
.credits { background: rgba(139, 92, 246, 0.1); color: var(--primary); padding: 6px 12px; border-radius: 20px; font-size: 0.85rem; font-weight: 600; }
/* SCROLLABLE AREA */ .content-scroll { flex: 1; overflow-y: auto; padding: 30px; }
/* ========================================= GENERATOR SECTION ========================================= */ .chat-area { background-color: var(--tg-chat-bg); background-image: radial-gradient(#1f2f40 1px, transparent 1px); background-size: 20px 20px; /* Pattern subtil */ display: flex; flex-direction: column; position: relative; }
/* Default Placeholder State */ .empty-state { display: flex; flex-direction: column; align-items: center; justify-content: center; height: 100%; color: var(--tg-text-secondary); text-align: center; } .empty-state i { font-size: 5rem; margin-bottom: 20px; color: #2f3844; }
/* Chat Header */ .chat-header { height: var(--header-height); background-color: var(--tg-sidebar-bg); display: flex; align-items: center; padding: 0 15px; justify-content: space-between; border-bottom: 1px solid #000; z-index: 10; }
.chat-header-info { display: flex; align-items: center; cursor: pointer; }
.back-btn { display: none; /* Visible only on mobile */ margin-right: 15px; font-size: 1.2rem; color: var(--tg-text-secondary); background: none; border: none; cursor: pointer; }
.chat-header-text { display: flex; flex-direction: column; margin-left: 10px; }
.chat-name { font-weight: 600; font-size: 1rem; } .chat-status { font-size: 0.75rem; color: var(--tg-text-secondary); }
.chat-actions { display: flex; gap: 20px; color: var(--tg-text-secondary); } .chat-actions i { cursor: pointer; transition: color 0.2s; } .chat-actions i:hover { color: var(--tg-text-primary); }
/* Messages List */ .messages-container { flex: 1; padding: 20px; overflow-y: auto; display: flex; flex-direction: column; gap: 8px; } .messages-container::-webkit-scrollbar { width: 6px; } .messages-container::-webkit-scrollbar-thumb { background-color: rgba(0,0,0,0.2); }
.message { max-width: 65%; padding: 8px 12px; border-radius: 12px; position: relative; font-size: 0.95rem; line-height: 1.4; word-wrap: break-word; animation: fadeIn 0.3s ease; }
@keyframes fadeIn { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: translateY(0); } }
.message.received { align-self: flex-start; background-color: var(--tg-white-msg); border-bottom-left-radius: 4px; }
.message.sent { align-self: flex-end; background-color: var(--tg-green-msg); border-bottom-right-radius: 4px; }
.msg-meta { display: flex; justify-content: flex-end; align-items: center; gap: 4px; font-size: 0.7rem; color: rgba(255,255,255,0.6); margin-top: 4px; float: right; margin-left: 8px; }
/* Input Area */ .input-area { min-height: 60px; background-color: var(--tg-sidebar-bg); padding: 10px 15px; display: flex; align-items: flex-end; gap: 15px; }
.attach-btn, .emoji-btn { color: var(--tg-text-secondary); font-size: 1.4rem; background: none; border: none; cursor: pointer; padding-bottom: 5px; }
.message-input-wrapper { flex: 1; background-color: var(--tg-input-bg); border-radius: 10px; /* Plus arrondi style moderne */ padding: 10px 15px; display: flex; align-items: center; }
.message-input { width: 100%; background: transparent; border: none; color: var(--tg-text-primary); font-size: 1rem; resize: none; max-height: 100px; font-family: inherit; }
.send-btn { color: var(--tg-blue); font-size: 1.5rem; background: none; border: none; cursor: pointer; padding-bottom: 5px; transition: transform 0.1s; } .send-btn:active { transform: scale(0.9); }
/* ========================================= RESPONSIVE (MOBILE) .generator-grid { display: grid; grid-template-columns: 1fr 400px; gap: 30px; max-width: 1400px; margin: 0 auto; }
/* INPUT AREA */ .input-card { background-color: var(--bg-card); border: 1px solid var(--border); border-radius: var(--radius-lg); padding: 24px; display: flex; flex-direction: column; gap: 20px; }
.form-group { display: flex; flex-direction: column; gap: 8px; }
.form-label { font-size: 0.9rem; color: var(--text-secondary); font-weight: 500; }
textarea.prompt-input { width: 100%; height: 120px; background-color: var(--bg-input); border: 1px solid var(--border); border-radius: var(--radius-md); padding: 16px; color: var(--text-main); font-family: inherit; font-size: 1rem; resize: none; transition: border-color 0.2s; }
textarea.prompt-input:focus { border-color: var(--primary); }
/* OPTIONS CONTROLS */ .controls-row { display: flex; gap: 20px; flex-wrap: wrap; }
.control-group { flex: 1; min-width: 140px; }
select, .custom-select-trigger { width: 100%; background-color: var(--bg-input); border: 1px solid var(--border); color: var(--text-main); padding: 10px 14px; border-radius: var(--radius-md); cursor: pointer; appearance: none; /* Hide default arrow for custom styling if needed */ } /* Style Chips for Ratios */ .ratio-options { display: flex; background: var(--bg-input); padding: 4px; border-radius: var(--radius-md); gap: 4px; }
.ratio-btn { flex: 1; background: transparent; border: none; color: var(--text-secondary); padding: 8px; border-radius: 8px; cursor: pointer; font-size: 0.85rem; transition: all 0.2s; }
.ratio-btn.active { background-color: var(--bg-card); color: var(--text-main); box-shadow: 0 2px 4px rgba(0,0,0,0.2); }
.generate-btn { background: linear-gradient(135deg, var(--primary), var(--accent)); color: white; border: none; padding: 16px; border-radius: var(--radius-md); font-size: 1rem; font-weight: 600; cursor: pointer; transition: transform 0.1s, opacity 0.2s; display: flex; align-items: center; justify-content: center; gap: 10px; }
.generate-btn:hover { opacity: 0.9; }
.generate-btn:active { transform: scale(0.98); }
.generate-btn:disabled { background: var(--bg-input); color: var(--text-secondary); cursor: not-allowed; }
/* PREVIEW AREA */ .preview-card { background-color: var(--bg-card); border: 1px solid var(--border); border-radius: var(--radius-lg); padding: 24px; display: flex; flex-direction: column; align-items: center; justify-content: center; min-height: 400px; position: relative; overflow: hidden; }
.video-placeholder { width: 100%; aspect-ratio: 16/9; background-color: #000; border-radius: var(--radius-md); display: flex; align-items: center; justify-content: center; position: relative; overflow: hidden; }
/* Animation when "video" is playing */ .video-active { background-image: url('https://picsum.photos/seed/ai-video/800/450'); background-size: cover; background-position: center; } .video-overlay { position: absolute; inset: 0; background: linear-gradient(to top, rgba(0,0,0,0.6), transparent); display: flex; align-items: flex-end; padding: 15px; }
.play-btn { width: 60px; height: 60px; background: rgba(255,255,255,0.2); backdrop-filter: blur(5px); border-radius: 50%; display: flex; align-items: center; justify-content: center; color: white; font-size: 1.5rem; border: none; cursor: pointer; transition: transform 0.2s; }
.play-btn:hover { transform: scale(1.1); background: var(--primary); }
/* Loading State */ .loading-overlay { position: absolute; inset: 0; background: rgba(15, 23, 42, 0.9); display: flex; flex-direction: column; align-items: center; justify-content: center; z-index: 10; display: none; /* Hidden by default */ }
.loading-overlay.active { display: flex; }
.spinner { width: 40px; height: 40px; border: 3px solid rgba(139, 92, 246, 0.3); border-radius: 50%; border-top-color: var(--primary); animation: spin 1s ease-in-out infinite; margin-bottom: 20px; }
@keyframes spin { to { transform: rotate(360deg); } }
.progress-bar { width: 80%; height: 6px; background-color: var(--bg-input); border-radius: 3px; overflow: hidden; margin-bottom: 10px; }
.progress-fill { height: 100%; width: 0%; background: linear-gradient(90deg, var(--primary), var(--accent)); transition: width 0.3s linear; }
.status-text { font-size: 0.9rem; color: var(--text-secondary); animation: pulse 1.5s infinite; }
@keyframes pulse { 0%, 100% { opacity: 1; } 50% { opacity: 0.5; } }
/* HISTORY SECTION */ .history-section { margin-top: 40px; max-width: 1400px; margin-left: auto; margin-right: auto; }
.section-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 20px; }
.history-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); gap: 20px; }
.history-item { background-color: var(--bg-card); border-radius: var(--radius-md); overflow: hidden; border: 1px solid var(--border); transition: transform 0.2s; cursor: pointer; }
.history-item:hover { transform: translateY(-5px); border-color: var(--primary); }
.history-thumb { width: 100%; height: 140px; background-color: #000; background-size: cover; background-position: center; position: relative; }
.history-info { padding: 12px; }
.history-prompt { font-size: 0.85rem; color: var(--text-main); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; margin-bottom: 4px; }
.history-meta { font-size: 0.75rem; color: var(--text-secondary); display: flex; justify-content: space-between; }
/* ========================================= RESPONSIVE DESIGN ========================================= */ @media (max-width: 800px) { .app-container { grid-template-columns: 1fr; }
.chat-area { position: absolute; top: 0; left: 0; width: 100%; height: 100%; transform: translateX(100%); transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1); z-index: 5; }
.chat-area.active { transform: translateX(0); }
.back-btn { display: block; } .sidebar { width: 100%; } } </style> @media (max-width: 900px) { .generator-grid { grid-template-columns: 1fr; } .preview-card { min-height: 300px; order: -1; /* Put preview on top on mobile */ } }
@media (max-width: 768px) { .sidebar { position: fixed; left: -100%; top: 0; bottom: 0; z-index: 100; width: 80%; box-shadow: 10px 0 20px rgba(0,0,0,0.5); }
.sidebar.active { left: 0; }
.menu-toggle { display: block; font-size: 1.2rem; background: none; border: none; color: var(--text-main); cursor: pointer; margin-right: 15px; } .content-scroll { padding: 15px; } } @media (min-width: 769px) { .menu-toggle { display: none; } } </style></head>
<body>
<!-- Lien crédit obligatoire --> <a href="https://huggingface.co/spaces/akhaliq/anycoder" target="_blank" class="anycoder-credit"> Built with anycoder <i class="fas fa-external-link-alt"></i> </a> <!-- Lien crédit obligatoire --> <a href="https://huggingface.co/spaces/akhaliq/anycoder" target="_blank" class="anycoder-credit"> Built with anycoder <i class="fas fa-external-link-alt"></i> </a>
<div class="app-container"> <div class="app-container"> <!-- SIDEBAR --> <aside class="sidebar" id="sidebar"> <div class="logo"> <i class="fas fa-video"></i> <span>VideoGen AI</span> </div>
<ul class="nav-menu"> <li class="nav-item"> <a href="#" class="nav-link active"> <i class="fas fa-wand-magic-sparkles"></i> <span>Créer</span> </a> </li> <li class="nav-item"> <a href="#" class="nav-link"> <i class="fas fa-clock-rotate-left"></i> <span>Historique</span> </a> </li> <li class="nav-item"> <a href="#" class="nav-link"> <i class="fas fa-bookmark"></i> <span>Favoris</span> </a> </li> <li class="nav-item"> <a href="#" class="nav-link"> <i class="fas fa-gear"></i> <span>Paramètres</span> </a> </li> </ul>
<div class="user-profile"> <div class="avatar-small"></div> <div> <div style="font-size: 0.9rem; font-weight: 600;">Mon Compte</div> <div style="font-size: 0.75rem; color: var(--text-secondary);">Plan Pro</div> </div> </div> </aside>
<!-- MAIN CONTENT --> <main class="main-content"> <!-- Top Bar --> <header class="top-bar"> <div style="display: flex; align-items: center;"> <button class="menu-toggle" id="menuToggle"><i class="fas fa-bars"></i></button> <h1 class="page-title">Nouvelle Vidéo</h1> </div> <div class="credits"> <i class="fas fa-coins"></i> 120 Crédits restants </div> </header>
<!-- Scrollable Content --> <div class="content-scroll"> <!-- SIDEBAR --> <aside class="sidebar"> <header class="sidebar-header"> <button class="menu-btn"><i class="fas fa-bars"></i></button> <div class="search-bar"> <i class="fas fa-search"></i> <input type="text" id="searchInput" placeholder="Rechercher"> </div> </header>
<div class="contact-list" id="contactList"> <!-- Les contacts seront injectés ici par JS --> </div> </aside>
<!-- CHAT AREA --> <main class="chat-area" id="chatArea"> <!-- État vide (aucune sélection) --> <div class="empty-state" id="emptyState"> <i class="fab fa-telegram"></i> <h2>Sélectionnez un chat</h2> <p>pour commencer la conversation</p> <div class="generator-grid"> <!-- INPUT COLUMN --> <div class="input-card"> <div class="form-group"> <label class="form-label">Votre prompt</label> <textarea class="prompt-input" id="promptInput" placeholder="Décrivez la vidéo que vous souhaitez générer... (ex: Un astronaute marchant sur Mars au coucher du soleil, style cinématographique 4K)"></textarea> </div>
<!-- Contenu du chat (caché par défaut) --> <div id="chatContent" style="display: none; flex-direction: column; height: 100%;"> <header class="chat-header"> <div class="chat-header-info"> <button class="back-btn" id="backBtn"><i class="fas fa-arrow-left"></i></button> <img src="" alt="" class="avatar" id="headerAvatar" style="width: 40px; height: 40px;"> <div class="chat-header-text"> <span class="chat-name" id="headerName">Nom</span> <span class="chat-status" id="headerStatus">en ligne</span> </div> </div> <div class="chat-actions"> <i class="fas fa-phone"></i> <i class="fas fa-video"></i> <i class="fas fa-search"></i> <i class="fas fa-ellipsis-v"></i> </div> </header>
<div class="messages-container" id="messagesContainer"> <!-- Messages injectés ici --> </div>
<footer class="input-area"> <button class="attach-btn"><i class="fas fa-paperclip"></i></button> <div class="message-input-wrapper"> <input type="text" class="message-input" id="messageInput" placeholder="Écrivez un message..." autocomplete="off"> </div> <button class="emoji-btn"><i class="far fa-smile"></i></button> <button class="send-btn" id="sendBtn"><i class="fas fa-paper-plane"></i></button> </footer> <div class="controls-row"> <div class="control-group"> <label class="form-label">Style</label> <select id="styleSelect"> <option value="cinematic">Cinématique</option> <option value="anime">Anime</option> <option value="3d">Rendu 3D</option> <option value="cyberpunk">Cyberpunk</option> <option value="realistic">Réaliste</option> </select> </div>
<div class="control-group"> <label class="form-label">Durée</label> <select id="durationSelect"> <option value="5">5 secondes</option> <option value="10">10 secondes</option> <option value="15">15 secondes</option> </select> </div> </div> </main> </div>
<script> // ========================================= // DONNÉES SIMULÉES (MOCK DATA) // ========================================= const contactsData = [ { id: 1, name: "Sophie Martin", avatar: "https://picsum.photos/seed/sophie/100/100", time: "14:30", unread: 2, lastMsg: "Tu as vu le nouveau projet ?", status: "en ligne", messages: [ { id: 1, text: "Salut ! Comment ça va ?", type: "received", time: "14:25" }, { id: 2, text: "Ça va super, et toi ?", type: "sent", time: "14:26", read: true }, { id: 3, text: "Très bien. Tu as vu le nouveau projet ?", type: "received", time: "14:30" } ] }, { id: 2, name: "Groupe Développement", avatar: "https://picsum.photos/seed/dev/100/100", time: "12:15", unread: 0, lastMsg: "Lucas: Le merge est ready", status: "5 membres", messages: [ { id: 1, text: "Avez-vous pushé le code ?", type: "received", time: "12:00" }, { id: 2, text: "Je le fais maintenant.", type: "sent", time: "12:05", read: true }, { id: 3, text: "Lucas: Le merge est ready", type: "received", time: "12:15" } ] }, { id: 3, name: "Marc Dupont", avatar: "https://picsum.photos/seed/marc/100/100", time: "Hier", unread: 0, lastMsg: "Ok, à demain alors !", status: "dernière connexion hier à 23h", messages: [ { id: 1, text: "On se voit demain matin ?", type: "received", time: "Hier" }, { id: 2, text: "Oui, sans problème.", type: "sent", time: "Hier", read: true }, { id: 3, text: "Ok, à demain alors !", type: "received", time: "Hier" } ] }, { id: 4, name: "Service Client", avatar: "https://picsum.photos/seed/support/100/100", time: "Mar", unread: 1, lastMsg: "Votre ticket a été résolu.", status: "bot", messages: [ { id: 1, text: "Bonjour, comment pouvons-nous vous aider ?", type: "received", time: "Mar" }, { id: 2, text: "J'ai un souci de connexion.", type: "sent", time: "Mar", read: false }, { id: 3, text: "Votre ticket a été résolu.", type: "received", time: "Mar" } ] }, { id: 5, name: "Julie Design", avatar: "https://picsum.photos/seed/julie/100/100", time: "Lun", unread: 0, lastMsg: "J'adore les nouvelles couleurs !", status: "en ligne", messages: [ { id: 1, text: "Tu as vu les maquettes ?", type: "sent", time: "Lun", read: true }, { id: 2, text: "J'adore les nouvelles couleurs !", type: "received", time: "Lun" } ] } ];
let activeContactId = null;
// ========================================= // DOM ELEMENTS // ========================================= const contactListEl = document.getElementById('contactList'); const emptyStateEl = document.getElementById('emptyState'); const chatContentEl = document.getElementById('chatContent'); const chatAreaEl = document.getElementById('chatArea'); // Header Chat const headerName = document.getElementById('headerName'); const headerStatus = document.getElementById('headerStatus'); const headerAvatar = document.getElementById('headerAvatar'); // Messages const messagesContainer = document.getElementById('messagesContainer'); // Input const messageInput = document.getElementById('messageInput'); const sendBtn = document.getElementById('sendBtn'); const searchInput = document.getElementById('searchInput'); const backBtn = document.getElementById('backBtn');
// ========================================= // FONCTIONS // =========================================
// 1. Rendu de la liste des contacts function renderContacts(filter = "") { contactListEl.innerHTML = ""; const filteredContacts = contactsData.filter(c => c.name.toLowerCase().includes(filter.toLowerCase()) );
filteredContacts.forEach(contact => { const li = document.createElement('div'); li.className = `contact-item ${activeContactId === contact.id ? 'active' : ''}`; li.onclick = () => openChat(contact.id);
let unreadHtml = contact.unread > 0 ? `<span class="unread-badge">${contact.unread}</span>` : '';
li.innerHTML = ` <img src="${contact.avatar}" alt="${contact.name}" class="avatar"> <div class="contact-info"> <div class="top-row"> <span class="name">${contact.name}</span> <span class="time">${contact.time}</span> </div> <div class="bottom-row"> <span class="last-message">${contact.lastMsg}</span> ${unreadHtml} </div> </div> `; contactListEl.appendChild(li); }); }
// 2. Ouvrir un chat function openChat(id) { activeContactId = id; const contact = contactsData.find(c => c.id === id);
// UI Updates renderContacts(searchInput.value); // Refresh pour mettre la classe active emptyStateEl.style.display = 'none'; chatContentEl.style.display = 'flex'; // Mobile: Slide effect chatAreaEl.classList.add('active');
// Header Info headerName.textContent = contact.name; headerStatus.textContent = contact.status; headerAvatar.src = contact.avatar;
// Reset unread count contact.unread = 0; renderContacts(searchInput.value);
// Render Messages renderMessages(contact.messages); // Focus input messageInput.focus(); }
// 3. Afficher les messages function renderMessages(messages) { messagesContainer.innerHTML = ""; // Date divider (fake) const dateDiv = document.createElement('div'); dateDiv.style.textAlign = 'center'; dateDiv.style.margin = '10px 0'; dateDiv.innerHTML = '<span style="background:rgba(0,0,0,0.2); padding:4px 10px; border-radius:10px; font-size:0.75rem; color:#aaa;">Aujourd\'hui</span>'; messagesContainer.appendChild(dateDiv);
messages.forEach(msg => { appendMessageToDOM(msg); }); scrollToBottom(); }
// 4. Ajouter un message au DOM function appendMessageToDOM(msg) { const div = document.createElement('div'); div.className = `message ${msg.type}`; const checks = msg.type === 'sent' ? (msg.read ? '<i class="fas fa-check-double"></i>' : '<i class="fas fa-check"></i>') : '';
div.innerHTML = ` ${msg.text} <span class="msg-meta"> ${msg.time} ${checks} </span> `; messagesContainer.appendChild(div); }
// 5. Scroll en bas function scrollToBottom() { messagesContainer.scrollTop = messagesContainer.scrollHeight; } <div class="form-group"> <label class="form-label">Format</label> <div class="ratio-options"> <button class="ratio-btn active" data-ratio="16:9">16:9</button> <button class="ratio-btn" data-ratio="9:16">9:16</button> <button class="ratio-btn" data-ratio="1:1">1:1</button> </div> </div>
// 6. Envoyer un message function sendMessage() { const text = messageInput.value.trim(); if (!text || !activeContactId) return;
const contact = contactsData.find(c => c.id === activeContactId); const now = new Date(); const timeString = now.getHours().toString().padStart(2, '0') + ':' + now.getMinutes().toString().padStart(2, '0');
// Création objet message const newMsg = { id: Date.now(), text: text, type: 'sent', time: timeString, read: false };
// Update Data contact.messages.push(newMsg); contact.lastMsg = text; contact.time = timeString;
// Update UI appendMessageToDOM(newMsg); messageInput.value = ""; scrollToBottom(); renderContacts(searchInput.value); // Update preview in sidebar
// Simulation réponse automatique simulateReply(contact); } <button class="generate-btn" id="generateBtn"> <i class="fas fa-sparkles"></i> Générer la vidéo </button> </div>
<!-- PREVIEW COLUMN --> <div class="preview-card"> <div class="loading-overlay" id="loadingOverlay"> <div class="spinner"></div> <div class="progress-bar"> <div class="progress-fill" id="progressFill"></div> </div> <div class="status-text" id="statusText">Initialisation...</div> </div>
// 7. Simulation de réponse (Bot) function simulateReply(contact) { const replies = [ "C'est intéressant !", "Je suis d'accord.", "Tu pourrais m'en dire plus ?", "Ok, je note ça.", "Haha, trop drôle ! 😂", "Je suis occupé là, je te réponds plus tard." ]; // Random delay entre 1s et 3s const delay = Math.floor(Math.random() * 2000) + 1000;
setTimeout(() => { // On vérifie si on est toujours sur le même chat if (activeContactId === contact.id) { const replyText = replies[Math.floor(Math.random() * replies.length)]; const now = new Date(); const timeString = now.getHours().toString().padStart(2, '0') + ':' + now.getMinutes().toString().padStart(2, '0');
const replyMsg = { id: Date.now(), text: replyText, type: 'received', time: timeString };
contact.messages.push(replyMsg); contact.lastMsg = replyText; contact.time = timeString;
appendMessageToDOM(replyMsg); scrollToBottom(); // Marquer le message envoyé précédemment comme "lu" const lastSent = contact.messages.filter(m => m.type === 'sent').pop(); if(lastSent) lastSent.read = true; // Rafraichir la vue (pour les checks bleus) // Dans une vraie app on ne rafraichirait pas tout, mais ici c'est simple renderMessages(contact.messages); renderContacts(searchInput.value);
} else { // Si l'utilisateur a changé de chat, on incrémente les non-lus contact.unread++; const replyText = "Nouveau message reçu"; contact.lastMsg = replyText; renderContacts(searchInput.value); } }, delay); } <div class="video-placeholder" id="videoPlaceholder"> <div style="text-align: center; color: var(--text-secondary);"> <i class="fas fa-film" style="font-size: 3rem; margin-bottom: 15px; opacity: 0.5;"></i> <p>Aperçu de la vidéo</p> </div> </div>
// ========================================= // EVENT LISTENERS // =========================================
// Clic sur envoyer sendBtn.addEventListener('click', sendMessage);
// Touche Entrée messageInput.addEventListener('keypress', (e) => { if (e.key === 'Enter') sendMessage(); });
// Recherche searchInput.addEventListener('input', (e) => { renderContacts(e.target.value); });
// Bouton retour (Mobile) backBtn.addEventListener('click', () => { chatAreaEl.classList.remove('active'); setTimeout(() => { activeContactId = null; // Optionnel: désélectionner visuellement dans la sidebar renderContacts(searchInput.value); }, 300); });
// Initialisation renderContacts();
</script> <div id="videoControls" style="width: 100%; margin-top: 20px; display: none; justify-content: space-between; align-items: center;"> <div style="font-size: 0.9rem; color: var(--text-secondary);"> <i class="fas fa-check-circle" style="color: var(--success);"></i> Généré avec succès </div> <button style="background: var(--bg-input); border: none; color: white; padding: 8px 16px; border-radius: 6px; cursor: pointer;"> <i class="fas fa-download"></i> Télécharger </button> </div> </div>
</div>
<!-- HISTORY GRID --> <div class="history-section"> <div class="section-header"> <h2>Générations récentes</h2> <a href="#" style="color: var(--primary); text-decoration: none; font-size: 0.9rem;">Voir tout</a> </div> <div class="history-grid" id="historyGrid"> <!-- Items injectés via JS --> </div> </div>
</div> </main> </div>
<script> // ========================================= // DOM ELEMENTS // ========================================= const promptInput = document.getElementById('promptInput'); const generateBtn = document.getElementById('generateBtn'); const loadingOverlay = document.getElementById('loadingOverlay'); const progressFill = document.getElementById('progressFill'); const statusText = document.getElementById('statusText'); const videoPlaceholder = document.getElementById('videoPlaceholder'); const videoControls = document.getElementById('videoControls'); const historyGrid = document.getElementById('historyGrid'); const ratioBtns = document.querySelectorAll('.ratio-btn'); const menuToggle = document.getElementById('menuToggle'); const sidebar = document.getElementById('sidebar');
// ========================================= // STATE & DATA // ========================================= let isGenerating = false; const historyData = [ { id: 1, prompt: "Ville futuriste avec voitures volantes, nuit", style: "Cyberpunk", duration: "5s", thumb: "https://picsum.photos/seed/cyber1/400/250" }, { id: 2, prompt: "Chat buvant du café dans un café parisien", style: "Réaliste", duration: "10s", thumb: "https://picsum.photos/seed/cat2/400/250" }, { id: 3, prompt: "Dragon cracheur de feu sur une montagne", style: "Cinématique", duration: "5s", thumb: "https://picsum.photos/seed/dragon3/400/250" } ];
// ========================================= // FUNCTIONS // =========================================
// 1. Gestion du menu mobile menuToggle.addEventListener('click', () => { sidebar.classList.toggle('active'); });
// Clic hors sidebar pour fermer document.addEventListener('click', (e) => { if (window.innerWidth <= 768) { if (!sidebar.contains(e.target) && !menuToggle.contains(e.target)) { sidebar.classList.remove('active'); } } });
// 2. Gestion des boutons de ratio ratioBtns.forEach(btn => { btn.addEventListener('click', () => { ratioBtns.forEach(b => b.classList.remove('active')); btn.classList.add('active'); // Changer l'aspect ratio du placeholder visuellement const ratio = btn.dataset.ratio; if(ratio === '16:9') videoPlaceholder.style.aspectRatio = '16/9'; if(ratio === '9:16') videoPlaceholder.style.aspectRatio = '9/16'; if(ratio === '1:1') videoPlaceholder.style.aspectRatio = '1/1'; }); });
// 3. Rendu de l'historique function renderHistory() { historyGrid.innerHTML = ''; historyData.forEach(item => { const div = document.createElement('div'); div.className = 'history-item'; div.innerHTML = ` <div class="history-thumb" style="background-image: url('${item.thumb}');"> <div style="position:absolute; bottom:8px; right:8px; background:rgba(0,0,0,0.7); color:white; font-size:0.7rem; padding:2px 6px; border-radius:4px;">${item.duration}</div> </div> <div class="history-info"> <div class="history-prompt">${item.prompt}</div> <div class="history-meta"> <span>${item.style}</span> <span>Il y a 2h</span> </div> </div> `; div.onclick = () => loadVideoToPreview(item); historyGrid.appendChild(div); }); }
// 4. Charger une vidéo depuis l'historique function loadVideoToPreview(item) { videoPlaceholder.innerHTML = ` <div class="video-overlay"> <h3 style="color:white; margin-bottom:10px;">${item.prompt}</h3> <button class="play-btn"><i class="fas fa-play"></i></button> </div> `; videoPlaceholder.style.backgroundImage = `url('${item.thumb}')`; videoPlaceholder.classList.add('video-active'); videoControls.style.display = 'flex'; // Reset placeholder text logic videoPlaceholder.querySelector('div[style*="text-align"]').style.display = 'none'; }
// 5. Simulation de la génération generateBtn.addEventListener('click', () => { const prompt = promptInput.value.trim(); if (!prompt) { promptInput.focus(); promptInput.style.borderColor = 'var(--accent)'; setTimeout(() => promptInput.style.borderColor = 'var(--border)', 2000); return; }
if (isGenerating) return; isGenerating = true;
// UI Updates generateBtn.disabled = true; generateBtn.innerHTML = '<i class="fas fa-spinner fa-spin"></i> Génération...'; loadingOverlay.classList.add('active'); videoControls.style.display = 'none'; videoPlaceholder.classList.remove('video-active'); videoPlaceholder.style.backgroundImage = 'none';
// Reset Placeholder to default but hide text while loading videoPlaceholder.innerHTML = ` <div style="text-align: center; color: var(--text-secondary); opacity: 0;"> <i class="fas fa-film" style="font-size: 3rem; margin-bottom: 15px;"></i> <p>Aperçu de la vidéo</p> </div> `;
// Simulation des étapes const steps = [ { pct: 0, text: "Analyse du prompt..." }, { pct: 20, text: "Génération des keyframes..." }, { pct: 45, text: "Interpolation des mouvements..." }, { pct: 70, text: "Rendu des textures..." }, { pct: 90, text: "Encodage final..." }, { pct: 100, text: "Terminé !" } ];
let stepIndex = 0; const interval = setInterval(() => { if (stepIndex >= steps.length) { clearInterval(interval); finishGeneration(prompt); return; }
const step = steps[stepIndex]; progressFill.style.width = step.pct + '%'; statusText.textContent = step.text; stepIndex++;
}, 600); // 600ms par étape (environ 3.6s total) });
function finishGeneration(prompt) { isGenerating = false; // Masquer le loader loadingOverlay.classList.remove('active'); // Réafficher le bouton generateBtn.disabled = false; generateBtn.innerHTML = '<i class="fas fa-sparkles"></i> Générer la vidéo';
// Afficher le résultat (Simulation) const randomSeed = Math.floor(Math.random() * 1000); const thumbUrl = `https://picsum.photos/seed/${randomSeed}/800/450`; videoPlaceholder.style.backgroundImage = `url('${thumbUrl}')`; videoPlaceholder.classList.add('video-active'); videoPlaceholder.innerHTML = ` <div class="video-overlay"> <h3 style="color:white; margin-bottom:10px; font-size:0.9rem;">Résultat généré</h3> <button class="play-btn"><i class="fas fa-play"></i></button> </div> `; videoControls.style.display = 'flex';
// Ajouter à l'historique const newItem = { id: Date.now(), prompt: prompt, style: document.getElementById('styleSelect').value, duration: document.getElementById('durationSelect').value + 's', thumb: thumbUrl }; historyData.unshift(newItem); // Ajouter au début renderHistory(); }
// Init renderHistory();
</script></body>
</html>index.html+914-834