Elias207 commited on
Commit
839f45d
·
verified ·
1 Parent(s): 0f01a39

Update index.html

Browse files
Files changed (1) hide show
  1. index.html +23 -9
index.html CHANGED
@@ -142,7 +142,6 @@
142
  #loading-placeholder { display: none; }
143
  #result-container.loading #loading-placeholder { display: flex; animation: fadeIn 0.5s; justify-content: center; align-items: center; width: 100%; }
144
 
145
- /* --- START: NEW LOADING ANIMATION STYLES --- */
146
  .generator-container {
147
  position: relative;
148
  width: 400px;
@@ -257,7 +256,6 @@
257
  0% { width: 0%; }
258
  100% { width: 100%; }
259
  }
260
- /* --- END: NEW LOADING ANIMATION STYLES --- */
261
 
262
  #result-grid { display: none; grid-template-columns: repeat(2, 1fr); gap: 1.5rem; width: 100%; }
263
  #result-container.has-content #result-grid { display: grid; }
@@ -281,11 +279,29 @@
281
  .history-delete-btn:hover { background-color: var(--panel-border); color: var(--danger-color); }
282
  .history-delete-btn svg { width: 18px; height: 18px; }
283
 
284
- #lightbox { position: fixed; inset: 0; background-color: rgba(18, 24, 38, 0.6); backdrop-filter: blur(10px) saturate(150%); display: none; align-items: center; justify-content: center; z-index: 1000; opacity: 0; transition: opacity 0.3s; pointer-events: none; }
285
- #lightbox.visible { opacity: 1; pointer-events: auto; }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
286
  #lightbox-content { position: relative; animation: fadeIn 0.3s ease; display: flex; align-items: center; justify-content: center; }
287
  #lightbox-img { max-width: 85vw; max-height: 80vh; object-fit: contain; border-radius: var(--radius-card); box-shadow: var(--shadow-xl); }
288
- .lightbox-btn { position: absolute; background-color: rgba(255, 255, 255, 0.1); color: white; border: 1px solid rgba(255,255,255,0.2); width: 44px; height: 44px; border-radius: 50%; cursor: pointer; display: flex; justify-content: center; align-items: center; transition: all 0.2s; text-decoration: none; }
289
  .lightbox-btn:hover { background-color: rgba(255, 255, 255, 0.2); transform: scale(1.1); }
290
  #lightbox-close { top: -50px; right: 0; }
291
  #lightbox-download { top: -50px; left: 0; }
@@ -368,7 +384,6 @@
368
  ۳. نتیجه را ببینید
369
  </div>
370
  <div id="result-container">
371
- <!-- START: MODIFIED LOADING PLACEHOLDER -->
372
  <div id="loading-placeholder">
373
  <div class="generator-container">
374
  <div class="noise-layer"></div>
@@ -380,7 +395,6 @@
380
  <div class="progress-bar"></div>
381
  </div>
382
  </div>
383
- <!-- END: MODIFIED LOADING PLACEHOLDER -->
384
  <div id="result-grid"></div>
385
  </div>
386
  </div>
@@ -402,7 +416,7 @@
402
  <div id="lightbox">
403
  <div id="lightbox-content">
404
  <img id="lightbox-img" src="">
405
- <button id="lightbox-close" class="lightbox-btn">&times;</button>
406
  <button id="lightbox-download" title="دانلود تصویر" class="lightbox-btn">
407
  <svg fill="white" viewBox="0 0 24 24"><path d="M19 9h-4V3H9v6H5l7 7 7-7zM5 18v2h14v-2H5z"/></svg>
408
  <div class="spinner"></div>
@@ -429,7 +443,7 @@
429
  </div>
430
 
431
  <script>
432
- // --- START OF APPLICATION LOGIC SCRIPT (Unchanged) ---
433
  const API_URL = 'https://alfa-editor-worker.onrender.com/api/edit';
434
  const uploadArea = document.getElementById('upload-area'); const fileInput = document.getElementById('file-input'); const previewImage = document.getElementById('preview-image-main'); const removeFileBtn = document.getElementById('remove-file-btn-main'); const promptInput = document.getElementById('prompt-input'); const submitBtn = document.getElementById('submit-btn'); const resultContainer = document.getElementById('result-container'); const resultGrid = document.getElementById('result-grid'); const errorMessage = document.getElementById('error-message'); const lightbox = document.getElementById('lightbox'); const lightboxImg = document.getElementById('lightbox-img'); const lightboxClose = document.getElementById('lightbox-close'); const lightboxDownload = document.getElementById('lightbox-download'); const lightboxNext = document.getElementById('lightbox-next'); const historyGrid = document.getElementById('history-grid'); const clearHistoryBtn = document.getElementById('clear-history-btn'); const confirmationModal = document.getElementById('confirmation-modal'); const modalMessageText = document.getElementById('modal-message-text'); const modalConfirmBtn = document.getElementById('modal-confirm-btn'); const modalCancelBtn = document.getElementById('modal-cancel-btn');
