search.html
5.55 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
137
138
139
140
141
<html>
<head>
<link href="//maxcdn.bootstrapcdn.com/bootstrap/4.1.1/css/bootstrap.min.css" rel="stylesheet" id="bootstrap-css">
<script src="//maxcdn.bootstrapcdn.com/bootstrap/4.1.1/js/bootstrap.min.js"></script>
<script src="//cdnjs.cloudflare.com/ajax/libs/jquery/3.2.1/jquery.min.js"></script>
<!------ Include the above in your HEAD tag ---------->
<div style="padding-left: 500px;">
<input id="search1" name="q" type="text" size="40" placeholder="Search..." />
<button class="btn-search" type="button" onclick="movePage1()">검색</button>
<script type="text/javascript">
function movePage1() { //페이지 이동을 위한 함수 search버튼을 누르면 실행됨
location.href = document.location.href + "/" + document.getElementById('search1').value //url을 이렇게 변경함
}
</script>
</div>
<style>
#search input[type="text"] {
background: url(search-white.png) no-repeat 10px 6px #fcfcfc;
border: 1px solid #d1d1d1;
font: bold 12px Arial, Helvetica, Sans-serif;
color: #bebebe;
width: 150px;
padding: 6px 15px 6px 35px;
-webkit-border-radius: 20px;
-moz-border-radius: 20px;
border-radius: 20px;
text-shadow: 0 2px 3px rgba(0, 0, 0, 0.1);
-webkit-box-shadow: 0 1px 3px rgba(0, 0, 0, 0.15) inset;
-moz-box-shadow: 0 1px 3px rgba(0, 0, 0, 0.15) inset;
box-shadow: 0 1px 3px rgba(0, 0, 0, 0.15) inset;
-webkit-transition: all 0.7s ease 0s;
-moz-transition: all 0.7s ease 0s;
-o-transition: all 0.7s ease 0s;
transition: all 0.7s ease 0s;
}
#search input[type="text"]:focus {
width: 200px;
}
#search input[type="text"]:focus {
width: 200px;
}
ul.timeline {
list-style-type: none;
position: relative;
}
ul.timeline:before {
content: ' ';
background: #d4d9df;
display: inline-block;
position: absolute;
left: 29px;
width: 2px;
height: 100%;
z-index: 400;
}
ul.timeline>li {
margin: 20px 0;
padding-left: 20px;
}
ul.timeline>li:before {
content: ' ';
background: white;
display: inline-block;
position: absolute;
border-radius: 50%;
border: 3px solid #22c0e8;
left: 20px;
width: 20px;
height: 20px;
z-index: 400;
}
</style>
</head>
<body>
<!--검색된 타임라인 출력-->
<div class="container mt-5 mb-5">
<div class="row">
<div class="col-md-6 offset-md-3">
<!--<h4>timeline</h4>-->
<ul class="Timeline">
<% for (var i=0; i<timeline.length; i++){ %>
<!--받아온 타임라인 수 만큼 반복-->
<% if((timeline[i].text).indexOf(keyword) !=-1) { %>
<!--현재 글에 검색 키워드가 존재하면 그 글을 보여줌-->
<li>
<% if(timeline[i].hasOwnProperty('retweeted_status')) { %>
<!--내가 다른사람 글을 리트윗한거면 원글을 쓴 사람 닉네임 출력-->
<a style="font-weight: bold;" target="_blank" href=>
<%= timeline[i].retweeted_status.user.name %>
</a>
<% } else { %>
<!--아니면 내 닉네임-->
<a style="font-weight: bold;" target="_blank" href=>
<%= timeline[i].user.name %>
</a>
<% } %>
<a href="#" class="float-right">
<%= timeline[i].created_at %>
</a>
<p>
<%=timeline[i].text%>
</p>
<% if(timeline[i].hasOwnProperty('extended_entities')) { %>
<!--미디어가 존재하면 출력-->
<img alt="Web Studio" class="img-fluid" width="300" height="300"
src=<%=timeline[i].extended_entities.media[0].media_url_https %> />
<% } %>
<p style="color: #22c0e8;">리트윗: <%= timeline[i].retweet_count %> 마음에
들어요: <%= timeline[i].favorite_count%>
</p>
</li>
<% } %>
<% } %>
</ul>
</div>
</div>
</div>
<div class="text-muted mt-5 mb-5 text-center small">by : <a class="text-muted" target="_blank"
href="http://totoprayogo.com">totoprayogo.com</a></div>
</body>
</html>