Update templates/editor.html
Browse files- templates/editor.html +20 -25
templates/editor.html
CHANGED
|
@@ -92,12 +92,18 @@
|
|
| 92 |
.upgrade-btn { display: none; width: 100%; margin-top: 1rem; padding: 1rem; background: linear-gradient(90deg, #FFD54F, #FFC107); border: none; border-radius: var(--radius-btn); color: #212529; font-weight: 800; font-size: 1.1rem; cursor: pointer; text-align: center; font-family: inherit; box-shadow: 0 6px 15px rgba(255, 193, 7, 0.3); transition: transform 0.3s; }
|
| 93 |
.upgrade-btn:hover { transform: translateY(-3px); }
|
| 94 |
|
| 95 |
-
/* Result Area */
|
| 96 |
-
#image-result-container {
|
| 97 |
-
#image-result-container.loading { border-style: solid; border-color: var(--panel-border); }
|
| 98 |
-
#image-result-container.has-content { border-style: solid; border-color: var(--panel-border); background-color: transparent; padding: 0;}
|
| 99 |
|
| 100 |
-
.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 101 |
.noise-layer, .sketch-layer, .building-layer { position: absolute; top: 0; left: 0; width: 100%; height: 100%; }
|
| 102 |
.noise-layer { background: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" width="100" height="100"><rect width="100" height="100" fill="none"/><filter id="noise"><feTurbulence type="fractalNoise" baseFrequency="0.5" numOctaves="4" stitchTiles="stitch"/></filter><rect width="100%" height="100%" filter="url(%23noise)" opacity="0.6"/></svg>') repeat; opacity: 1; animation: fade-noise 7s infinite ease-in-out; }
|
| 103 |
@keyframes fade-noise { 0% { opacity: 1; filter: blur(5px); } 30% { opacity: 0.8; filter: blur(2px); } 100% { opacity: 0; filter: blur(0px); } }
|
|
@@ -112,13 +118,10 @@
|
|
| 112 |
.text-overlay { position: absolute; top: 45%; left: 50%; transform: translate(-50%, -50%); font-size: 20px; font-weight: 700; text-shadow: 0 0 20px rgba(56, 189, 248, 0.8); animation: glow-text 7s infinite ease-in-out; font-family: var(--app-font); z-index: 2; text-align: center; width: 90%; }
|
| 113 |
.progress-bar { position: absolute; bottom: 0; left: 0; width: 0%; height: 6px; background: linear-gradient(to right, #38bdf8, #bb86fc, #facc15); transition: width 0.3s linear; z-index: 2; }
|
| 114 |
|
| 115 |
-
#result-image-wrapper { display: none; width: 100%; display: flex; flex-direction: column; align-items: center; gap: 1rem; }
|
| 116 |
-
#result-image-display { max-width: 100%; border-radius: var(--radius-input); box-shadow: var(--shadow-lg); border: 1px solid var(--panel-border); }
|
| 117 |
-
|
| 118 |
.download-btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; width: 100%; max-width: 300px; padding: 0.9rem; background: var(--accent-primary); color: #fff; border: none; border-radius: var(--radius-btn); font-family: inherit; font-weight: 700; cursor: pointer; transition: var(--transition-smooth); box-shadow: 0 4px 10px rgba(74, 108, 250, 0.3); }
|
| 119 |
.download-btn:hover { background: var(--accent-primary-hover); transform: translateY(-3px); box-shadow: 0 6px 15px rgba(74, 108, 250, 0.4); }
|
| 120 |
|
| 121 |
-
/* --- History Section Styles
|
| 122 |
.history-section { display: none; animation: fadeIn 0.5s ease-out; }
|
| 123 |
.history-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 1.5rem; }
|
| 124 |
.history-header h3 { font-size: 1.1rem; font-weight: 700; color: var(--text-primary); display: flex; align-items: center; gap: 8px; margin: 0; }
|
|
@@ -136,7 +139,7 @@
|
|
| 136 |
.history-delete-btn { margin-top: auto; padding: 6px; background: transparent; color: var(--danger-color); border: 1px dashed var(--danger-color); border-radius: 6px; cursor: pointer; font-family: inherit; font-size: 0.8rem; font-weight: 600; transition: var(--transition-smooth); }
|
| 137 |
.history-delete-btn:hover { background: var(--danger-color); color: white; border-style: solid; }
|
| 138 |
|
| 139 |
-
/* --- Image View Modal & Toolbar
|
| 140 |
.image-view-modal { position: fixed; top: 0; left: 0; width: 100vw; height: 100vh; background-color: rgba(26, 32, 44, 0.95); z-index: 2000; display: flex; flex-direction: column; align-items: center; opacity: 0; animation: fadeInBackdrop 0.3s forwards; overflow-y: auto; padding: 40px 20px; }
|
| 141 |
.image-view-wrapper { margin: auto; display: flex; flex-direction: column; align-items: center; gap: 12px; width: 100%; max-width: 800px; position: relative; }
|
| 142 |
.image-view-modal img { max-width: 100%; border-radius: var(--radius-card); box-shadow: 0 0 30px rgba(0,0,0,0.5); object-fit: contain; }
|
|
@@ -226,12 +229,9 @@
|
|
| 226 |
۳. نتیجه نهایی
|
| 227 |
</div>
|
| 228 |
<div id="image-result-container">
|
| 229 |
-
<
|
| 230 |
-
|
| 231 |
-
|
| 232 |
-
<div class="noise-layer"></div><div class="sketch-layer"></div><div class="building-layer"></div><div class="pixel-grid"></div><div class="particles"></div>
|
| 233 |
-
<div class="text-overlay" id="loading-text">در حال پردازش...</div>
|
| 234 |
-
<div class="progress-bar" id="tv-progress-bar"></div>
|
| 235 |
</div>
|
| 236 |
</div>
|
| 237 |
</div>
|
|
@@ -718,8 +718,6 @@
|
|
| 718 |
<div class="progress-bar" id="tv-progress-bar"></div>
|
| 719 |
</div>
|
| 720 |
`;
|
| 721 |
-
imageResultContainer.classList.remove('has-content');
|
| 722 |
-
imageResultContainer.classList.add('loading');
|
| 723 |
imageResultContainer.scrollIntoView({ behavior: 'smooth', block: 'center' });
|
| 724 |
|
| 725 |
// تایمر هشدار ۲ دقیقهای
|
|
@@ -783,14 +781,12 @@
|
|
| 783 |
|
| 784 |
const absoluteUrl = window.location.origin + statusData.url;
|
| 785 |
|
| 786 |
-
imageResultContainer.classList.remove('loading');
|
| 787 |
-
imageResultContainer.classList.add('has-content');
|
| 788 |
imageResultContainer.innerHTML = `
|
| 789 |
-
<div style="font-weight: bold; margin-bottom:
|
| 790 |
-
<div
|
| 791 |
-
<img id="result-image-display" src="${statusData.url}" alt="تصویر ویرایش شده">
|
| 792 |
<button class="download-btn" onclick="triggerDownload('${absoluteUrl}')">
|
| 793 |
-
<svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2"><path d="M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4"></path><polyline points="7 10 12 15 17 10"></polyline><line x1="12" y1="15" x2="12" y2="3"></line></svg>
|
| 794 |
دانلود مستقیم تصویر
|
| 795 |
</button>
|
| 796 |
</div>
|
|
@@ -823,7 +819,6 @@
|
|
| 823 |
clearInterval(fakeProgressInterval);
|
| 824 |
clearTimeout(activeTimeoutTimer);
|
| 825 |
imageResultContainer.innerHTML = `<div style="color: var(--danger-color); font-weight:bold; text-align:center; padding: 2rem;">خطا: ${msg}</div>`;
|
| 826 |
-
imageResultContainer.classList.remove('loading');
|
| 827 |
resetBtn();
|
| 828 |
}
|
| 829 |
|
|
|
|
| 92 |
.upgrade-btn { display: none; width: 100%; margin-top: 1rem; padding: 1rem; background: linear-gradient(90deg, #FFD54F, #FFC107); border: none; border-radius: var(--radius-btn); color: #212529; font-weight: 800; font-size: 1.1rem; cursor: pointer; text-align: center; font-family: inherit; box-shadow: 0 6px 15px rgba(255, 193, 7, 0.3); transition: transform 0.3s; }
|
| 93 |
.upgrade-btn:hover { transform: translateY(-3px); }
|
| 94 |
|
| 95 |
+
/* --- Result Area Standardized --- */
|
| 96 |
+
#image-result-container { display: flex; width: 100%; flex-direction: column; align-items: center; gap: 1rem; margin-top: 1rem; padding-top: 2rem; border-top: 1px solid var(--panel-border); animation: fadeIn 0.5s ease-out; }
|
|
|
|
|
|
|
| 97 |
|
| 98 |
+
.empty-placeholder { width: 400px; max-width: 100%; height: 300px; border: 2px dashed var(--input-border); border-radius: 20px; background-color: transparent; display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center; }
|
| 99 |
+
.empty-placeholder svg { color: var(--text-tertiary); margin-bottom: 15px; opacity: 0.5; width: 48px; height: 48px; }
|
| 100 |
+
.empty-placeholder p { color: var(--text-tertiary); font-size: 0.95rem; font-weight: 600; margin: 0; }
|
| 101 |
+
|
| 102 |
+
.generated-image-box { width: 100%; display: flex; flex-direction: column; align-items: center; gap: 1rem; }
|
| 103 |
+
.generated-image-box img { max-width: 100%; max-height: 500px; border-radius: var(--radius-input); border: 1px solid var(--panel-border); box-shadow: var(--shadow-lg); object-fit: contain; cursor: pointer; transition: transform 0.2s;}
|
| 104 |
+
.generated-image-box img:hover { transform: scale(1.02); }
|
| 105 |
+
|
| 106 |
+
.generator-container { position: relative; width: 400px; max-width: 100%; height: 300px; border: 2px solid #38bdf8; border-radius: 20px; overflow: hidden; box-shadow: 0 0 40px rgba(56, 189, 248, 0.3); animation: pulse-loader 5s infinite cubic-bezier(0.4, 0, 0.6, 1); background-color: #161b22; color: #f0f6fc; margin: 0 auto; }
|
| 107 |
.noise-layer, .sketch-layer, .building-layer { position: absolute; top: 0; left: 0; width: 100%; height: 100%; }
|
| 108 |
.noise-layer { background: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" width="100" height="100"><rect width="100" height="100" fill="none"/><filter id="noise"><feTurbulence type="fractalNoise" baseFrequency="0.5" numOctaves="4" stitchTiles="stitch"/></filter><rect width="100%" height="100%" filter="url(%23noise)" opacity="0.6"/></svg>') repeat; opacity: 1; animation: fade-noise 7s infinite ease-in-out; }
|
| 109 |
@keyframes fade-noise { 0% { opacity: 1; filter: blur(5px); } 30% { opacity: 0.8; filter: blur(2px); } 100% { opacity: 0; filter: blur(0px); } }
|
|
|
|
| 118 |
.text-overlay { position: absolute; top: 45%; left: 50%; transform: translate(-50%, -50%); font-size: 20px; font-weight: 700; text-shadow: 0 0 20px rgba(56, 189, 248, 0.8); animation: glow-text 7s infinite ease-in-out; font-family: var(--app-font); z-index: 2; text-align: center; width: 90%; }
|
| 119 |
.progress-bar { position: absolute; bottom: 0; left: 0; width: 0%; height: 6px; background: linear-gradient(to right, #38bdf8, #bb86fc, #facc15); transition: width 0.3s linear; z-index: 2; }
|
| 120 |
|
|
|
|
|
|
|
|
|
|
| 121 |
.download-btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; width: 100%; max-width: 300px; padding: 0.9rem; background: var(--accent-primary); color: #fff; border: none; border-radius: var(--radius-btn); font-family: inherit; font-weight: 700; cursor: pointer; transition: var(--transition-smooth); box-shadow: 0 4px 10px rgba(74, 108, 250, 0.3); }
|
| 122 |
.download-btn:hover { background: var(--accent-primary-hover); transform: translateY(-3px); box-shadow: 0 6px 15px rgba(74, 108, 250, 0.4); }
|
| 123 |
|
| 124 |
+
/* --- History Section Styles --- */
|
| 125 |
.history-section { display: none; animation: fadeIn 0.5s ease-out; }
|
| 126 |
.history-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 1.5rem; }
|
| 127 |
.history-header h3 { font-size: 1.1rem; font-weight: 700; color: var(--text-primary); display: flex; align-items: center; gap: 8px; margin: 0; }
|
|
|
|
| 139 |
.history-delete-btn { margin-top: auto; padding: 6px; background: transparent; color: var(--danger-color); border: 1px dashed var(--danger-color); border-radius: 6px; cursor: pointer; font-family: inherit; font-size: 0.8rem; font-weight: 600; transition: var(--transition-smooth); }
|
| 140 |
.history-delete-btn:hover { background: var(--danger-color); color: white; border-style: solid; }
|
| 141 |
|
| 142 |
+
/* --- Image View Modal & Toolbar --- */
|
| 143 |
.image-view-modal { position: fixed; top: 0; left: 0; width: 100vw; height: 100vh; background-color: rgba(26, 32, 44, 0.95); z-index: 2000; display: flex; flex-direction: column; align-items: center; opacity: 0; animation: fadeInBackdrop 0.3s forwards; overflow-y: auto; padding: 40px 20px; }
|
| 144 |
.image-view-wrapper { margin: auto; display: flex; flex-direction: column; align-items: center; gap: 12px; width: 100%; max-width: 800px; position: relative; }
|
| 145 |
.image-view-modal img { max-width: 100%; border-radius: var(--radius-card); box-shadow: 0 0 30px rgba(0,0,0,0.5); object-fit: contain; }
|
|
|
|
| 229 |
۳. نتیجه نهایی
|
| 230 |
</div>
|
| 231 |
<div id="image-result-container">
|
| 232 |
+
<div class="empty-placeholder">
|
| 233 |
+
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="1.5" stroke-linecap="round" stroke-linejoin="round"><rect x="3" y="3" width="18" height="18" rx="2" ry="2"></rect><circle cx="8.5" cy="8.5" r="1.5"></circle><polyline points="21 15 16 10 5 21"></polyline></svg>
|
| 234 |
+
<p>تصویر و دستور خود را وارد کنید.</p>
|
|
|
|
|
|
|
|
|
|
| 235 |
</div>
|
| 236 |
</div>
|
| 237 |
</div>
|
|
|
|
| 718 |
<div class="progress-bar" id="tv-progress-bar"></div>
|
| 719 |
</div>
|
| 720 |
`;
|
|
|
|
|
|
|
| 721 |
imageResultContainer.scrollIntoView({ behavior: 'smooth', block: 'center' });
|
| 722 |
|
| 723 |
// تایمر هشدار ۲ دقیقهای
|
|
|
|
| 781 |
|
| 782 |
const absoluteUrl = window.location.origin + statusData.url;
|
| 783 |
|
|
|
|
|
|
|
| 784 |
imageResultContainer.innerHTML = `
|
| 785 |
+
<div style="font-weight: bold; margin-bottom: 15px; color: var(--accent-primary); text-align:center; font-size: 1.1rem;">ویرایش شما آماده شد! 🎨</div>
|
| 786 |
+
<div class="generated-image-box">
|
| 787 |
+
<img id="result-image-display" src="${statusData.url}" alt="تصویر ویرایش شده" onload="this.scrollIntoView({behavior: 'smooth', block: 'center'})">
|
| 788 |
<button class="download-btn" onclick="triggerDownload('${absoluteUrl}')">
|
| 789 |
+
<svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" style="width: 22px; height: 22px;"><path d="M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4"></path><polyline points="7 10 12 15 17 10"></polyline><line x1="12" y1="15" x2="12" y2="3"></line></svg>
|
| 790 |
دانلود مستقیم تصویر
|
| 791 |
</button>
|
| 792 |
</div>
|
|
|
|
| 819 |
clearInterval(fakeProgressInterval);
|
| 820 |
clearTimeout(activeTimeoutTimer);
|
| 821 |
imageResultContainer.innerHTML = `<div style="color: var(--danger-color); font-weight:bold; text-align:center; padding: 2rem;">خطا: ${msg}</div>`;
|
|
|
|
| 822 |
resetBtn();
|
| 823 |
}
|
| 824 |
|