Repository navigation
Expand file tree
/
Copy pathResidences.html
More file actions
136 lines (129 loc) · 5.32 KB
/
Copy pathResidences.html
File metadata and controls
136 lines (129 loc) · 5.32 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
<!DOCTYPE html>
<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="src/tailwind.min.css" rel="stylesheet">
<link href="src/font-face.css" rel="stylesheet">
<link href="src/main-style.css" rel="stylesheet">
<style>
body {
font-family: 'Vazirmatn', sans-serif;
}
table {
width: 100%;
border-collapse: collapse;
}
th, td {
border: 1px solid #ddd;
padding: 8px;
text-align: right;
font-size: 0.875rem;
}
th {
background-color: #f2f2f2;
}
tr:nth-child(even) {
background-color: #f9f9f9;
}
tr:hover {
background-color: #f5f5f5;
}
a {
color: #1e90ff;
text-decoration: none;
}
a:hover {
text-decoration: underline;
}
.table-wrapper {
overflow-x: auto;
}
</style>
</head>
<body class="min-h-screen text-gray-800 flex flex-col">
<header id="main-header"></header>
<main class="container mx-auto px-6 py-20 flex-1 overflow-y-auto main-spacing">
<div class="max-w-7xl mx-auto bg-white p-4 sm:p-6 rounded-lg shadow-md">
<div class="mb-6 text-center">
<h1 class="text-xl sm:text-2xl font-bold">اقامتگاههای رایگان یا ارزان</h1>
<p class="mt-2">تعداد اقامتگاهها: <span id="residenceCount">0</span></p>
<p class="mt-2">کانال اصلی و منبع: <a href="https://t.me/accommodationforwarvictims" target="_blank">@accommodationforwarvictims</a></p>
<p>برای معرفی اقامتگاه جدید با خانوم پارمیدا هماهنگ کنید<a href="https://t.me/parm7ida" target="_blank">@parm7ida</a></p>
<p class="mt-2 text-red-600 font-semibold text-sm sm:text-base">
برای انتقال محتوا از کانال به سایت به ریک سانچز
<a href="https://t.me/m4tinbeigipv" target="_blank">@m4tinbeigipv</a> پیام بدید.
</p>
</div>
<input id="searchInput"
type="text"
placeholder="جستجو بر اساس شهر، منطقه، یا عنوان..."
class="w-full p-3 mb-4 border rounded-lg text-right text-sm sm:text-base">
<div class="table-wrapper">
<table id="residencesTable" class="min-w-full text-sm">
<thead>
<tr>
<th>شهر</th>
<th>منطقه</th>
<th>عنوان</th>
<th>شماره تماس</th>
<th>قیمت</th>
<th>اینستاگرام</th>
</tr>
</thead>
<tbody id="tableBody"></tbody>
</table>
</div>
</div>
<!-- اضافه کردن متن در انتهای صفحه -->
<div class="text-center mt-6 text-sm text-gray-600">
<a href="https://zenbranding.agency/hamomid">ایده و حامی: پروژه هم امید_آژانس برندسازی ذن</a>
</div>
</main>
<footer id="main-footer"></footer>
<script src="src/common-header-footer.js"></script>
<script>
async function loadResidences() {
try {
const response = await fetch('json/residences.json');
const data = await response.json();
const residences = data['اقامتگاهها'];
const tableBody = document.getElementById('tableBody');
const residenceCount = document.getElementById('residenceCount');
residenceCount.textContent = residences.length;
residences.forEach(residence => {
const row = document.createElement('tr');
row.innerHTML = `
<td>${residence.شهر || ''}</td>
<td>${residence.منطقه || ''}</td>
<td>${residence.عنوان || ''}</td>
<td>${residence.شماره ? `<a href="tel:${residence.شماره}">${residence.شماره}</a>` : ''}</td>
<td>${residence.قیمت || ''}</td>
<td>${residence.اینستاگرام ? `<a href="${residence.اینستاگرام}" target="_blank">اینستاگرام</a>` : ''}</td>
`;
tableBody.appendChild(row);
});
const searchInput = document.getElementById('searchInput');
searchInput.addEventListener('input', function() {
const searchTerm = this.value.toLowerCase();
const rows = tableBody.getElementsByTagName('tr');
for (let row of rows) {
const cells = row.getElementsByTagName('td');
const city = cells[0].textContent.toLowerCase();
const region = cells[1].textContent.toLowerCase();
const title = cells[2].textContent.toLowerCase();
const phone = cells[3].textContent.toLowerCase();
const price = cells[4].textContent.toLowerCase();
row.style.display = city.includes(searchTerm) || region.includes(searchTerm) || title.includes(searchTerm) || phone.includes(searchTerm) || price.includes(searchTerm) ? '' : 'none';
}
});
} catch (error) {
console.error('Error loading residences:', error);
document.getElementById('tableBody').innerHTML = '<tr><td colspan="6">خطا در بارگذاری دادهها</td></tr>';
}
}
window.onload = loadResidences;
</script>
</body>
</html>