435
  let uploadedFile = null; let currentLightboxUrl = null; let currentLightboxGroup = []; let currentLightboxIndex = 0;
 
142
  #loading-placeholder { display: none; }
143
  #result-container.loading #loading-placeholder { display: flex; animation: fadeIn 0.5s; justify-content: center; align-items: center; width: 100%; }
144
 
 
145
  .generator-container {
146
  position: relative;
147
  width: 400px;
 
256
  0% { width: 0%; }
257
  100% { width: 100%; }
258
  }
 
259
 
260
  #result-grid { display: none; grid-template-columns: repeat(2, 1fr); gap: 1.5rem; width: 100%; }
261
  #result-container.has-content #result-grid { display: grid; }
 
279
  .history-delete-btn:hover { background-color: var(--panel-border); color: var(--danger-color); }
280
  .history-delete-btn svg { width: 18px; height: 18px; }
281
 
282
+ /* --- FIX: Corrected Lightbox CSS --- */
283
+ #lightbox {
284
+ position: fixed;
285
+ inset: 0;
286
+ background-color: rgba(18, 24, 38, 0.6);
287
+ backdrop-filter: blur(10px) saturate(150%);
288
+ display: flex; /* Changed from none to flex */
289
+ align-items: center;
290
+ justify-content: center;
291
+ z-index: 1000;
292
+ opacity: 0;
293
+ transition: opacity 0.3s;
294
+ pointer-events: none;
295
+ }
296
+ #lightbox.visible {
297
+ opacity: 1;
298
+ pointer-events: auto;
299
+ }
300
+ /* --- END OF FIX --- */
301
+
302
  #lightbox-content { position: relative; animation: fadeIn 0.3s ease; display: flex; align-items: center; justify-content: center; }
303
  #lightbox-img { max-width: 85vw; max-height: 80vh; object-fit: contain; border-radius: var(--radius-card); box-shadow: var(--shadow-xl); }
304
+ .lightbox-btn { position: absolute; background-color: rgba(255, 255, 255, 0.1); color: white; border: 1px solid rgba(255,255,255,0.2); width: 44px; height: 44px; border-radius: 50%; cursor: pointer; display: flex; justify-content: center; align-items: center; transition: all 0.2s; text-decoration: none; font-size: 24px; }
305
  .lightbox-btn:hover { background-color: rgba(255, 255, 255, 0.2); transform: scale(1.1); }
306
  #lightbox-close { top: -50px; right: 0; }
307
  #lightbox-download { top: -50px; left: 0; }
 
384
  ۳. نتیجه را ببینید
385
  </div>
386
  <div id="result-container">
 
387
  <div id="loading-placeholder">
388
  <div class="generator-container">
389
  <div class="noise-layer"></div>
 
395
  <div class="progress-bar"></div>
396
  </div>
397
  </div>
 
398
  <div id="result-grid"></div>
399
  </div>
400
  </div>
 
416
  <div id="lightbox">
417
  <div id="lightbox-content">
418
  <img id="lightbox-img" src="">
419
+ <button id="lightbox-close" class="lightbox-btn" title="بستن">&times;</button>
420
  <button id="lightbox-download" title="دانلود تصویر" class="lightbox-btn">
421
  <svg fill="white" viewBox="0 0 24 24"><path d="M19 9h-4V3H9v6H5l7 7 7-7zM5 18v2h14v-2H5z"/></svg>
422
  <div class="spinner"></div>
 
443
  </div>
444
 
445
  <script>
446
+ // --- START OF APPLICATION LOGIC SCRIPT (No changes needed here) ---
447
  const API_URL = 'https://alfa-editor-worker.onrender.com/api/edit';
448
  const uploadArea = document.getElementById('upload-area'); const fileInput = document.getElementById('file-input'); const previewImage = document.getElementById('preview-image-main'); const removeFileBtn = document.getElementById('remove-file-btn-main'); const promptInput = document.getElementById('prompt-input'); const submitBtn = document.getElementById('submit-btn'); const resultContainer = document.getElementById('result-container'); const resultGrid = document.getElementById('result-grid'); const errorMessage = document.getElementById('error-message'); const lightbox = document.getElementById('lightbox'); const lightboxImg = document.getElementById('lightbox-img'); const lightboxClose = document.getElementById('lightbox-close'); const lightboxDownload = document.getElementById('lightbox-download'); const lightboxNext = document.getElementById('lightbox-next'); const historyGrid = document.getElementById('history-grid'); const clearHistoryBtn = document.getElementById('clear-history-btn'); const confirmationModal = document.getElementById('confirmation-modal'); const modalMessageText = document.getElementById('modal-message-text'); const modalConfirmBtn = document.getElementById('modal-confirm-btn'); const modalCancelBtn = document.getElementById('modal-cancel-btn');
449
  let uploadedFile = null; let currentLightboxUrl = null; let currentLightboxGroup = []; let currentLightboxIndex = 0;