Sada8888 commited on
Commit
db70610
·
verified ·
1 Parent(s): 2dde19d

Update templates/image_studio.html

Browse files
Files changed (1) hide show
  1. templates/image_studio.html +30 -8
templates/image_studio.html CHANGED
@@ -369,7 +369,7 @@
369
  </div>
370
  <div class="orb-ring one"></div><div class="orb-ring two"></div><div class="orb-ring three"></div>
371
  </div>
372
- <h1>آتلیه هوش مصنوعی</h1>
373
  <p class="subtitle">ایده‌های خود را به بهترین تصاویر خیره‌کننده تبدیل کنید</p>
374
  <div id="subscription-status-badge">درحال بررسی...</div>
375
  </div>
@@ -747,14 +747,14 @@
747
  </div>
748
  `;
749
 
750
- // دانلود از طریق ارسال پیام به والد (مشابه دکمه دانلود اصلی)
751
  modal.querySelector('#btn-download-img').onclick = () => {
752
  window.triggerDownload(url);
753
  };
754
 
755
  const copyBtn = modal.querySelector('#btn-copy-prompt');
756
  copyBtn.onclick = () => {
757
- navigator.clipboard.writeText(promptText).then(() => {
 
758
  const originalHtml = copyBtn.innerHTML;
759
  copyBtn.innerHTML = `<svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><polyline points="20 6 9 17 4 12"></polyline></svg> کپی شد!`;
760
  copyBtn.style.background = 'var(--accent-secondary)';
@@ -764,7 +764,32 @@
764
  copyBtn.style.background = '';
765
  copyBtn.style.color = '';
766
  }, 2000);
767
- });
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
768
  };
769
 
770
  modal.onclick = (e) => {
@@ -880,6 +905,7 @@
880
  document.addEventListener('DOMContentLoaded', async () => {
881
  userFingerprint = await getBrowserFingerprint();
882
  parent.postMessage({ type: 'REQUEST_USER_DATA' }, '*');
 
883
  initDB().then(() => loadHistory()).catch(e => console.error("Database init error:", e));
884
  });
885
 
@@ -1012,7 +1038,6 @@
1012
  <div class="progress-bar" id="tv-progress-bar"></div>
1013
  </div>
1014
  `;
1015
- imageResultContainer.scrollIntoView({ behavior: 'smooth', block: 'center' });
1016
 
1017
  // راه‌اندازی تایمر هشدار 2 دقیقه‌ای (120000 میلی‌ثانیه)
1018
  activeTimeoutTimer = setTimeout(() => {
@@ -1051,9 +1076,6 @@
1051
 
1052
  const dims = getDimensions(selectedRatio);
1053
  let finalPrompt = userPrompt;
1054
- if(selectedModelAction === 'generate-cartoon') {
1055
- finalPrompt += " کارتونی انیمیشن سه بعدی";
1056
- }
1057
 
1058
  try {
1059
  const res = await fetch('/api/generate', {
 
369
  </div>
370
  <div class="orb-ring one"></div><div class="orb-ring two"></div><div class="orb-ring three"></div>
371
  </div>
372
+ <h1>استودیو ساخت تصاویر آلفا</h1>
373
  <p class="subtitle">ایده‌های خود را به بهترین تصاویر خیره‌کننده تبدیل کنید</p>
374
  <div id="subscription-status-badge">درحال بررسی...</div>
375
  </div>
 
747
  </div>
748
  `;
749
 
 
750
  modal.querySelector('#btn-download-img').onclick = () => {
751
  window.triggerDownload(url);
752
  };
753
 
754
  const copyBtn = modal.querySelector('#btn-copy-prompt');
755
  copyBtn.onclick = () => {
756
+ // --- شروع کد اصلاح شده برای کپی کردن ---
757
+ const showSuccess = () => {
758
  const originalHtml = copyBtn.innerHTML;
759
  copyBtn.innerHTML = `<svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><polyline points="20 6 9 17 4 12"></polyline></svg> کپی شد!`;
760
  copyBtn.style.background = 'var(--accent-secondary)';
 
764
  copyBtn.style.background = '';
765
  copyBtn.style.color = '';
766
  }, 2000);
767
+ };
768
+
769
+ const fallbackCopy = () => {
770
+ const textArea = document.createElement("textarea");
771
+ textArea.value = promptText;
772
+ textArea.style.position = "fixed";
773
+ textArea.style.top = "-9999px";
774
+ textArea.style.left = "-9999px";
775
+ document.body.appendChild(textArea);
776
+ textArea.focus();
777
+ textArea.select();
778
+ try {
779
+ document.execCommand('copy');
780
+ showSuccess();
781
+ } catch (err) {
782
+ console.error('Fallback copy failed', err);
783
+ }
784
+ document.body.removeChild(textArea);
785
+ };
786
+
787
+ if (navigator.clipboard && window.isSecureContext) {
788
+ navigator.clipboard.writeText(promptText).then(showSuccess).catch(fallbackCopy);
789
+ } else {
790
+ fallbackCopy();
791
+ }
792
+ // --- پایان کد اصلاح شده ---
793
  };
794
 
795
  modal.onclick = (e) => {
 
905
  document.addEventListener('DOMContentLoaded', async () => {
906
  userFingerprint = await getBrowserFingerprint();
907
  parent.postMessage({ type: 'REQUEST_USER_DATA' }, '*');
908
+ document.getElementById('upgrade-button').addEventListener('click', () => { parent.postMessage({ type: 'NAVIGATE_TO_PREMIUM' }, '*'); });
909
  initDB().then(() => loadHistory()).catch(e => console.error("Database init error:", e));
910
  });
911
 
 
1038
  <div class="progress-bar" id="tv-progress-bar"></div>
1039
  </div>
1040
  `;
 
1041
 
1042
  // راه‌اندازی تایمر هشدار 2 دقیقه‌ای (120000 میلی‌ثانیه)
1043
  activeTimeoutTimer = setTimeout(() => {
 
1076
 
1077
  const dims = getDimensions(selectedRatio);
1078
  let finalPrompt = userPrompt;
 
 
 
1079
 
1080
  try {
1081
  const res = await fetch('/api/generate', {