عرض وتحميل PDF مع إعلان متجاوب body { font-family: 'Cairo', sans-serif; background: #f9fafb; color: #111; padding: 20px; text-align: center; transition: all 0.4s ease; } .btn { padding:12px 24px; border-radius:12px; font-size:16px; font-weight:bold; border:none; transition:all 0.3s ease; display:inline-block; cursor:pointer; } .btn-blue {background:#2563eb; color:#fff;} .btn-blue:hover {background:#1d4ed8; transform:scale(1.05);} .btn-green {background:#16a34a; color:#fff;} .btn-green:hover {background:#15803d; transform:scale(1.05);} iframe { width: 100%; height: 500px; border: none; border-radius: 12px; margin-top: 15px; } /* إعلان وسط الصفحة */ .ad-container { margin:20px auto; max-width:700px; background:#fff; border:1px solid #ddd; border-radius:12px; padding:10px; box-shadow:0 4px 10px rgba(0,0,0,0.05); } /* إعلان ثابت أسفل الصفحة */ .sticky-ad { position: fixed; bottom: 0; left: 0; width: 100%; background: #fff; border-top: 2px solid #ddd; text-align: center; z-index: 9999; padding: 8px 0; box-shadow: 0 -3px 10px rgba(0,0,0,0.2); display: none; } /* زر إغلاق الإعلان */ .close-ad { position: absolute; top: -25px; right: 10px; background: #ef4444; color: #fff; border: none; border-radius: 50%; width: 28px; height: 28px; cursor: pointer; font-size: 14px; line-height: 28px; } /* مؤقت التحميل */ #downloadBtn.waiting { background: #f59e0b; cursor: not-allowed; transform: scale(1); } 📄 عرض وتحميل ملف PDF 📄 عرض الـ PDF ⬇️ تحميل الملف ❌ ✖ (adsbygoogle = window.adsbygoogle || []).push({}); (adsbygoogle = window.adsbygoogle || []).push({}); // عرض PDF document.getElementById("showPdfBtn").addEventListener("click", () => { document.getElementById("pdfContainer").style.display = "block"; document.getElementById("pdfFrame").src = "https://docs.google.com/gview?url=https://www.najahni.tn/wp-content/uploads/2025/08/devoir-controle-n1correction.pdf&embedded=true"; }); // إغلاق PDF document.getElementById("closePdfBtn").addEventListener("click", () => { document.getElementById("pdfContainer").style.display = "none"; document.getElementById("pdfFrame").src = ""; }); // زر التحميل مع مؤقت وتنزيل مباشر document.getElementById("downloadBtn").addEventListener("click", () => { let btn = document.getElementById("downloadBtn"); let seconds = 6; btn.disabled = true; btn.classList.add("waiting"); btn.innerText = `⏳ تحميل بعد ${seconds} ثواني`; let timer = setInterval(() => { seconds--; btn.innerText = `⏳ تحميل بعد ${seconds} ثواني`; if (seconds === 0) { clearInterval(timer); btn.disabled = false; btn.classList.remove("waiting"); btn.innerText = "⬇️ جاري التحميل..."; // تحميل الملف مباشرة let link = document.createElement("a"); link.href = "https://www.najahni.tn/wp-content/uploads/2025/08/تركيب-الجملة-سنة-ثانية.pdf"; link.download = ""; document.body.appendChild(link); link.click(); document.body.removeChild(link); btn.innerText = "✅ تم التحميل"; } }, 1000); }); // إظهار الإعلان الثابت بعد 3 ثواني على الجوال فقط if (window.innerWidth { document.getElementById('stickyAd').style.display = 'block'; }, 3000); } ⬅ العودة لصفحة فروض المراقبة عدد1 رباضبات سابعة اساسي #back-to-year { position: sticky; /* يظل مرئيًا عند التمرير */ bottom: 20px; margin: 20px auto 0 auto; display: block; width: fit-content; padding: 12px 25px; background: linear-gradient(90deg, #4f46e5, #3b82f6); color: #fff; font-size: 1rem; font-weight: 600; border-radius: 10px; text-decoration: none; box-shadow: 0 6px 12px rgba(0,0,0,0.15); text-align: center; cursor: pointer; transition: transform 0.3s, box-shadow 0.3s, background 0.3s; } #back-to-year:hover { transform: translateY(-3px); box-shadow: 0 12px 24px rgba(0,0,0,0.2); background: linear-gradient(90deg, #3b82f6, #4f46e5); } @media(max-width:600px){ #back-to-year{ width:80%; padding:12px; font-size:0.95rem; } } // إضافة وظيفة النقر على الزر للعودة للصفحة المحددة document.getElementById("back-to-year").addEventListener("click", function(){ window.location.href = "https://www.najahni.tn/فروض-مراقبة-عدد-1-في-الرياضيات-للسنة-7-أس/"; // استبدل بالرابط الصحيح });