forked from hafat/hafat.github.io
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathcn_game_lihkg.html
103 lines (82 loc) · 3.33 KB
/
cn_game_lihkg.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
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>LIHKG中資遊戲post回報</title>
</head>
<body>
<div style="position:sticky; top:0; background-color: white; z-index:100;">
<h2>
<a href='cn_game_company.html'>中資公司</a> |
<a href='cn_game.html'>中資遊戲</a> |
<a href='cn_game_lihkg.html'>LIHKG中資遊戲post回報</a>
<button onclick='toggleView("sub_nav")'>其他相關</button>
<span id="sub_nav" style="display:none">
<a href='Apps在日服的收入排名.html' target='_blank'>日服收入排名</a> |
<a href='non_cn_games/cn_game_definition.html' target='_blank'>中資定義</a> |
<a href='new_mobile_game.html' target='_blank'>手機遊戲</a> |
<a href='cn_game_deeds.html' target='_blank'>相關事件</a> |
<a href='https://github.com/hafat/hafat.github.io/commits/main/cn_game.html' target='_blank'>更新記錄</a>
</span>
</h2>
<input id="search_input" onkeyup="search()" style="font-size:30px" type='text' placeholder="search name"/>
<button onclick="search()" style="font-size:30px">Search</button>
<br>
<br>
</div>
<table id="table" cellpadding="0" cellspacing="0" border="1">
<thead style="text-align:left"><th>整理日期</th><th>遊戲名稱</th><th>Link</th></thead>
<tbody>
</tbody>
</table>
整理自 https://lihkg.com/thread/2706170
<script>
var tr_tag = document.getElementsByTagName("tr");
var search_input = document.getElementById("search_input")
function replaceSearchText(text){
return text.replace(/[`:・!~「」-~!@#$%^&*()_|+\-=?;:'",.<>\s\{\}\[\]\\\/]/gi, '').toUpperCase()
}
function search(){
for(var i= 1; i< tr_tag.length ; i++){
if(!search_input.value)
tr_tag[i].style.display = "table-row";
else if(replaceSearchText(tr_tag[i].getElementsByTagName("td")[1].textContent).search(replaceSearchText(search_input.value))!=-1
// || replaceSearchText(tr_tag[i].getElementsByTagName("td")[1].textContent).search(replaceSearchText(search_input.value))!=-1
)
tr_tag[i].style.display = "table-row";
else
tr_tag[i].style.display = "none";
}
}
var list = [
{'date':`20-9-2021`,'name':`哈利波特:魔法覺醒`,'link':`https://lihkg.com/thread/2694369`},
{'date':`20-9-2021`,'name':`天地劫`,'link':`https://lihkg.com/thread/2701982`},
{'date':`21-9-2021`,'name':`明日方舟`,'link':`https://lihkg.com/thread/2141400`},
{'date':`21-9-2021`,'name':`英雄聯盟:激鬥峽谷`,'link':`https://lihkg.com/thread/2702108`},
{'date':`21-9-2021`,'name':`Fate Grand Order 繁中版`,'link':`https://lihkg.com/thread/2673994`},
{'date':`8-10-2021`,'name':`Pokemon unite`,'link':`https://lihkg.com/thread/2708538`},
];
var table = document.getElementById("table")
var tbody = table.getElementsByTagName("tbody")[0];
for(var i = 0; i<list.length ; i++){
// let row = tbody.insertRow(-1);
let row = tbody.insertRow(0);
let cell1 = row.insertCell(0);
let cell2 = row.insertCell(1);
let cell3 = row.insertCell(2);
cell1.innerHTML = list[i].date;
cell2.innerHTML = list[i].name;
cell3.innerHTML = `<a href="${list[i].link}" target="_blank">${list[i].link}</a>`;
}
function toggleView(ele_id){
let ele_obj = document.getElementById(ele_id);
if(ele_obj.style.display=="none"){
ele_obj.style.display = "inline";
}
else
ele_obj.style.display = "none";
}
</script>
</body>
</html>