| <!DOCTYPE html> |
| <html lang="ar" dir="rtl"> |
| <head> |
| <meta charset="UTF-8"> |
| <meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=no"> |
| <title>Mihon Telegram Edition</title> |
| <script src="https://telegram.org/js/telegram-web-app.js"></script> |
| <style> |
| :root { |
| --bg-color: #121212; |
| --card-bg: #1e1e1e; |
| --text-color: #e0e0e0; |
| --accent-color: #3f51b5; |
| } |
| body { |
| background-color: var(--bg-color); |
| color: var(--text-color); |
| font-family: sans-serif; |
| margin: 0; padding: 0; |
| user-select: none; |
| } |
| |
| .navbar { |
| background: var(--card-bg); |
| padding: 15px; |
| display: flex; |
| justify-content: space-between; |
| align-items: center; |
| position: sticky; top: 0; z-index: 1000; |
| box-shadow: 0 2px 10px rgba(0,0,0,0.5); |
| } |
| |
| .search-bar { |
| background: #2c2c2c; |
| border-radius: 20px; |
| padding: 8px 15px; |
| display: flex; |
| width: 80%; |
| } |
| .search-bar input { |
| background: transparent; |
| border: none; |
| color: white; |
| width: 100%; |
| outline: none; |
| } |
| |
| .manga-grid { |
| display: grid; |
| grid-template-columns: repeat(3, 1fr); |
| gap: 10px; |
| padding: 10px; |
| } |
| .manga-card { |
| background: var(--card-bg); |
| border-radius: 8px; |
| overflow: hidden; |
| position: relative; |
| aspect-ratio: 2/3; |
| } |
| .manga-card img { |
| width: 100%; |
| height: 100%; |
| object-fit: cover; |
| } |
| .manga-title { |
| position: absolute; |
| bottom: 0; width: 100%; |
| background: rgba(0,0,0,0.7); |
| font-size: 11px; |
| padding: 5px; |
| text-align: center; |
| white-space: nowrap; |
| overflow: hidden; |
| text-overflow: ellipsis; |
| } |
| |
| #reader-view { |
| display: none; |
| position: fixed; |
| top: 0; left: 0; width: 100%; height: 100%; |
| background: black; |
| z-index: 2000; |
| overflow-y: auto; |
| } |
| .reader-img { width: 100%; display: block; } |
| .back-btn { |
| position: fixed; top: 10px; right: 10px; |
| background: rgba(0,0,0,0.5); |
| color: white; border: none; padding: 10px; |
| border-radius: 50%; z-index: 2100; |
| } |
| </style> |
| </head> |
| <body> |
|
|
| <div id="main-view"> |
| <div class="navbar"> |
| <div class="search-bar"> |
| <input type="text" id="search-input" placeholder="ابحث في Olympus..." onchange="searchManga()"> |
| </div> |
| </div> |
|
|
| <div class="manga-grid" id="manga-list"> |
| <div class="loading" style="grid-column: span 3; text-align: center; padding: 50px;">جاري جلب البيانات من Olympus...</div> |
| </div> |
| </div> |
|
|
| <div id="reader-view"> |
| <button class="back-btn" onclick="closeReader()">✕</button> |
| <div id="images-container"></div> |
| </div> |
|
|
| <script> |
| const tg = window.Telegram.WebApp; |
| tg.expand(); |
| |
| |
| async function fetchPopular() { |
| const url = 'https://olympustaff.com/series/'; |
| const proxy = 'https://api.allorigins.win/get?url=' + encodeURIComponent(url); |
| |
| try { |
| const response = await fetch(proxy); |
| const data = await response.json(); |
| const parser = new DOMParser(); |
| const doc = parser.parseFromString(data.contents, 'text/html'); |
| |
| |
| const items = doc.querySelectorAll('div.listupd div.bsx'); |
| const list = document.getElementById('manga-list'); |
| list.innerHTML = ''; |
| |
| items.forEach(item => { |
| const title = item.querySelector('a').getAttribute('title'); |
| const link = item.querySelector('a').getAttribute('href'); |
| const img = item.querySelector('img').getAttribute('src'); |
| |
| const card = document.createElement('div'); |
| card.className = 'manga-card'; |
| card.onclick = () => openManga(link); |
| card.innerHTML = ` |
| <img src="${img}" loading="lazy"> |
| <div class="manga-title">${title}</div> |
| `; |
| list.appendChild(card); |
| }); |
| } catch (e) { |
| console.error("Error fetching data"); |
| } |
| } |
| |
| async function openManga(link) { |
| |
| |
| tg.MainButton.setText("جاري فتح الفصل...").show(); |
| const proxy = 'https://api.allorigins.win/get?url=' + encodeURIComponent(link); |
| const res = await fetch(proxy); |
| const data = await res.json(); |
| const doc = new DOMParser().parseFromString(data.contents, 'text/html'); |
| |
| |
| const firstChapter = doc.querySelector('div.chapter-card a').href; |
| loadImages(firstChapter); |
| } |
| |
| async function loadImages(chapterUrl) { |
| const proxy = 'https://api.allorigins.win/get?url=' + encodeURIComponent(chapterUrl); |
| const res = await fetch(proxy); |
| const data = await res.json(); |
| const doc = new DOMParser().parseFromString(data.contents, 'text/html'); |
| |
| const images = doc.querySelectorAll('div.image_list img'); |
| const container = document.getElementById('images-container'); |
| container.innerHTML = ''; |
| |
| images.forEach(img => { |
| const src = img.getAttribute('data-src') || img.getAttribute('src'); |
| const newImg = document.createElement('img'); |
| newImg.src = src; |
| newImg.className = 'reader-img'; |
| container.appendChild(newImg); |
| }); |
| |
| document.getElementById('reader-view').style.display = 'block'; |
| tg.MainButton.hide(); |
| } |
| |
| function closeReader() { |
| document.getElementById('reader-view').style.display = 'none'; |
| } |
| |
| |
| fetchPopular(); |
| </script> |
| </body> |
| </html> |