<!DOCTYPE html> <html lang="fa"> <head> <meta charset="UTF-8"> <title>صفحه با iframe و…
- User
/* متغیر CSS برای ارتفاع نمایشگر */ :root { --vh: 100%; } /* حالت عادی */ .iframe-container.normal { position: relative; width: 100%; height: 100vh; overflow: hidden; } .iframe-container.normal iframe { width: 100%; height: 100%; border: none; display: none; position: relative; top: 0; } /* حالت تمام صفحه */ .iframe-container.fullscreen { position: fixed; top: 0; left: 0; width: 100%; height: calc(var(--vh) * 100); /* استفاده از متغیر --vh */ overflow: hidden; /* مخفی کردن بخشهای اضافی */ z-index: 1; /* ترتیب نمایش */ } .iframe-container.fullscreen iframe { position: absolute; top: -228px; /* پنهان کردن ۶ سانتیمتر بالای صفحه (228px) */ left: 0; width: 100%; height: calc((var(--vh) * 100) + 228px + 38px); /* افزایش ارتفاع iframe به اندازه ۶ سانتیمتر بالا و ۱ سانتیمتر پایین */ border: none; display: block; } /* استایلهای مشترک */ .loading { position: absolute; top: 50%; left: 50%; transform: translate(-50%, -50%); display: flex; flex-direction: column; align-items: center; z-index: 10000; } .loading-message { margin-bottom: 20px; font-size: 18px; } .progress { width: 80%; max-width: 400px; height: 20px; background-color: #ddd; border-radius: 5px; overflow: hidden; } .progress-bar { height: 100%; width: 0; background-color: #4caf50; transition: width 1s; } .error-message { display: none; color: red; margin-top: 20px; font-size: 16px; text-align: center; } #retryButton { display: none; margin-top: 10px; padding: 10px 20px; font-size: 16px; cursor: pointer; background-color: #4caf50; color: white; border: none; border-radius: 5px; } /* استایل پنجره سفارشی (modal) */ .modal { display: none; position: fixed; z-index: 10002; left: 0; top: 0; width: 100%; height: 100%; background-color: rgba(0, 0, 0, 0.5); } .modal-content { background-color: #fefefe; margin: 15% auto; padding: 20px; border: 1px solid #888; width: 80%; max-width: 500px; text-align: center; border-radius: 5px; } .modal-button { margin-top: 20px; padding: 10px 20px; border: none; border-radius: 5px; cursor: pointer; font-size: 14px; } .cancel-btn { background-color: #f44336; color: white; } .image-container { display: flex; flex-wrap: wrap; justify-content: center; } .image-item { margin: 10px; text-align: center; } .image-item img { width: 80px; height: 80px; object-fit: cover; border-radius: 5px; margin-bottom: 5px; } .image-item button { background-color: #4CAF50; color: white; padding: 5px 10px; border: none; border-radius: 5px; cursor: pointer; font-size: 12px; } .image-item button:hover { background-color: #45a049; } @media (max-width: 768px) { /* تنظیمات واکنشگرا برای عناصر دیگر در صورت نیاز */ } @keyframes pulse { 0% { transform: translateY(-50%) scale(1); } 50% { transform: translateY(-50%) scale(1.1); } 100% { transform: translateY(-50%) scale(1); } } /* Overlay برای مخفی کردن بخشهای اضافی */ .overlay-top { position: fixed; top: 0; left: 0; width: 100%; height: 228px; /* ارتفاع ۶ سانتیمتر (228px) */ background-color: transparent; /* رنگ پسزمینه شفاف */ z-index: 900; /* زیر iframe-container */ pointer-events: none; /* اجازه دادن به اسکرول از طریق iframe */ display: none; /* مخفی در حالت عادی */ } .overlay-bottom { position: fixed; bottom: 0; left: 0; width: 100%; height: 38px; /* ارتفاع ۱ سانتیمتر (38px) */ background-color: transparent; /* رنگ پسزمینه شفاف */ z-index: 900; /* زیر iframe-container */ pointer-events: none; /* اجازه دادن به اسکرول از طریق iframe */ display: none; /* مخفی در حالت عادی */ } </style> - Assistant
The HTML document you provided includes a webpage setup with an iframe and overlays, along with a loading indicator, modal dialogs, and responsive design considerations. Here’s a brief summary of its components:
- User
یک کد کوتاه پایتون بنویس
- Assistant
در زیر یک کد کوتاه پایتون آورده شده است که اولین ۱۰ عدد فیبوناچی را چاپ میکند:
def fibonacci(n): fib_sequence = [0, 1] for i in range(2, n): next_value = fib_sequence[i - 1] + fib_sequence[i - 2] fib_sequence.append(next_value) return fib_sequence # چاپ اولین 10 عدد فیبوناچی fib_numbers = fibonacci(10) print(fib_numbers)این کد از یک تابع به نام
fibonacciاستفاده میکند که یک عددnرا به عنوان ورودی میگیرد و یک فهرست از اولینnعدد دنباله فیبوناچی را برمیگرداند. سپس این فهرست چاپ میشود.