315 lines
No EOL
20 KiB
HTML
315 lines
No EOL
20 KiB
HTML
<!DOCTYPE html>
|
||
<html lang="en">
|
||
|
||
<head>
|
||
<meta charset="UTF-8">
|
||
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
||
<title>aPix Image Workspace</title>
|
||
<link rel="icon" type="image/png" href="{{ url_for('static', filename='sdvn-logo.png') }}">
|
||
<link rel="stylesheet" href="{{ url_for('static', filename='style.css') }}">
|
||
<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=Be+Vietnam+Pro:wght@400;500;600;700&family=Playwrite+AU+SA&display=swap"
|
||
rel="stylesheet">
|
||
</head>
|
||
|
||
<body>
|
||
<div class="app-container">
|
||
<aside class="sidebar">
|
||
<div class="sidebar-header">
|
||
<div class="brand">
|
||
<h1>aPix <span class="badge">by SDVN</span></h1>
|
||
</div>
|
||
<button type="button" class="toolbar-info-btn info-icon-btn" data-popup-target="help"
|
||
aria-label="Thông tin và hướng dẫn">
|
||
<span aria-hidden="true">i</span>
|
||
</button>
|
||
</div>
|
||
|
||
<div class="controls-section">
|
||
<div class="controls-content">
|
||
<div class="input-group">
|
||
<label for="api-key">API Key</label>
|
||
<input type="password" id="api-key" placeholder="Google Cloud API Key">
|
||
</div>
|
||
|
||
<div class="input-group">
|
||
<label for="prompt">Prompt</label>
|
||
<div class="prompt-wrapper">
|
||
<textarea id="prompt" placeholder="Describe your imagination..." rows="6"></textarea>
|
||
<button id="refine-prompt-btn" class="prompt-refine-btn" title="Refine with AI">
|
||
<svg fill="currentColor" height="16px" width="16px" version="1.1" id="Layer_1"
|
||
xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink"
|
||
viewBox="0 0 512.422 512.422" xml:space="preserve">
|
||
<g>
|
||
<g>
|
||
<g>
|
||
<path d="M41.053,223.464c2.667,1.067,5.76,1.067,8.427-0.213l83.307-37.867c5.333-2.56,7.573-8.96,5.013-14.293
|
||
c-2.453-5.12-8.533-7.467-13.76-5.12l-58.347,26.56c27.84-83.307,105.387-138.987,194.667-138.987
|
||
c93.547,0,175.36,62.507,198.933,152c1.493,5.653,7.36,9.067,13.013,7.573c5.653-1.493,9.067-7.36,7.573-13.013
|
||
c-26.027-98.773-116.267-167.893-219.52-167.893c-98.453,0-184.107,61.44-215.04,153.387l-24.533-61.333
|
||
c-1.813-5.547-7.893-8.64-13.44-6.827c-5.547,1.813-8.64,7.893-6.827,13.44c0.107,0.427,0.32,0.853,0.533,1.28l34.027,85.333
|
||
C36.146,220.158,38.279,222.398,41.053,223.464z" />
|
||
<path
|
||
d="M511.773,380.904c-0.107-0.213-0.213-0.427-0.213-0.64l-34.027-85.333c-1.067-2.667-3.2-4.907-5.973-5.973
|
||
c-2.667-1.067-5.76-0.96-8.427,0.213l-83.307,37.867c-5.44,2.24-8,8.533-5.76,13.973c2.24,5.44,8.533,8,13.973,5.76
|
||
c0.213-0.107,0.427-0.213,0.64-0.32l58.347-26.56c-28.053,83.307-105.707,138.987-194.88,138.987
|
||
c-93.547,0-175.36-62.507-198.933-152c-1.493-5.653-7.36-9.067-13.013-7.573c-5.653,1.493-9.067,7.36-7.573,13.013
|
||
c25.92,98.88,116.267,167.893,219.52,167.893c98.453,0,184-61.44,215.04-153.387l24.533,61.333
|
||
c2.027,5.547,8.107,8.427,13.653,6.4C510.919,392.531,513.799,386.451,511.773,380.904z" />
|
||
</g>
|
||
</g>
|
||
</g>
|
||
</svg>
|
||
</button>
|
||
</div>
|
||
</div>
|
||
|
||
<div class="input-group image-inputs">
|
||
<div class="image-input-header">
|
||
<label>Reference Images</label>
|
||
</div>
|
||
<div id="image-input-grid" class="image-input-grid" aria-live="polite"></div>
|
||
</div>
|
||
|
||
<div class="input-group">
|
||
<label for="aspect-ratio">Aspect Ratio</label>
|
||
<select id="aspect-ratio">
|
||
<option value="Auto">Auto (Default)</option>
|
||
<option value="1:1">1:1 (Square)</option>
|
||
<option value="16:9">16:9 (Widescreen)</option>
|
||
<option value="4:3">4:3 (Standard)</option>
|
||
<option value="3:4">3:4 (Portrait)</option>
|
||
<option value="9:16">9:16 (Mobile)</option>
|
||
<option value="2:3">2:3</option>
|
||
<option value="3:2">3:2</option>
|
||
<option value="4:5">4:5</option>
|
||
<option value="5:4">5:4</option>
|
||
<option value="21:9">21:9 (Cinema)</option>
|
||
</select>
|
||
</div>
|
||
|
||
<div class="input-group">
|
||
<label for="resolution">Resolution</label>
|
||
<select id="resolution">
|
||
<option value="1K" selected>1K</option>
|
||
<option value="2K">2K</option>
|
||
<option value="4K">4K</option>
|
||
</select>
|
||
</div>
|
||
</div>
|
||
<div class="controls-footer">
|
||
<button id="generate-btn">
|
||
<span>Generate</span>
|
||
<div class="btn-shine"></div>
|
||
</button>
|
||
</div>
|
||
</div>
|
||
</aside>
|
||
<div class="sidebar-resize-handle" aria-hidden="true"></div>
|
||
<div class="content-area">
|
||
<main class="main-content">
|
||
<div class="image-display-area">
|
||
<div id="placeholder-state" class="state-view">
|
||
<div class="icon-placeholder"></div>
|
||
</div>
|
||
|
||
<div id="loading-state" class="state-view hidden">
|
||
<div class="spinner"></div>
|
||
<p>Creating masterpiece...</p>
|
||
</div>
|
||
|
||
<div id="error-state" class="state-view hidden">
|
||
<div class="error-icon">⚠️</div>
|
||
<p id="error-text"></p>
|
||
</div>
|
||
|
||
<div id="template-gallery-state" class="state-view hidden">
|
||
<!-- Language Toggle in top-left corner -->
|
||
<div class="canvas-lang-toggle">
|
||
<label class="canvas-lang-switch">
|
||
<input type="checkbox" id="canvas-lang-input">
|
||
<span class="canvas-lang-slider">
|
||
<span class="canvas-lang-option active" data-lang="vi">VI</span>
|
||
<span class="canvas-lang-option" data-lang="en">EN</span>
|
||
</span>
|
||
</label>
|
||
</div>
|
||
<div id="template-gallery-container" class="template-gallery-container"></div>
|
||
</div>
|
||
|
||
<div id="result-state" class="state-view hidden">
|
||
<img id="generated-image" src="" alt="Generated Image">
|
||
<div class="canvas-toolbar" role="toolbar">
|
||
<button type="button" class="canvas-btn" data-action="toggle-template"
|
||
aria-label="Toggle template view" title="Chọn mẫu prompt">
|
||
<svg width="20" height="20" viewBox="0 0 24 24" fill="none"
|
||
xmlns="http://www.w3.org/2000/svg">
|
||
<path
|
||
d="M19 3H5C3.89543 3 3 3.89543 3 5V19C3 20.1046 3.89543 21 5 21H19C20.1046 21 21 20.1046 21 19V5C21 3.89543 20.1046 3 19 3Z"
|
||
stroke="currentColor" stroke-width="2" stroke-linecap="round"
|
||
stroke-linejoin="round" />
|
||
<path d="M3 9H21" stroke="currentColor" stroke-width="2" stroke-linecap="round"
|
||
stroke-linejoin="round" />
|
||
<path d="M9 21V9" stroke="currentColor" stroke-width="2" stroke-linecap="round"
|
||
stroke-linejoin="round" />
|
||
</svg>
|
||
</button>
|
||
<button type="button" id="create-template-btn" class="canvas-btn icon-btn"
|
||
aria-label="Create Template" title="Tạo Template">
|
||
<svg width="20" height="20" viewBox="0 0 24 24" fill="none"
|
||
xmlns="http://www.w3.org/2000/svg">
|
||
<path d="M10 14H12M12 14H14M12 14V16M12 14V12" stroke="currentColor"
|
||
stroke-width="1.5" stroke-linecap="round" />
|
||
<path
|
||
d="M22 11.7979C22 9.16554 22 7.84935 21.2305 6.99383C21.1598 6.91514 21.0849 6.84024 21.0062 6.76946C20.1506 6 18.8345 6 16.2021 6H15.8284C14.6747 6 14.0979 6 13.5604 5.84678C13.2651 5.7626 12.9804 5.64471 12.7121 5.49543C12.2237 5.22367 11.8158 4.81578 11 4L10.4497 3.44975C10.1763 3.17633 10.0396 3.03961 9.89594 2.92051C9.27652 2.40704 8.51665 2.09229 7.71557 2.01738C7.52976 2 7.33642 2 6.94975 2C6.06722 2 5.62595 2 5.25839 2.06935C3.64031 2.37464 2.37464 3.64031 2.06935 5.25839C2 5.62595 2 6.06722 2 6.94975M21.9913 16C21.9554 18.4796 21.7715 19.8853 20.8284 20.8284C19.6569 22 17.7712 22 14 22H10C6.22876 22 4.34315 22 3.17157 20.8284C2 19.6569 2 17.7712 2 14V11"
|
||
stroke="currentColor" stroke-width="1.5" stroke-linecap="round" />
|
||
</svg>
|
||
</button>
|
||
<button type="button" class="canvas-btn" data-action="zoom-out">−</button>
|
||
<button type="button" class="canvas-btn" data-action="zoom-in">+</button>
|
||
<button type="button" class="canvas-btn icon-btn" data-action="zoom-reset"
|
||
aria-label="Reset view">↺</button>
|
||
<a id="download-link" href="#" download="gemini_image.png" class="canvas-btn icon-btn"
|
||
aria-label="Download image">
|
||
<svg width="20" height="20" viewBox="0 0 24 24" fill="none"
|
||
xmlns="http://www.w3.org/2000/svg">
|
||
<path
|
||
d="M12.5535 16.5061C12.4114 16.6615 12.2106 16.75 12 16.75C11.7894 16.75 11.5886 16.6615 11.4465 16.5061L7.44648 12.1311C7.16698 11.8254 7.18822 11.351 7.49392 11.0715C7.79963 10.792 8.27402 10.8132 8.55352 11.1189L11.25 14.0682V3C11.25 2.58579 11.5858 2.25 12 2.25C12.4142 2.25 12.75 2.58579 12.75 3V14.0682L15.4465 11.1189C15.726 10.8132 16.2004 10.792 16.5061 11.0715C16.8118 11.351 16.833 11.8254 16.5535 12.1311L12.5535 16.5061Z"
|
||
fill="currentColor" />
|
||
<path
|
||
d="M3.75 15C3.75 14.5858 3.41422 14.25 3 14.25C2.58579 14.25 2.25 14.5858 2.25 15V15.0549C2.24998 16.4225 2.24996 17.5248 2.36652 18.3918C2.48754 19.2919 2.74643 20.0497 3.34835 20.6516C3.95027 21.2536 4.70814 21.5125 5.60825 21.6335C6.47522 21.75 7.57754 21.75 8.94513 21.75H15.0549C16.4225 21.75 17.5248 21.75 18.3918 21.6335C19.2919 21.5125 20.0497 21.2536 20.6517 20.6516C21.2536 20.0497 21.5125 19.2919 21.6335 18.3918C21.75 17.5248 21.75 16.4225 21.75 15.0549V15C21.75 14.5858 21.4142 14.25 21 14.25C20.5858 14.25 20.25 14.5858 20.25 15C20.25 16.4354 20.2484 17.4365 20.1469 18.1919C20.0482 18.9257 19.8678 19.3142 19.591 19.591C19.3142 19.8678 18.9257 20.0482 18.1919 20.1469C17.4365 20.2484 16.4354 20.25 15 20.25H9C7.56459 20.25 6.56347 20.2484 5.80812 20.1469C5.07435 20.0482 4.68577 19.8678 4.40901 19.591C4.13225 19.3142 3.9518 18.9257 3.85315 18.1919C3.75159 17.4365 3.75 16.4354 3.75 15Z"
|
||
fill="currentColor" />
|
||
</svg>
|
||
</a>
|
||
</div>
|
||
</div>
|
||
</div>
|
||
</main>
|
||
<section class="history-section">
|
||
<h3>History</h3>
|
||
<div id="gallery-grid" class="gallery-grid">
|
||
<!-- Gallery items will be injected here -->
|
||
</div>
|
||
</section>
|
||
</div>
|
||
</div>
|
||
<div id="refine-modal" class="popup-overlay hidden">
|
||
<div class="popup-card">
|
||
<header class="popup-header">
|
||
<h2>Refine Prompt</h2>
|
||
<button id="close-refine-modal" type="button" class="popup-close" aria-label="Close">×</button>
|
||
</header>
|
||
<div class="popup-body">
|
||
<p style="color: var(--text-secondary); font-size: 0.9rem; margin-bottom: 0.5rem;">How would you like to
|
||
change the current prompt?</p>
|
||
<textarea id="refine-instruction" placeholder="e.g. Make it more realistic, add dramatic lighting..."
|
||
rows="3"></textarea>
|
||
<div class="controls-footer" style="margin-top: 1rem; justify-content: flex-end; align-items: center;">
|
||
<button id="confirm-refine-btn">
|
||
<span>Refine</span>
|
||
<div class="btn-shine"></div>
|
||
</button>
|
||
<div id="refine-loading" class="hidden" style="color: var(--accent-color);">
|
||
<svg class="rotating-icon" fill="currentColor" height="32px" width="32px" version="1.1"
|
||
xmlns="http://www.w3.org/2000/svg" viewBox="0 0 512.422 512.422">
|
||
<path d="M41.053,223.464c2.667,1.067,5.76,1.067,8.427-0.213l83.307-37.867c5.333-2.56,7.573-8.96,5.013-14.293
|
||
c-2.453-5.12-8.533-7.467-13.76-5.12l-58.347,26.56c27.84-83.307,105.387-138.987,194.667-138.987
|
||
c93.547,0,175.36,62.507,198.933,152c1.493,5.653,7.36,9.067,13.013,7.573c5.653-1.493,9.067-7.36,7.573-13.013
|
||
c-26.027-98.773-116.267-167.893-219.52-167.893c-98.453,0-184.107,61.44-215.04,153.387l-24.533-61.333
|
||
c-1.813-5.547-7.893-8.64-13.44-6.827c-5.547,1.813-8.64,7.893-6.827,13.44c0.107,0.427,0.32,0.853,0.533,1.28l34.027,85.333
|
||
C36.146,220.158,38.279,222.398,41.053,223.464z" />
|
||
<path
|
||
d="M511.773,380.904c-0.107-0.213-0.213-0.427-0.213-0.64l-34.027-85.333c-1.067-2.667-3.2-4.907-5.973-5.973
|
||
c-2.667-1.067-5.76-0.96-8.427,0.213l-83.307,37.867c-5.44,2.24-8,8.533-5.76,13.973c2.24,5.44,8.533,8,13.973,5.76
|
||
c0.213-0.107,0.427-0.213,0.64-0.32l58.347-26.56c-28.053,83.307-105.707,138.987-194.88,138.987
|
||
c-93.547,0-175.36-62.507-198.933-152c-1.493-5.653-7.36-9.067-13.013-7.573c-5.653,1.493-9.067,7.36-7.573,13.013
|
||
c25.92,98.88,116.267,167.893,219.52,167.893c98.453,0,184-61.44,215.04-153.387l24.533,61.333
|
||
c2.027,5.547,8.107,8.427,13.653,6.4C510.919,392.531,513.799,386.451,511.773,380.904z" />
|
||
</svg>
|
||
</div>
|
||
</div>
|
||
</div>
|
||
</div>
|
||
</div>
|
||
|
||
<!-- Create Template Modal -->
|
||
<div id="create-template-modal" class="popup-overlay hidden">
|
||
<div class="popup-card" style="max-width: 600px;">
|
||
<header class="popup-header">
|
||
<h2>Create Template</h2>
|
||
<button id="close-template-modal" type="button" class="popup-close" aria-label="Close">×</button>
|
||
</header>
|
||
<div class="popup-body">
|
||
<div class="template-form-grid">
|
||
<div class="form-group">
|
||
<label for="template-title">Title</label>
|
||
<input type="text" id="template-title" placeholder="Template Name">
|
||
</div>
|
||
|
||
<div class="form-group">
|
||
<label>Preview Image</label>
|
||
<div id="template-preview-dropzone" class="template-preview-dropzone">
|
||
<img id="template-preview-img" src="" alt="Preview" class="hidden">
|
||
<div class="dropzone-placeholder">
|
||
<span>Drag & Drop Image or Click to Enter URL</span>
|
||
</div>
|
||
<input type="text" id="template-preview-url" class="template-preview-url-input hidden"
|
||
placeholder="Enter image URL or path">
|
||
</div>
|
||
</div>
|
||
|
||
<div class="form-group">
|
||
<label for="template-prompt">Prompt</label>
|
||
<textarea id="template-prompt" rows="3" placeholder="Template Prompt"></textarea>
|
||
</div>
|
||
|
||
<div class="form-row">
|
||
<div class="form-group">
|
||
<label for="template-mode">Mode</label>
|
||
<select id="template-mode">
|
||
<option value="generate">Generate</option>
|
||
<option value="edit">Edit</option>
|
||
</select>
|
||
</div>
|
||
<div class="form-group">
|
||
<label for="template-category">Category</label>
|
||
<div class="category-input-wrapper">
|
||
<select id="template-category-select">
|
||
<option value="User">User</option>
|
||
<option value="Cinematic">Cinematic</option>
|
||
<option value="Anime">Anime</option>
|
||
<option value="Photography">Photography</option>
|
||
<option value="Digital Art">Digital Art</option>
|
||
<option value="new">+ New Category</option>
|
||
</select>
|
||
<input type="text" id="template-category-input" class="hidden"
|
||
placeholder="New Category Name">
|
||
</div>
|
||
</div>
|
||
</div>
|
||
</div>
|
||
|
||
<div class="controls-footer" style="margin-top: 1.5rem; justify-content: flex-end;">
|
||
<button id="save-template-btn">
|
||
<span>Save Template</span>
|
||
<div class="btn-shine"></div>
|
||
</button>
|
||
</div>
|
||
</div>
|
||
</div>
|
||
</div>
|
||
<div id="popup-overlay" class="popup-overlay hidden" role="dialog" aria-modal="true" aria-labelledby="popup-title">
|
||
<div class="popup-card">
|
||
<header class="popup-header">
|
||
<h2 id="popup-title"></h2>
|
||
<button id="popup-close" type="button" class="popup-close" aria-label="Close">×</button>
|
||
</header>
|
||
<div id="popup-body" class="popup-body"></div>
|
||
</div>
|
||
</div>
|
||
<script type="module" src="{{ url_for('static', filename='script.js') }}"></script>
|
||
</body>
|
||
|
||
</html> |