forked from HUFSWIKI-PROJECT/frontend
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathrecent.html
More file actions
113 lines (106 loc) · 4.7 KB
/
recent.html
File metadata and controls
113 lines (106 loc) · 4.7 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
<!DOCTYPE html>
<html lang="ko">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>HUFS-WIKI</title>
<link rel="stylesheet" href="style.css" />
<script src="https://kit.fontawesome.com/f8b80fb68b.js" crossorigin="anonymous"></script>
</head>
<body>
<header id="headerType" class="header__wrap nexon">
<div class="header__inner">
<div class="header__logo">
<a onclick="location.href = 'index.html'">HUFS WiKi</a>
</div>
<nav class="header__menu">
<ul>
<li><a onclick="location.href = 'map.html'">지도</a></li>
<li><a onclick = "location.href ='recent.html'">최근 변경</a></li>
</ul>
</nav>
<div class="header__search">
<form class="search-box" action="" method="get">
<input class="search-txt" type="text" name="" placeholder="검색어를 입력하세요.">
<button class="search-bnt" type="submit">
<i class="fa-solid fa-magnifying-glass"></i>
</button>
</form>
</div>
<div class="header__member">
<a onclick = "location.href ='login.html'">로그인</a>
</div>
</header>
<div class="main_body">
<div class="main_wiki" id = "targetid">
<script>
const urlParams = new URL(location.href).searchParams;
var id = urlParams.get('id');
if (typeof id == 'undefined') {
id = 1;
}
console.log(id);
fetch('http://152.69.225.60/findbyid?id='+id)
.then(response => response.json())
.then(data => {
console.log(data.content);
document.getElementById('targetid').innerHTML = data.content;
})
.catch(error => {
console.error('Error fetching data:', error);
});
</script>
</div>
<div class="side_wiki">
<div class="live_change">
<div class="live_head">
<i class="fa-solid fa-fire" class="icon"></i>
<div class="live_name">실시간 검색어</div>
</div>
<div class="live_ranking">
<a href="#"></a>
<a href="#"></a>
<a href="#"></a>
<a href="#"></a>
<a href="#"></a>
<a href="#"></a>
<a href="#"></a>
<a href="#"></a>
<a href="#"></a>
<a href="#"></a>
</div>
</div>
<div class="recent_change">
<div class="recent_head">
<div class="recent_head1">
<i class="fa-solid fa-clock" class="icon"></i>
<div class="recent_name">최근 변경</div>
</div>
<div class="recent_head2">
<a onclick="location.href = 'recent.html'"><i class="fa-solid fa-angle-right" class="icon"></i></a>
</div>
</div>
<div id = "recent_body">
<script>
let contentHTML = '';
fetch('http://152.69.225.60/findbyall')
.then(response => response.json())
.then(data => {
for (let dat of data) {
console.log(dat.content);
contentHTML+='<a href="http://localhost:5500/frontend/index.html?id='+dat.id+'">'+dat.title+'</a><br>';
}
document.getElementById('recent_body').innerHTML = contentHTML;
})
.catch(error => {
console.error('Error fetching data:', error);
});
</script>
</div>
<div class="recent_ranking"></div>
</div>
</div>
</div>
</div>
</body>
</html>