Spaces:
Runtime error
Runtime error
| <html lang="fa" dir="rtl"> | |
| <head> | |
| <meta charset="UTF-8"> | |
| <meta name="viewport" content="width=device-width, initial-scale=1.0"> | |
| <title>خاطره خوان پهلوی (نسخه آزمایشی)</title> <link href="./fonts/vazirmatn.css" rel="stylesheet" type="text/css"/> | |
| <link rel="stylesheet" href="style.css"> | |
| <style> | |
| /* این بلوک استایل می تواند حذف شود اگر تمام استایل ها به style.css منتقل شده اند */ | |
| body { | |
| font-family: 'Vazirmatn', sans-serif; /* استفاده از فونت وزیرمتن */ | |
| line-height: 1.6; /* فاصله خطوط */ | |
| margin: 0; | |
| padding: 20px; | |
| background-color: #f4f4f4; /* رنگ پس زمینه ملایم */ | |
| color: #333; /* رنگ متن اصلی */ | |
| direction: rtl; /* جهت متن راست به چپ */ | |
| text-align: right; /* تراز متن به راست */ | |
| } | |
| .container { | |
| max-width: 800px; /* حداکثر عرض کانتینر */ | |
| margin: 20px auto; /* فاصله از بالا و پایین و مرکز افقی */ | |
| background-color: #fff; /* رنگ پس زمینه کانتینر */ | |
| padding: 30px; /* پدینگ داخلی */ | |
| border-radius: 10px; /* گوشه های گرد */ | |
| box-shadow: 0 0 15px rgba(0, 0, 0, 0.1); /* سایه ملایم */ | |
| } | |
| /* استایل های بخش ها */ | |
| .book-selection, .search-area, .results-per-page, .similarity-threshold-control { | |
| margin-bottom: 20px; | |
| padding: 15px; | |
| background-color: #e9e9e9; /* رنگ پس زمینه ملایم برای بخش ها */ | |
| border-radius: 8px; /* گوشه های گرد بخش ها */ | |
| border: 1px solid #ddd; /* حاشیه بخش ها */ | |
| } | |
| .book-selection label { | |
| margin-left: 10px; /* فاصله بین لیبل و چک باکس در RTL */ | |
| } | |
| .search-area input[type="text"] { | |
| width: calc(100% - 100px); /* عرض کادر ورودی منهای دکمه و فاصله */ | |
| padding: 10px; | |
| margin-left: 10px; /* فاصله بین کادر و دکمه در RTL */ | |
| border: 1px solid #ccc; | |
| border-radius: 5px; | |
| font-size: 1em; | |
| font-family: 'Vazirmatn', sans-serif; /* اعمال فونت */ | |
| box-sizing: border-box; /* برای جلوگیری از سرریز شدن عرض */ | |
| direction: rtl; /* برای تایپ فارسی */ | |
| } | |
| .search-area button { | |
| padding: 10px 20px; | |
| background-color: #5cb85c; /* رنگ سبز */ | |
| color: white; | |
| border: none; | |
| border-radius: 5px; | |
| cursor: pointer; | |
| font-size: 1em; | |
| font-family: 'Vazirmatn', sans-serif; /* اعمال فونت */ | |
| transition: background-color 0.3s ease; /* انیمیشن تغییر رنگ */ | |
| } | |
| .search-area button:hover:not(:disabled) { | |
| background-color: #4cae4c; /* سبز تیره تر */ | |
| } | |
| .search-area button:disabled { | |
| background-color: #cccccc; /* خاکستری */ | |
| cursor: not-allowed; /* نشانگر عدم اجازه */ | |
| } | |
| .results-per-page label { margin-left: 10px; } | |
| .results-per-page select { | |
| padding: 8px; | |
| border-radius: 5px; | |
| border: 1px solid #ccc; | |
| font-family: 'Vazirmatn', sans-serif; | |
| direction: rtl; | |
| } | |
| .similarity-threshold-control { text-align: center; } | |
| .similarity-threshold-control label { margin-left: 10px; } | |
| .similarity-threshold-control input[type="number"] { | |
| padding: 8px; | |
| border-radius: 5px; | |
| border: 1px solid #ccc; | |
| font-size: 1em; | |
| width: 80px; | |
| text-align: center; | |
| font-family: 'Vazirmatn', sans-serif; | |
| direction: ltr; /* برای نمایش عدد از چپ به راست */ | |
| } | |
| .similarity-threshold-control p { margin-top: 5px; font-size: 0.8em; color: #555; } | |
| /* استایل پیام های وضعیت و خطا (به style.css منتقل شود) */ | |
| .status-message, .error-message { | |
| font-weight: bold; | |
| margin-bottom: 15px; | |
| text-align: center; | |
| /* color و background-color توسط script در style.css مدیریت می شوند */ | |
| } | |
| #searchResults { margin-top: 20px; } | |
| #searchResults p:first-child { text-align: center; } /* پیام اولیه */ | |
| .result-item { | |
| background-color: #f9f9f9; | |
| border: 1px solid #eee; | |
| border-radius: 8px; | |
| padding: 15px; | |
| margin-bottom: 15px; | |
| box-shadow: 0 0 8px rgba(0, 0, 0, 0.05); | |
| } | |
| .result-item p { margin-bottom: 8px; word-wrap: break-word; } | |
| .result-passage { font-size: 1em; color: #333; text-align: justify; } | |
| .result-reference { font-size: 0.9em; color: #555; margin-top: 10px; word-wrap: break-word; } | |
| .result-book-title { font-size: 0.85em; color: #777; font-style: italic; margin-top: 5px; word-wrap: break-word; } | |
| .result-similarity { | |
| font-size: 0.85em; | |
| color: #007bff; | |
| font-weight: bold; | |
| float: right; | |
| margin-right: 10px; | |
| direction: ltr; /* برای نمایش عدد شباهت از چپ به راست */ | |
| } | |
| .explanation-text { | |
| margin-bottom: 20px; padding: 15px; background-color: #f9f9f9; | |
| border: 1px solid #eee; | |
| border-radius: 8px; | |
| text-align: justify; | |
| line-height: 1.6; | |
| font-size: 0.95em; | |
| color: #333; | |
| } | |
| .explanation-text p { margin-bottom: 10px; } | |
| .explanation-text p:last-child { margin-bottom: 0; } | |
| .explanation-text strong { font-weight: bold; color: #333; } | |
| .app-footer { | |
| margin-top: 40px; text-align: center; font-size: 0.9em; color: #555; | |
| padding-top: 20px; border-top: 1px solid #eee; | |
| } | |
| .copy-button { | |
| padding: 5px 10px; background-color: #007bff; color: white; | |
| border: none; border-radius: 4px; cursor: pointer; | |
| font-size: 0.85em; font-family: 'Vazirmatn', sans-serif; | |
| transition: background-color 0.2s ease; | |
| display: block; margin-top: 15px; width: fit-content; | |
| margin-left: auto; margin-right: 0; /* راست چین کردن */ | |
| } | |
| .copy-button:hover { background-color: #0056b3; } | |
| .copy-button:active { background-color: #004085; } | |
| </style> | |
| </head> | |
| <body> | |
| <div class="container"> | |
| <h1>خاطره خوان پهلوی (نسخه آزمایشی)</h1> <div class="explanation-text"> | |
| <p> | |
| <strong>خاطرهخوان پهلوی چیه و به چه کار میاد؟</strong> | |
| یه دستیار خوب برای بچههای <strong>جهاد تبیین</strong> که کمک میکنه راحتتر بین <strong>خاطرات مستند دوران پهلوی</strong> بگردن و مطلب بهدردبخور پیدا کنن. | |
| </p> | |
| <p> | |
| این ابزار، دنبال کلمه نمیگرده، دنبال <strong>معنا</strong> میگرده! یعنی شما مفهوم کلی رو وارد میکنی، اون میگرده ببینه کجاها حرفش زده شده. | |
| </p> | |
| <p> | |
| فقط حواست باشه که جستجو توی همین <strong>مجموعهی خاطرات</strong> انجام میشه، نه توی کل اینترنت. | |
| </p> | |
| <p> | |
| اگه خیلی خاص بنویسی مثل "خودکار هویدا"، ممکنه چیزی گیرت نیاد! پس بهتره <strong>مفهومیتر</strong> بنویسی، مثلاً "وضع اقتصاد دوران پهلوی" یا "گرونی". | |
| </p> | |
| </div> | |
| <div class="book-selection"> | |
| <h2>انتخاب کتاب(نسخه آزمایشی - فعلاً فقط کتاب جعبه سیاه)</h2> <div> | |
| <input type="checkbox" id="select_all_books" checked> | |
| <label for="select_all_books">انتخاب همه</label> | |
| </div> | |
| <div> | |
| <input type="checkbox" class="book-checkbox" id="book_jabe_siah" value="jabe_siah.json" checked> | |
| <label for="book_jabe_siah">جعبه سیاه (منتخب خاطرات اسدالله علم)</label> | |
| </div> | |
| </div> | |
| <div class="search-area"> | |
| <h2>جستجو در خاطرات انتخاب شده</h2> | |
| <input type="text" id="userQuestion" placeholder="عبارت مورد نظر برای جستجو را وارد کنید..."> | |
| <button id="searchButton" disabled>جستجو</button> </div> | |
| <div class="similarity-threshold-control"> | |
| <label for="similarityThresholdInput">آستانه شباهت:</label> | |
| <input type="number" id="similarityThresholdInput" value="0.15" min="0.0" max="1.0" step="0.01"> | |
| <p>نتایجی که امتیاز شباهت آنها بیشتر یا مساوی این مقدار باشد نمایش داده میشوند (بین 0 تا 1).</p> | |
| </div> | |
| <div class="results-per-page"> | |
| <label for="resultsPerPage">تعداد نتایج نمایش داده شده:</label> | |
| <select id="resultsPerPage"> | |
| <option value="5">5</option> | |
| <option value="10" selected>10</option> <option value="20">20</option> | |
| <option value="50">50</option> | |
| </select> | |
| </div> | |
| <p id="loadingStatus" class="status-message"> | |
| <span class="loading-spinner"></span> </p> | |
| <p id="selectionError" class="error-message"></p> <div id="searchResults"> | |
| <p>در حال بارگذاری اطلاعات کتابها. لطفاً صبر کنید تا دکمه جستجو فعال شود...</p> | |
| </div> | |
| <footer class="app-footer"> | |
| <p>امتیاز این وب افزار متعلق به موسسه تخصصی تبلیغ سیدالشهداء علیه السلام است.</p> | |
| </footer> | |
| </div> | |
| <script src="script.js"></script> | |
| </body> | |
| </html> |