-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathindex.html
296 lines (251 loc) · 9.35 KB
/
index.html
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
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
<!DOCTYPE html>
<html>
<head>
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<link rel="stylesheet" href="https://cdn.staticfile.org/twitter-bootstrap/4.1.0/css/bootstrap.min.css">
<script src="https://cdn.staticfile.org/jquery/3.2.1/jquery.min.js"></script>
<script src="https://cdn.staticfile.org/popper.js/1.12.5/umd/popper.min.js"></script>
<script src="https://cdn.staticfile.org/twitter-bootstrap/4.1.0/js/bootstrap.min.js"></script>
<style>
body {
font-family: Arial, sans-serif;
line-height: 1.6;
margin: 0;
padding: 0;
}
h2 {
text-align: center;
margin: 20px 0;
}
#tableContainer {
max-width: 1000px;
margin: 0 auto;
padding: 10px;
}
table {
width: 100%;
border-collapse: collapse;
border: 1px solid #ddd;
}
th,
td {
padding: 10px;
text-align: left;
border-bottom: 1px solid #ddd;
}
th {
background-color: #f2f2f2;
}
#searchContainer {
position: sticky;
top: 0;
z-index: 1;
background-color: #f2f2f2;
padding: 10px;
box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}
#searchInput {
width: 100%;
padding: 10px;
box-sizing: border-box;
}
#noMoreContentMessage {
text-align: center;
font-weight: bold;
}
#pagination {
display: flex;
justify-content: center;
align-items: center;
margin: 20px 0;
position: sticky;
bottom: 0;
background-color: #f2f2f2;
padding: 10px 0;
z-index: 1;
}
#pagination button {
padding: 5px 10px;
margin: 0 5px;
border: 1px solid #ccc;
border-radius: 5px;
cursor: pointer;
background-color: #f2f2f2;
}
.missing-info {
color: #aaa; /* Light gray color for missing information */
}
#returnToTop {
position: fixed;
bottom: 20px;
right: 20px;
background-color: #f2f2f2;
padding: 10px;
border: 1px solid #ccc;
border-radius: 50%;
cursor: pointer;
margin-top: -10px;
}
@media (max-width: 600px) {
th,
td {
font-size: 14px;
}
#tableContainer {
padding: 5px;
}
#pagination {
flex-wrap: wrap;
}
}
</style>
</head>
<body>
<h2>公司避坑避雷~【南宁】</h2>
<p>
<p>
<span class="highlight">以下數據來源於各平臺網友的反饋,排名不分先後。
我們的初衷是為了幫助大家在尋找心儀工作時避免被騙。</span>
</p>
<div class="alert alert-warning alert-dismissible">
<button type="button" class="close" data-dismiss="alert">×</button>
<strong>警告!</strong> <p><strong>免責聲明:</strong>我們所提供的信息僅基於網友的反饋整理,不代表本站點對其準確性負責。在做出任何決定之前,請自行核實相關信息,謹慎選擇,對可能產生的風險自行承擔責任。如果您不認可,覺得無用請自行離開。</strong></p>
</div>
<div class="alert alert-info alert-dismissible">
<button type="button" class="close" data-dismiss="alert">×</button>
<!-- <strong>信息!</strong> <br>如果新的信息,还请提供给我们,这对正在寻找工作者很有帮助 邮箱:<a href= "mailto:[email protected]">发送 Email</a> -->
<strong>信息!</strong> <br>暂时停止更新,如果无法访问请开启代理,本站会被大陆屏蔽
</div>
<div id="searchContainer">
<input type="text" id="searchInput" placeholder="快速关键字搜索 如 996、公司名称、序号">
</div>
<div id="tableContainer">
<table id="blacklistTable">
<tr>
<th style="position: sticky; top: 70px; z-index: 1;">序号</th>
<th style="position: sticky; top: 70px; z-index: 1;">公司名称</th>
<th colspan="2" style="position: sticky; top: 70px; z-index: 1;">原因 / 地址</th>
</tr>
</table>
<div id="noMoreContentMessage" style="display: none;">无更多内容,如有新的线索请<a href="https://jinshuju.net/f/DKeqIR">点击添加</a></div>
</div>
<div id="pagination"></div>
<div id="returnToTop" onclick="scrollToTop()">▲</div>
<script>
const table = document.getElementById("blacklistTable");
const tableContainer = document.getElementById("tableContainer");
const searchContainer = document.getElementById("searchContainer");
const apiUrl = "https://i-data-three.vercel.app/GX_bl.json";
const itemsPerPage = 99;
let currentPage = 1;
let data = [];
let visibleData = [];
let isLoadingData = false;
async function fetchData() {
try {
const response = await fetch(apiUrl);
data = await response.json();
updateVisibleData();
renderTable(currentPage);
updatePagination();
} catch (error) {
console.error("Error fetching data:", error);
}
}
function getTotalPages() {
return Math.ceil(visibleData.length / itemsPerPage);
}
function updateVisibleData() {
visibleData = data;
}
function renderTable(page) {
const startIndex = (page - 1) * itemsPerPage;
const endIndex = Math.min(startIndex + itemsPerPage, visibleData.length);
let html = "";
for (let i = startIndex; i < endIndex; i++) {
const row = visibleData[i];
if (row) {
html += "<tr>";
html += "<td>" + row["序号"] + "</td>";
html += "<td>" + row["公司名称"] + "</td>";
html += "<td colspan='2'>" +
"原因: " + (row["原因"] ? row["原因"] : "<span class='missing-info'>提供信息者未填写</span>") + "<br>" +
"地址:" + (row["地址"] ? row["地址"] : "<span class='missing-info'>提供信息者未填写</span>") +
"</td>";
html += "</tr>";
}
}
table.innerHTML = html;
checkNoMoreContentMessage();
isLoadingData = false;
}
function searchTable() {
const input = document.getElementById("searchInput");
const filter = input.value.toUpperCase();
if (!filter) {
visibleData = data;
} else {
visibleData = data.filter((row) => {
if (row === null || typeof row === "undefined") return false;
return Object.values(row).some((property) => {
return (property || "").toString().toUpperCase().indexOf(filter) !== -1;
});
});
}
currentPage = 1;
renderTable(currentPage);
updatePagination();
}
function checkNoMoreContentMessage() {
const noMoreContentMessage = document.getElementById("noMoreContentMessage");
if (visibleData.length === 0) {
noMoreContentMessage.style.display = "block";
} else {
noMoreContentMessage.style.display = "none";
}
}
function updatePagination() {
const totalPages = getTotalPages();
const pagination = document.getElementById("pagination");
let html = "";
for (let i = 1; i <= totalPages; i++) {
html += `<button onclick="goToPage(${i})">${i}</button>`;
}
pagination.innerHTML = `当前页:${currentPage} / 总页数:${totalPages} ${html}`;
}
function goToPage(page) {
if (page > getTotalPages() || page < 1) return;
currentPage = page;
renderTable(currentPage);
updatePagination();
}
const observer = new IntersectionObserver(
entries => {
entries.forEach(entry => {
if (
!isLoadingData &&
entry.isIntersecting &&
currentPage < getTotalPages()
) {
isLoadingData = true;
currentPage++;
renderTable(currentPage);
updatePagination();
}
});
},
{ root: tableContainer }
);
fetchData();
document
.getElementById("searchInput")
.addEventListener("keyup", searchTable);
function scrollToTop() {
window.scrollTo({
top: 0,
behavior: "smooth"
});
}
</script>
</body>
</html>