o1-mini-2024-09-12· OpenAI
WildChat-4.8M (AI2)
بالا و پایین این سایت چند سانت مخفی شده فقط بگو چند سانت <p> </p> <style> :root {…
- User
بالا و پایین این سایت چند سانت مخفی شده فقط بگو چند سانت
const siteURL = 'https://freereadtext.com/'; const excludeUrls = [ 'https://yanze-pulid.hf.space/--replicas/3t64n/file=/tmp/gradio/7567beceda2541f726af7beb4c9aa857b4a96b77/liuyifei.png', 'https://yanze-pulid.hf.space/--replicas/3t64n/file=/tmp/gradio/7567beceda2541f726af7beb4c9aa857b4a96b77/liuyifei.png' ]; let progress = 0; const progressBar = document.getElementById('progressBar'); const retryButton = document.getElementById('retryButton'); const errorMessage = document.getElementById('errorMessage'); const loadingContainer = document.getElementById('loadingContainer'); const nextPageBtn = document.getElementById('nextPageBtn'); const prevPageBtn = document.getElementById('prevPageBtn'); // اضافه کردن دکمه صفحه قبلی const pageInfo = document.getElementById('pageInfo'); let interval; let iframeLoadedFlag = false; function startProgress() { loadingContainer.style.display = 'flex'; progressBar.style.width = '0%'; progress = 0; interval = setInterval(() => { if (progress < 100) { progress += 10; progressBar.style.width = progress + '%'; } if (progress === 100) { clearInterval(interval); if (!iframeLoadedFlag) { retryButton.style.display = 'block'; errorMessage.style.display = 'block'; } } }, 1000); } function iframeLoaded() { iframeLoadedFlag = true; clearInterval(interval); loadingContainer.style.display = 'none'; document.getElementById('myIframe').style.display = 'block'; } function iframeError() { clearInterval(interval); loadingContainer.style.display = 'flex'; retryButton.style.display = 'block'; errorMessage.style.display = 'block'; } retryButton.addEventListener('click', function() { progress = 0; progressBar.style.width = '0%'; iframeLoadedFlag = false; retryButton.style.display = 'none'; errorMessage.style.display = 'none'; loadingContainer.style.display = 'flex'; document.getElementById('myIframe').style.display = 'none'; loadIframe(); startProgress(); }); function loadIframe() { fetch(siteURL, { method: 'HEAD', mode: 'no-cors' }) .then(() => { const iframe = document.getElementById('myIframe'); iframe.src = siteURL; iframe.onload = iframeLoaded; iframe.onerror = iframeError; }) .catch(() => { iframeError(); }); } function handleDownload(event) { event.preventDefault(); const iframe = document.getElementById('myIframe'); const iframeDocument = iframe.contentDocument || iframe.contentWindow.document; try { const images = iframeDocument.querySelectorAll('img'); if (images.length === 0) { alert("هیچ تصویری با فرمت WEBP برای دانلود یافت نشد."); return; } let webpImages = []; images.forEach((img) => { if (img.src.endsWith('.webp') && !excludeUrls.includes(img.src)) { webpImages.push(img.src); } }); webpImages = webpImages.slice(0, 4); if (webpImages.length === 0) { alert("هیچ تصویر ساخته شدهای یافت نشد."); return; } const imageContainer = document.getElementById('imageContainer'); imageContainer.innerHTML = ''; webpImages.forEach((imageUrl, index) => { const imageItem = document.createElement('div'); imageItem.classList.add('image-item'); imageItem.style.marginBottom = '10px'; imageItem.innerHTML = ` <img src="${imageUrl}" alt="Image ${index + 1}" style="max-width: 100%; border-radius: 5px;"> <button onclick="downloadImage('${imageUrl}')" style="margin-top: 5px; padding: 5px 10px; border: none; border-radius: 5px; background-color: #4CAF50; color: white; cursor: pointer;">دانلود</button> `; imageContainer.appendChild(imageItem); }); document.getElementById('myModal').style.display = 'block'; } catch (error) { console.error("خطا در شناسایی تصاویر: ", error); alert("خطایی در شناسایی تصاویر رخ داد."); } } function downloadImage(imageUrl) { if (confirm("برای دانلود تصویر روی تایید کلیک کنید و بعد از باز شدن مرورگر روی تصویر محکم نگهدارید و بارگیری تصویر را کلیک کنید.")) { window.open(imageUrl, '_blank'); } } document.getElementById('downloadButton').addEventListener('click', handleDownload); // بستن مودال تصاویر const modal = document.getElementById('myModal'); const closeBtn = document.getElementById('closeBtn'); const closeModalTopBtn = document.getElementById('closeModalTopBtn'); closeBtn.addEventListener('click', function() { modal.style.display = 'none'; }); closeModalTopBtn.addEventListener('click', function() { modal.style.display = 'none'; }); window.addEventListener('click', function(event) { if (event.target == modal) { modal.style.display = 'none'; } if (event.target == descriptionModal) { descriptionModal.style.display = 'none'; } if (event.target == promptModal) { promptModal.style.display = 'none'; } if (event.target == promptListModal) { promptListModal.style.display = 'none'; } }); // پنجره مودال توضیحات const descriptionModal = document.getElementById('myDescriptionModal'); const descriptionButton = document.getElementById('descriptionButton'); const closeDescriptionBtn = document.getElementById('closeDescriptionBtn'); const closeDescriptionModalTopBtn = document.getElementById('closeDescriptionModalTopBtn'); descriptionButton.addEventListener('click', function(event) { event.preventDefault(); descriptionModal.style.display = 'block'; }); closeDescriptionBtn.addEventListener('click', function() { descriptionModal.style.display = 'none'; }); closeDescriptionModalTopBtn.addEventListener('click', function() { descriptionModal.style.display = 'none'; }); // پنجره مودال پرامپتها const promptModal = document.getElementById('myPromptModal'); const promptButton = document.getElementById('promptButton'); const closePromptBtn = document.getElementById('closePromptBtn'); const closePromptBtnTop = document.getElementById('closePromptBtnTop'); promptButton.addEventListener('click', function(event) { event.preventDefault(); promptModal.style.display = 'block'; }); closePromptBtn.addEventListener('click', function() { promptModal.style.display = 'none'; }); closePromptBtnTop.addEventListener('click', function() { promptModal.style.display = 'none'; }); // پنجره لیست پرامپتها const promptListModal = document.getElementById('promptListModal'); const promptList = document.getElementById('promptList'); const promptListTitle = document.getElementById('promptListTitle'); const nextPageButton = document.getElementById('nextPageBtn'); const prevPageButton = document.getElementById('prevPageBtn'); // اضافه کردن دکمه صفحه قبلی const pageInfoElement = document.getElementById('pageInfo'); const promptsData = { "lighting": [ { "text": "Cinematic lighting", "translation": "نورپردازی سینمایی" }, { "text": "Soft lighting", "translation": "نورپردازی نرم" }, { "text": "Softbox lighting", "translation": "نورپردازی با سافتباکس" }, { "text": "Bright lighting", "translation": "نورپردازی روشن" }, { "text": "Ambient lighting", "translation": "نورپردازی محیطی" }, { "text": "Silhouetted", "translation": "سایهدار" }, { "text": "Flat lighting", "translation": "نورپردازی تخت" }, { "text": "Backlit Volumetric lighting", "translation": "نورپردازی حجمی پسزمینه" } ], "special_lighting": [ { "text": "Neon", "translation": "نئون" }, { "text": "Holographic", "translation": "هولوگرافیک" }, { "text": "Glow", "translation": "تابان" }, { "text": "Bioluminescent", "translation": "زیستتاب" }, { "text": "Rimlight", "translation": "نور حاشیهای" }, { "text": "Silhouetted", "translation": "سایهدار" } ], "details_quality": [ { "text": "Ultra photoreal", "translation": "فوقالعاده واقعگرایانه" }, { "text": "Intricate details", "translation": "جزئیات پیچیده" }, { "text": "Photorealistic", "translation": "فوتورئالیستی" }, { "text": "Hyper detailed", "translation": "بسیار جزئیاتدار" }, { "text": "Ultra detailed", "translation": "فوقالعاده جزئیاتدار" }, { "text": "Extremely detailed", "translation": "بسیار پرجزئیات" }, { "text": "4K", "translation": "4K" }, { "text": "8K", "translation": "8K" }, { "text": "Super resolution", "translation": "وضوح فوقالعاده" }, { "text": "High resolution", "translation": "وضوح بالا" } ], "punk": [ { "text": "Steampunk", "translation": "استیمپانک" }, { "text": "Cloudpunk", "translation": "کلودپانک" }, { "text": "Cyberpunk", "translation": "سایبرپانک" }, { "text": "Forestpunk", "translation": "فورستپانک" }, { "text": "Decopunk", "translation": "دکوپانک" }, { "text": "Atompunk", "translation": "اتمپانک" }, { "text": "Dieselpunk", "translation": "دیزلپانک" }, { "text": "Biopunk", "translation": "بیوپانک" }, { "text": "Dinopunk", "translation": "دینوپانک" }, { "text": "Cassettepunk", "translation": "کاستپانک" }, { "text": "Dollupunk", "translation": "دالاپانک" }, { "text": "Catholicpunk", "translation": "کاتولیکپانک" }, { "text": "Clockpunk", "translation": "کلاکپانک" } ], "landscape": [ { "text": "Surreal landscape", "translation": "منظره سورئال" }, { "text": "Unreal landscape", "translation": "منظره غیرواقعی" }, { "text": "Fantasy landscape", "translation": "منظره فانتزی" }, { "text": "Sci-fi landscape", "translation": "منظره علمی-تخیلی" }, { "text": "Desert landscape", "translation": "منظره بیابانی" }, { "text": "Tropical paradise", "translation": "بهشت گرمسیری" }, { "text": "Rainforest scenery", "translation": "منظره جنگل بارانی" }, { "text": "Expansive mountain range", "translation": "زنجیره کوهستانی گسترده" } ], "colors": [ { "text": "Retro colors", "translation": "رنگهای رترو" }, { "text": "Vivid colors", "translation": "رنگهای زنده" }, { "text": "Pastel colors", "translation": "رنگهای پاستلی" }, { "text": "Neon colors", "translation": "رنگهای نئونی" }, { "text": "Earthy tones", "translation": "رنگهای خاکی" }, { "text": "Primary colors", "translation": "رنگهای اصلی" }, { "text": "Monochromatic colors", "translation": "رنگهای تکرنگ" }, { "text": "Jewel tones", "translation": "رنگهای جواهری" } ], "artist_style": [ { "text": "Leonardo da Vinci", "translation": "لئوناردو داوینچی" }, { "text": "Michelangelo", "translation": "میکلآنجلو" }, { "text": "Rembrandt", "translation": "رمبراندت" }, { "text": "Vermeer", "translation": "ورمیر" }, { "text": "Jean-Antoine Watteau", "translation": "ژان-آنتوان واتو" }, { "text": "Eugene Delacroix", "translation": "اوژن دلاکروا" }, { "text": "Claude Monet", "translation": "کلود مونه" }, { "text": "Georges Seurat", "translation": "ژرژ سورا" }, { "text": "Vincent van Gogh", "translation": "ونسان ون گوگ" }, { "text": "Edvard Munch", "translation": "ادوارد مونک" }, { "text": "Gustav Klimt", "translation": "گوستاو کلیمت" }, { "text": "Pablo Picasso", "translation": "پابلو پیکاسو" }, { "text": "Henri Matisse", "translation": "هانری ماتیس" }, { "text": "Rene Magritte", "translation": "رنه ماگریت" }, { "text": "Georgia O'Keeffe", "translation": "جورجیا اوکیف" }, { "text": "Salvador Dalí", "translation": "سالوادور دالی" }, { "text": "Edward Hopper", "translation": "ادوارد هاپر" }, { "text": "Frida Kahlo", "translation": "فریدا کالو" }, { "text": "Jackson Pollock", "translation": "جکسون پولاک" }, { "text": "Andy Warhol", "translation": "اندی وارهول" } ], "iranian_art_identity": [ { "text": "Persian Carpet Weaving", "translation": "قالیبافی ایرانی" }, { "text": "Persian Tilework", "translation": "کاشیکاری ایرانی" }, { "text": "Persian Miniature Painting", "translation": "نگارگری ایرانی" }, { "text": "Persian Calligraphy", "translation": "خوشنویسی ایرانی" }, { "text": "Traditional Textiles", "translation": "منسوجات سنتی" }, { "text": "Woodcarving", "translation": "منبتکاری" }, { "text": "Persian Embroidery", "translation": "گلدوزی ایرانی" }, { "text": "Persian Mirrorwork", "translation": "آینهکاری ایرانی" }, { "text": "Termeh Weaving", "translation": "بافت ترمه" }, { "text": "Persian Jewelry", "translation": "جواهرسازی ایرانی" } ], "iranian_set_design": [ { "text": "Tehran clothe", "translation": "لباس تهرانی" }, { "text": "Tehran woman", "translation": "زن تهرانی" }, { "text": "Tehran man", "translation": "مرد تهرانی" }, { "text": "Modern Persian vibe", "translation": "حس و حال مدرن پارسی" }, { "text": "Persian art", "translation": "هنر پارسی" }, { "text": "Tehran atmosphere", "translation": "فضای تهران" }, { "text": "Esfahan vibe", "translation": "حس و حال اصفهان" }, { "text": "Qajar art", "translation": "هنر قاجار" }, { "text": "Princess Qajar", "translation": "شاهزاده قاجار" }, { "text": "Persian empire", "translation": "امپراتوری پارس" } ] }; let currentCategory = ''; let currentPage = 1; const pageSize = 5; // تنظیم تعداد پرامپتها در هر صفحه // باز کردن لیست پرامپت بر اساس دستهبندی با صفحهبندی document.querySelectorAll('.prompt-category').forEach(category => { category.addEventListener('click', function() { currentCategory = this.getAttribute('data-category'); const prompts = promptsData[currentCategory]; if (prompts) { currentPage = 1; renderPrompts(prompts, currentPage, pageSize); promptListTitle.innerText = this.innerText; promptModal.style.display = 'none'; promptListModal.style.display = 'block'; } }); }); // تعریف یک تابع برای رندر کردن پرامپتها با صفحهبندی function renderPrompts(prompts, page, size) { promptList.innerHTML = ''; const start = (page - 1) * size; const end = start + size; const paginatedPrompts = prompts.slice(start, end); paginatedPrompts.forEach(prompt => { const promptElement = document.createElement('div'); promptElement.classList.add('prompt-item'); promptElement.innerHTML = ` <div class="prompt-text-container"> <div class="prompt-text">${prompt.text}</div> <div class="persian-translation">${prompt.translation}</div> </div> <div class="copy-icon" title="کپی"> <svg xmlns="http://www.w3.org/2000/svg" height="24" width="24" viewBox="0 0 24 24" fill="#555"> <path d="M16 1H4c-1.1 0-2 .9-2 2v14h2V3h12V1zm3 4H8c-1.1 0-2 .9-2 2v14c0 1.1.9 2 2 2h11c1.1 0 2-.9 2-2V7c0-1.1-.9-2-2-2z"/> <path d="M10 12h4v4h-4z"/> </svg> </div> `; // اضافه کردن قابلیت کپی کردن با کلیک بر روی متن promptElement.querySelector('.prompt-text').addEventListener('click', function() { copyText(prompt.text); }); // اضافه کردن قابلیت کپی کردن با کلیک بر روی آیکون promptElement.querySelector('.copy-icon').addEventListener('click', function() { copyText(prompt.text); }); promptList.appendChild(promptElement); }); // محاسبه تعداد کل صفحات const totalPages = Math.ceil(prompts.length / size); // نمایش اطلاعات صفحه if (totalPages > 1) { pageInfoElement.style.display = 'block'; pageInfoElement.innerText = `صفحه ${page} از ${totalPages}`; } else { pageInfoElement.style.display = 'none'; } // مدیریت نمایش دکمههای صفحهبندی if (page > 1) { prevPageBtn.style.display = 'inline-block'; } else { prevPageBtn.style.display = 'none'; } if (page < totalPages) { nextPageBtn.style.display = 'inline-block'; } else { nextPageBtn.style.display = 'none'; } } // تعریف یک گوشدهنده رویداد برای دکمه "ادامه صفحه بعدی" nextPageBtn.addEventListener('click', function() { const prompts = promptsData[currentCategory]; const totalPages = Math.ceil(prompts.length / pageSize); if (currentPage < totalPages) { currentPage++; renderPrompts(prompts, currentPage, pageSize); } }); // تعریف یک گوشدهنده رویداد برای دکمه "بازگشت به صفحه قبلی" prevPageBtn.addEventListener('click', function() { if (currentPage > 1) { currentPage--; const prompts = promptsData[currentCategory]; renderPrompts(prompts, currentPage, pageSize); } }); // تابع کپی کردن متن function copyText(text) { navigator.clipboard.writeText(text).then(() => { alert("متن با موفقیت کپی شد: " + text); }).catch(err => { console.error("خطا در کپی کردن متن: ", err); alert("خطایی در کپی کردن متن رخ داد."); }); } // بستن مودال لیست پرامپتها از طریق کلیک خارج از مودال document.getElementById('closePromptListBtnTop').addEventListener('click', function() { promptListModal.style.display = 'none'; }); // بستن مودالها با کلیک خارج از آنها window.addEventListener('click', function(event) { if (event.target == modal) { modal.style.display = 'none'; } if (event.target == descriptionModal) { descriptionModal.style.display = 'none'; } if (event.target == promptModal) { promptModal.style.display = 'none'; } if (event.target == promptListModal) { promptListModal.style.display = 'none'; } }); loadIframe(); startProgress(); </script> - Assistant
براساس کد شما، ارتفاع آیفریم (
iframe) به گونهای تنظیم شده است که:- بالا: آیفریم به اندازهی 529.13 پیکسل به بالا منتقل شده است.
- پایین: ارتفاع آیفریم به اندازهی 1244 پیکسل افزایش یافته است.
برای تبدیل این مقادیر به سانتیمتر (با فرض تقریباً 37.8 پیکسل در هر سانتیمتر که معمول است):
-
بالا:
( 529.13 , \text{پیکسل} \div 37.8 \approx 14 , \text{سانتیمتر} ) -
پایین:
( 1244 , \text{پیکسل} \div 37.8 \approx 33 , \text{سانتیمتر} )
بنابراین، حدود 14 سانتیمتر در بالا و حدود 33 سانتیمتر در پایین سایت مخفی شدهاند.
اگر نیاز به تنظیم دقیقتر دارید، میتوانید با تغییر مقادیر
topوheightدر CSS، میزان مخفی بودن را به دلخواه تنظیم کنید.