Map / index.html
stat2025's picture
Update index.html
aee34da verified
raw
history blame
2.36 kB
<!DOCTYPE html>
<html lang="ar" dir="rtl">
<head>
<meta charset="utf-8"/>
<title>اختر الصفحة</title>
<style>
body { font-family: Arial, sans-serif; margin: 20px; }
h1 { margin-bottom: 10px; }
ul { line-height: 1.9; }
a { color:#0b6efd; text-decoration:none; }
a:hover { text-decoration:underline; }
.btn {
padding: 8px 12px; background: #28a745; color: #fff; border: 0;
border-radius: 6px; cursor: pointer; margin-bottom: 12px;
}
.mini { font-size: 12px; color:#666; margin-right:8px; }
</style>
<script src="https://cdn.jsdelivr.net/npm/xlsx@0.18.5/dist/xlsx.full.min.js"></script>
</head>
<body>
<h1>اختر الصفحة</h1>
<button class="btn" onclick="exportAllToExcel()">تحميل قائمة الروابط (Excel)</button>
<span class="mini">تصميم وإعداد نوف الناصر</span>
<ul id="pages-list"></ul>
<script>
const FOLDER = 'map';
const TOTAL_PAGES = 23;
function pageUrl(n) {
const two = String(n).padStart(2, '0');
const base = location.origin + location.pathname.replace(/[^/]*$/, '');
return `${base}${FOLDER}/${two}.html`;
}
// إنشاء القائمة على الصفحة
(function buildList() {
const ul = document.getElementById('pages-list');
for (let i = 1; i <= TOTAL_PAGES; i++) {
const li = document.createElement('li');
const a = document.createElement('a');
a.href = `${FOLDER}/${String(i).padStart(2,'0')}.html`;
a.target = '_blank';
a.textContent = `صفحة ${i}`;
li.appendChild(a);
ul.appendChild(li);
}
})();
// تصدير للإكسل بحيث كلمة "اضغط هنا" هي الرابط
function exportAllToExcel() {
const rows = [];
for (let i = 1; i <= TOTAL_PAGES; i++) {
const link = pageUrl(i);
rows.push({
'الصفحة': `صفحة ${i}`,
'الرابط': { t: "s", v: "اضغط هنا", l: { Target: link } }
});
}
const ws = XLSX.utils.json_to_sheet([]);
XLSX.utils.sheet_add_json(ws, rows, { origin: "A1", skipHeader: false });
const wb = XLSX.utils.book_new();
XLSX.utils.book_append_sheet(wb, ws, 'links');
XLSX.writeFile(wb, 'روابط_الصفحات.xlsx');
}
</script>
</body>
</html>