Showing
20 changed files
with
532 additions
and
98 deletions
... | @@ -8,12 +8,90 @@ var fs = require('fs'); | ... | @@ -8,12 +8,90 @@ var fs = require('fs'); |
8 | var client_id = 'Lqxd8LWDGMYTe9YWJPBb'; | 8 | var client_id = 'Lqxd8LWDGMYTe9YWJPBb'; |
9 | var client_secret = '9HrBpH8oy1'; | 9 | var client_secret = '9HrBpH8oy1'; |
10 | 10 | ||
11 | -app.get('/', function(req, res){ | 11 | +app.use('/', express.static(__dirname + '/../public')); |
12 | +app.get('/errata', function (req, res) { | ||
13 | + var api_url = 'https://openapi.naver.com/v1/search/errata.json?query=' + encodeURI(req.query.query); // json 결과 | ||
14 | + var request = require('request'); | ||
15 | + console.log(req.query.query); | ||
16 | + console.log(req.query); | ||
17 | + var options = { | ||
18 | + url: api_url, | ||
19 | + headers: {'X-Naver-Client-Id':'3VmmpKXfOwySxf5ONdKM', 'X-Naver-Client-Secret': 'q0xaSGu8Vl'} | ||
20 | + }; | ||
21 | + request.get(options, function (error, response, body) { | ||
22 | + | ||
23 | + if (!error && response.statusCode == 200) { | ||
24 | + res.writeHead(200, {'Content-Type': 'text/json;charset=utf-8'}); | ||
25 | + console.log(body); | ||
26 | + res.end(body); | ||
27 | + } else { | ||
28 | + res.status(response.statusCode).end(); | ||
29 | + console.log('error = ' + response.statusCode); | ||
30 | + } | ||
31 | + }); | ||
32 | + }); | ||
33 | + | ||
34 | + | ||
35 | + app.get('/', function(req, res){ | ||
12 | fs.readFile('fb_login.ejs', function(error, data){ | 36 | fs.readFile('fb_login.ejs', function(error, data){ |
13 | res.writeHead(200, {'Content-Type' : 'text/html '}); | 37 | res.writeHead(200, {'Content-Type' : 'text/html '}); |
14 | res.end(data); | 38 | res.end(data); |
15 | }); | 39 | }); |
16 | -}); | 40 | + }); |
41 | + app.get('/css/style.css', function(req, res){ | ||
42 | + fs.readFile('css/style.css', function(error, data){ | ||
43 | + res.writeHead(200, {'Content-Type' : 'text/css '}); | ||
44 | + res.end(data); | ||
45 | + }); | ||
46 | + }); | ||
47 | + app.get('/css/bootstrap.min.css', function(req, res){ | ||
48 | + fs.readFile('/css/bootstrap.min.css', function(error, data){ | ||
49 | + res.writeHead(200, {'Content-Type' : 'text/css '}); | ||
50 | + res.end(data); | ||
51 | + }); | ||
52 | + }); | ||
53 | + app.get('/css/bootstrap.css', function(req, res){ | ||
54 | + fs.readFile('/css/bootstrap.css', function(error, data){ | ||
55 | + res.writeHead(200, {'Content-Type' : 'text/css '}); | ||
56 | + res.end(data); | ||
57 | + }); | ||
58 | + }); | ||
59 | + app.get('/css/bootstrap-theme.css', function(req, res){ | ||
60 | + fs.readFile('/css/bootstrap-theme.css', function(error, data){ | ||
61 | + res.writeHead(200, {'Content-Type' : 'text/css '}); | ||
62 | + res.end(data); | ||
63 | + }); | ||
64 | + }); | ||
65 | + app.get('/css/bootstrap-theme.min.css', function(req, res){ | ||
66 | + fs.readFile('/css/bootstrap-theme.min.css', function(error, data){ | ||
67 | + res.writeHead(200, {'Content-Type' : 'text/css '}); | ||
68 | + res.end(data); | ||
69 | + }); | ||
70 | + }); | ||
71 | + app.get('/css/bootstrap-theme.css.map', function(req, res){ | ||
72 | + fs.readFile('/css/bootstrap-theme.css.map', function(error, data){ | ||
73 | + res.writeHead(200, {'Content-Type' : 'text/css '}); | ||
74 | + res.end(data); | ||
75 | + }); | ||
76 | + }); | ||
77 | + app.get('/js/bootstrap.js', function(req, res){ | ||
78 | + fs.readFile('/js/bootstrap.js', function(error, data){ | ||
79 | + res.writeHead(200, {'Content-Type' : 'Application/javascript'}); | ||
80 | + res.end(data); | ||
81 | + }); | ||
82 | + }); | ||
83 | + app.get('/js/bootstrap.min.js', function(req, res){ | ||
84 | + fs.readFile('/js/bootstrap.min.js', function(error, data){ | ||
85 | + res.writeHead(200, {'Content-Type' : 'Application/javascript'}); | ||
86 | + res.end(data); | ||
87 | + }); | ||
88 | + }); | ||
89 | + app.get('/js/npm.js', function(req, res){ | ||
90 | + fs.readFile('/js/npm.js', function(error, data){ | ||
91 | + res.writeHead(200, {'Content-Type' : 'Application/javascript'}); | ||
92 | + res.end(data); | ||
93 | + }); | ||
94 | + }); | ||
17 | 95 | ||
18 | app.get('/imgs/megabox',function (req,res) { | 96 | app.get('/imgs/megabox',function (req,res) { |
19 | fs.readFile('mega.png', function (error, data) { | 97 | fs.readFile('mega.png', function (error, data) { |
... | @@ -32,13 +110,36 @@ app.get('/main',function (req,res) { | ... | @@ -32,13 +110,36 @@ app.get('/main',function (req,res) { |
32 | app.get('/serach',function (req,res) { | 110 | app.get('/serach',function (req,res) { |
33 | var query= req.query; | 111 | var query= req.query; |
34 | var genre = query['genre']; | 112 | var genre = query['genre']; |
113 | + var year = query['year']; | ||
114 | + var country = query['country']; | ||
35 | var search = query['search']; | 115 | var search = query['search']; |
36 | - if(genre != ""){ | 116 | + var searchAll = query['searchAll']; |
117 | + | ||
118 | + if(genre != null){ | ||
37 | var code = get_genre_code(genre); | 119 | var code = get_genre_code(genre); |
38 | get_info_using_genre(code,search, res); | 120 | get_info_using_genre(code,search, res); |
39 | } | 121 | } |
122 | + else if(year != null){ | ||
123 | + var year_num = get_year_num(year); | ||
124 | + get_info_using_year(year_num,search, res); | ||
125 | + } | ||
126 | + else if(country != null){ | ||
127 | + var country_real = makeETC(country); | ||
128 | + get_info_using_country(country_real,search, res); | ||
129 | + } | ||
130 | + else if(searchAll != null){ | ||
131 | + get_info_all(searchAll, res); | ||
132 | + } | ||
40 | }) | 133 | }) |
41 | 134 | ||
135 | +function makeETC(country_input){ | ||
136 | + var country_input; | ||
137 | + if(country_input == "ET"){ | ||
138 | + country_input = "ETC" | ||
139 | + } | ||
140 | + return country_input; | ||
141 | +} | ||
142 | + | ||
42 | function get_genre_code(genre_str) { | 143 | function get_genre_code(genre_str) { |
43 | var genre_num; | 144 | var genre_num; |
44 | switch (genre_str) { | 145 | switch (genre_str) { |
... | @@ -71,15 +172,31 @@ function get_genre_code(genre_str) { | ... | @@ -71,15 +172,31 @@ function get_genre_code(genre_str) { |
71 | break; | 172 | break; |
72 | 173 | ||
73 | default: | 174 | default: |
74 | - | ||
75 | } | 175 | } |
76 | - | ||
77 | return genre_num; | 176 | return genre_num; |
78 | } | 177 | } |
79 | - | 178 | +function get_year_num(year){ |
179 | + var return_year; | ||
180 | + switch (year) { | ||
181 | + case "1980년대": | ||
182 | + return_year = 1980; | ||
183 | + break; | ||
184 | + case "1990년대": | ||
185 | + return_year = 1990; | ||
186 | + break; | ||
187 | + case "2000년대": | ||
188 | + return_year = 2000; | ||
189 | + break; | ||
190 | + case "2010년대": | ||
191 | + return_year = 2010; | ||
192 | + break; | ||
193 | + } | ||
194 | + return return_year; | ||
195 | +} | ||
196 | +//장르 검색 | ||
80 | function get_info_using_genre(code,search, res) { | 197 | function get_info_using_genre(code,search, res) { |
81 | var en = encodeURI(search); | 198 | var en = encodeURI(search); |
82 | - var api_url = 'https://openapi.naver.com/v1/search/movie.json?query='+en+'&genre=' + code; // json 결과 | 199 | + var api_url = 'https://openapi.naver.com/v1/search/movie.json?query='+en+'&display=100'+'&genre=' + code; // json 결과 |
83 | var request = require('request'); | 200 | var request = require('request'); |
84 | var options = { | 201 | var options = { |
85 | url: api_url, | 202 | url: api_url, |
... | @@ -97,9 +214,40 @@ function get_info_using_genre(code,search, res) { | ... | @@ -97,9 +214,40 @@ function get_info_using_genre(code,search, res) { |
97 | } | 214 | } |
98 | }); | 215 | }); |
99 | } | 216 | } |
217 | +//연도 검색 | ||
218 | +function get_info_using_year(year_num,search, res) { | ||
219 | + var en = encodeURI(search); | ||
220 | + var yearto = year_num+10; | ||
221 | + var api_url = 'https://openapi.naver.com/v1/search/movie.json?query='+en+ '&display=100' + '&yearfrom=' + year_num + '&yearto=' + yearto // json 결과 | ||
222 | + //var api_url = 'https://openapi.naver.com/v1/search/movie.json?query='+en+'&display=100'; // json 결과 | ||
223 | + var request = require('request'); | ||
224 | + var options = { | ||
225 | + url: api_url, | ||
226 | + //headers: {'X-Naver-Client-Id':client_id, 'X-Naver-Client-Secret': client_secret} | ||
227 | + headers: {'X-Naver-Client-Id':'Lqxd8LWDGMYTe9YWJPBb', 'X-Naver-Client-Secret': '9HrBpH8oy1'} | ||
228 | + }; | ||
229 | + request.get(options, function (error, response, body) { | ||
230 | + if (!error && response.statusCode == 200) { | ||
231 | + var data = JSON.parse(body); | ||
232 | + var total = data['total']; | ||
233 | + var items = data['items']; | ||
234 | + // var temps = items; | ||
235 | + // var j = 0; | ||
236 | + // for(var i = 0 ; i < total; i++){ | ||
237 | + // if(items[i]['pubDate'] >= year && items[i]['pubDate'] <= year+10 ){ | ||
238 | + // temps[j] = items[i]; | ||
239 | + // } | ||
240 | + // } | ||
100 | 241 | ||
101 | -app.get('/search/movie', function (req, res) { | 242 | + console.log(data); |
102 | - var api_url = 'https://openapi.naver.com/v1/search/movie.json?query=%EC%A3%BC%EC%8B%9D&display=10&start=1&genre=1' + encodeURI(req.query.query); // json 결과 | 243 | + res.render('movie_info',{item:items}); |
244 | + } | ||
245 | + }); | ||
246 | +} | ||
247 | +//국가 검색 | ||
248 | +function get_info_using_country(country,search, res) { | ||
249 | + var en = encodeURI(search); | ||
250 | + var api_url = 'https://openapi.naver.com/v1/search/movie.json?query='+en+'&display=100'+'&country=' + country; // json 결과 | ||
103 | var request = require('request'); | 251 | var request = require('request'); |
104 | var options = { | 252 | var options = { |
105 | url: api_url, | 253 | url: api_url, |
... | @@ -111,15 +259,57 @@ app.get('/search/movie', function (req, res) { | ... | @@ -111,15 +259,57 @@ app.get('/search/movie', function (req, res) { |
111 | var data = JSON.parse(body); | 259 | var data = JSON.parse(body); |
112 | var total = data['total']; | 260 | var total = data['total']; |
113 | var items = data['items']; | 261 | var items = data['items']; |
114 | - res.writeHead(200, {'Content-Type': 'text/json;charset=utf-8'}); | 262 | + |
115 | - // res.end(JSON.stringify(items)); | 263 | + console.log(data); |
116 | - res.end(body); | 264 | + res.render('movie_info',{item:items}); |
117 | - } else { | ||
118 | - res.status(response.statusCode).end(); | ||
119 | - console.log('error = ' + response.statusCode); | ||
120 | } | 265 | } |
121 | }); | 266 | }); |
267 | +} | ||
268 | +//전체 검색 | ||
269 | +// 미정 /미확인 이딴거 두개만 뜸 | ||
270 | +function get_info_all(searchAll, res) { | ||
271 | + var en = encodeURI(searchAll); | ||
272 | + var api_url = 'https://openapi.naver.com/v1/search/movie.json?query='+en+'&display=100'; // json 결과 | ||
273 | + var request = require('request'); | ||
274 | + var options = { | ||
275 | + url: api_url, | ||
276 | + //headers: {'X-Naver-Client-Id':client_id, 'X-Naver-Client-Secret': client_secret} | ||
277 | + headers: {'X-Naver-Client-Id':'Lqxd8LWDGMYTe9YWJPBb', 'X-Naver-Client-Secret': '9HrBpH8oy1'} | ||
278 | + }; | ||
279 | + request.get(options, function (error, response, body) { | ||
280 | + if (!error && response.statusCode == 200) { | ||
281 | + var data = JSON.parse(body); | ||
282 | + var total = data['total']; | ||
283 | + var items = data['items']; | ||
284 | + | ||
285 | + console.log(data); | ||
286 | + res.render('movie_info',{item:items}); | ||
287 | + } | ||
122 | }); | 288 | }); |
289 | +} | ||
290 | + | ||
291 | +// app.get('/search/movie', function (req, res) { | ||
292 | +// var api_url = 'https://openapi.naver.com/v1/search/movie.json?query=%EC%A3%BC%EC%8B%9D&display=10&start=1&genre=1' + encodeURI(req.query.query); // json 결과 | ||
293 | +// var request = require('request'); | ||
294 | +// var options = { | ||
295 | +// url: api_url, | ||
296 | +// //headers: {'X-Naver-Client-Id':client_id, 'X-Naver-Client-Secret': client_secret} | ||
297 | +// headers: {'X-Naver-Client-Id':'Lqxd8LWDGMYTe9YWJPBb', 'X-Naver-Client-Secret': '9HrBpH8oy1'} | ||
298 | +// }; | ||
299 | +// request.get(options, function (error, response, body) { | ||
300 | +// if (!error && response.statusCode == 200) { | ||
301 | +// var data = JSON.parse(body); | ||
302 | +// var total = data['total']; | ||
303 | +// var items = data['items']; | ||
304 | +// res.writeHead(200, {'Content-Type': 'text/json;charset=utf-8'}); | ||
305 | +// // res.end(JSON.stringify(items)); | ||
306 | +// res.end(body); | ||
307 | +// } else { | ||
308 | +// res.status(response.statusCode).end(); | ||
309 | +// console.log('error = ' + response.statusCode); | ||
310 | +// } | ||
311 | +// }); | ||
312 | +// }); | ||
123 | 313 | ||
124 | 314 | ||
125 | app.listen(3000, function () { | 315 | app.listen(3000, function () { | ... | ... |
css/bootstrap-theme.css
0 → 100644
This diff is collapsed. Click to expand it.
css/bootstrap-theme.css.map
0 → 100644
This diff is collapsed. Click to expand it.
css/bootstrap-theme.min.css
0 → 100644
This diff is collapsed. Click to expand it.
css/bootstrap.css
0 → 100644
This diff could not be displayed because it is too large.
css/bootstrap.css.map
0 → 100644
This diff could not be displayed because it is too large.
css/bootstrap.min.css
0 → 100644
This diff could not be displayed because it is too large.
css/style.css
0 → 100644
1 | +body { | ||
2 | + font-family: 'Lucida Grande', 'Helvetica Neue', Helvetica, Arial, sans-serif; | ||
3 | + padding: 20px 50px 150px; | ||
4 | + font-size: 13px; | ||
5 | + text-align: center; | ||
6 | + background: #E3CAA1; | ||
7 | +} | ||
8 | + | ||
9 | +ul { | ||
10 | + text-align: left; | ||
11 | + display: inline; | ||
12 | + margin: 0; | ||
13 | + padding: 15px 4px 17px 0; | ||
14 | + list-style: none; | ||
15 | + -webkit-box-shadow: 0 0 5px rgba(0, 0, 0, 0.15); | ||
16 | + -moz-box-shadow: 0 0 5px rgba(0, 0, 0, 0.15); | ||
17 | + box-shadow: 0 0 5px rgba(0, 0, 0, 0.15); | ||
18 | +} | ||
19 | +ul li { | ||
20 | + font: bold 12px/18px sans-serif; | ||
21 | + display: inline-block; | ||
22 | + margin-right: -4px; | ||
23 | + position: relative; | ||
24 | + padding: 15px 20px; | ||
25 | + background: #fff; | ||
26 | + cursor: pointer; | ||
27 | + -webkit-transition: all 0.2s; | ||
28 | + -moz-transition: all 0.2s; | ||
29 | + -ms-transition: all 0.2s; | ||
30 | + -o-transition: all 0.2s; | ||
31 | + transition: all 0.2s; | ||
32 | +} | ||
33 | +ul li:hover { | ||
34 | + background: #555; | ||
35 | + color: #fff; | ||
36 | +} | ||
37 | +ul li ul { | ||
38 | + padding: 0; | ||
39 | + position: absolute; | ||
40 | + top: 48px; | ||
41 | + left: 0; | ||
42 | + width: 150px; | ||
43 | + -webkit-box-shadow: none; | ||
44 | + -moz-box-shadow: none; | ||
45 | + box-shadow: none; | ||
46 | + display: none; | ||
47 | + opacity: 0; | ||
48 | + visibility: hidden; | ||
49 | + -webkit-transiton: opacity 0.2s; | ||
50 | + -moz-transition: opacity 0.2s; | ||
51 | + -ms-transition: opacity 0.2s; | ||
52 | + -o-transition: opacity 0.2s; | ||
53 | + -transition: opacity 0.2s; | ||
54 | +} | ||
55 | +ul li ul li { | ||
56 | + background: #555; | ||
57 | + display: block; | ||
58 | + color: #fff; | ||
59 | + text-shadow: 0 -1px 0 #000; | ||
60 | +} | ||
61 | +ul li ul li:hover { background: #666; } | ||
62 | +ul li:hover ul { | ||
63 | + display: block; | ||
64 | + opacity: 1; | ||
65 | + visibility: visible; | ||
66 | +} | ||
67 | + | ||
68 | +@import url(https://fonts.googleapis.com/css?family=Roboto:300); | ||
69 | + | ||
70 | +.login-page { | ||
71 | + width: 360px; | ||
72 | + padding: 8% 0 0; | ||
73 | + margin: auto; | ||
74 | +} | ||
75 | +.form { | ||
76 | + position: relative; | ||
77 | + z-index: 1; | ||
78 | + background: #FFFFFF; | ||
79 | + max-width: 360px; | ||
80 | + margin: 0 auto 100px; | ||
81 | + padding: 45px; | ||
82 | + text-align: center; | ||
83 | + box-shadow: 0 0 20px 0 rgba(0, 0, 0, 0.2), 0 5px 5px 0 rgba(0, 0, 0, 0.24); | ||
84 | +} | ||
85 | +.form input { | ||
86 | + font-family: "Roboto", sans-serif; | ||
87 | + outline: 0; | ||
88 | + background: #f2f2f2; | ||
89 | + width: 100%; | ||
90 | + border: 0; | ||
91 | + margin: 0 0 15px; | ||
92 | + padding: 15px; | ||
93 | + box-sizing: border-box; | ||
94 | + font-size: 14px; | ||
95 | +} | ||
96 | +.form button { | ||
97 | + font-family: "Roboto", sans-serif; | ||
98 | + text-transform: uppercase; | ||
99 | + outline: 0; | ||
100 | + background: #4CAF50; | ||
101 | + width: 100%; | ||
102 | + border: 0; | ||
103 | + padding: 15px; | ||
104 | + color: #FFFFFF; | ||
105 | + font-size: 14px; | ||
106 | + -webkit-transition: all 0.3 ease; | ||
107 | + transition: all 0.3 ease; | ||
108 | + cursor: pointer; | ||
109 | +} | ||
110 | +.form button:hover,.form button:active,.form button:focus { | ||
111 | + background: #43A047; | ||
112 | +} | ||
113 | +.form .message { | ||
114 | + margin: 15px 0 0; | ||
115 | + color: #b3b3b3; | ||
116 | + font-size: 12px; | ||
117 | +} | ||
118 | +.form .message a { | ||
119 | + color: #4CAF50; | ||
120 | + text-decoration: none; | ||
121 | +} | ||
122 | +.form .register-form { | ||
123 | + display: none; | ||
124 | +} | ||
125 | +.container { | ||
126 | + position: relative; | ||
127 | + z-index: 1; | ||
128 | + max-width: 300px; | ||
129 | + margin: 0 auto; | ||
130 | +} | ||
131 | +.container:before, .container:after { | ||
132 | + content: ""; | ||
133 | + display: block; | ||
134 | + clear: both; | ||
135 | +} | ||
136 | +.container .info { | ||
137 | + margin: 50px auto; | ||
138 | + text-align: center; | ||
139 | +} | ||
140 | +.container .info h1 { | ||
141 | + margin: 0 0 15px; | ||
142 | + padding: 0; | ||
143 | + font-size: 36px; | ||
144 | + font-weight: 300; | ||
145 | + color: #1a1a1a; | ||
146 | +} | ||
147 | +.container .info span { | ||
148 | + color: #4d4d4d; | ||
149 | + font-size: 12px; | ||
150 | +} | ||
151 | +.container .info span a { | ||
152 | + color: #000000; | ||
153 | + text-decoration: none; | ||
154 | +} | ||
155 | +.container .info span .fa { | ||
156 | + color: #EF3B3A; | ||
157 | +} | ||
158 | +body { | ||
159 | + background: #76b852; /* fallback for old browsers */ | ||
160 | + background: -webkit-linear-gradient(right, #76b852, #8DC26F); | ||
161 | + background: -moz-linear-gradient(right, #76b852, #8DC26F); | ||
162 | + background: -o-linear-gradient(right, #76b852, #8DC26F); | ||
163 | + background: linear-gradient(to left, #76b852, #8DC26F); | ||
164 | + font-family: "Roboto", sans-serif; | ||
165 | + -webkit-font-smoothing: antialiased; | ||
166 | + -moz-osx-font-smoothing: grayscale; | ||
167 | +} |
fonts/glyphicons-halflings-regular.eot
0 → 100644
No preview for this file type
fonts/glyphicons-halflings-regular.svg
0 → 100644
This diff could not be displayed because it is too large.
fonts/glyphicons-halflings-regular.ttf
0 → 100644
No preview for this file type
fonts/glyphicons-halflings-regular.woff
0 → 100644
No preview for this file type
fonts/glyphicons-halflings-regular.woff2
0 → 100644
No preview for this file type
js/bootstrap.js
0 → 100644
This diff is collapsed. Click to expand it.
js/bootstrap.min.js
0 → 100644
This diff is collapsed. Click to expand it.
js/index.js
0 → 100644
js/npm.js
0 → 100644
1 | +// This file is autogenerated via the `commonjs` Grunt task. You can require() this file in a CommonJS environment. | ||
2 | +require('../../js/transition.js') | ||
3 | +require('../../js/alert.js') | ||
4 | +require('../../js/button.js') | ||
5 | +require('../../js/carousel.js') | ||
6 | +require('../../js/collapse.js') | ||
7 | +require('../../js/dropdown.js') | ||
8 | +require('../../js/modal.js') | ||
9 | +require('../../js/tooltip.js') | ||
10 | +require('../../js/popover.js') | ||
11 | +require('../../js/scrollspy.js') | ||
12 | +require('../../js/tab.js') | ||
13 | +require('../../js/affix.js') | ||
... | \ No newline at end of file | ... | \ No newline at end of file |
... | @@ -5,80 +5,31 @@ | ... | @@ -5,80 +5,31 @@ |
5 | <meta charset="UTF-8"> | 5 | <meta charset="UTF-8"> |
6 | <script src="https://ajax.googleapis.com/ajax/libs/jquery/3.1.1/jquery.min.js"></script> | 6 | <script src="https://ajax.googleapis.com/ajax/libs/jquery/3.1.1/jquery.min.js"></script> |
7 | </head> | 7 | </head> |
8 | +<link rel="stylesheet" href="css/style.css"> | ||
9 | +<link rel="stylesheet" href="css/bootstrap.min.css"> | ||
10 | + | ||
11 | +<!-- 부가적인 테마 --> | ||
12 | +<link rel="stylesheet" href="css/bootstrap-theme.min.css"> | ||
13 | + | ||
14 | +<!-- 합쳐지고 최소화된 최신 자바스크립트 --> | ||
15 | +<script src="js/bootstrap.min.js"></script> | ||
8 | 16 | ||
9 | -<style> | ||
10 | -body { | ||
11 | - font-family: 'Lucida Grande', 'Helvetica Neue', Helvetica, Arial, sans-serif; | ||
12 | - padding: 20px 50px 150px; | ||
13 | - font-size: 13px; | ||
14 | - text-align: center; | ||
15 | - background: #E3CAA1; | ||
16 | -} | ||
17 | - | ||
18 | -ul { | ||
19 | - text-align: left; | ||
20 | - display: inline; | ||
21 | - margin: 0; | ||
22 | - padding: 15px 4px 17px 0; | ||
23 | - list-style: none; | ||
24 | - -webkit-box-shadow: 0 0 5px rgba(0, 0, 0, 0.15); | ||
25 | - -moz-box-shadow: 0 0 5px rgba(0, 0, 0, 0.15); | ||
26 | - box-shadow: 0 0 5px rgba(0, 0, 0, 0.15); | ||
27 | -} | ||
28 | -ul li { | ||
29 | - font: bold 12px/18px sans-serif; | ||
30 | - display: inline-block; | ||
31 | - margin-right: -4px; | ||
32 | - position: relative; | ||
33 | - padding: 15px 20px; | ||
34 | - background: #fff; | ||
35 | - cursor: pointer; | ||
36 | - -webkit-transition: all 0.2s; | ||
37 | - -moz-transition: all 0.2s; | ||
38 | - -ms-transition: all 0.2s; | ||
39 | - -o-transition: all 0.2s; | ||
40 | - transition: all 0.2s; | ||
41 | -} | ||
42 | -ul li:hover { | ||
43 | - background: #555; | ||
44 | - color: #fff; | ||
45 | -} | ||
46 | -ul li ul { | ||
47 | - padding: 0; | ||
48 | - position: absolute; | ||
49 | - top: 48px; | ||
50 | - left: 0; | ||
51 | - width: 150px; | ||
52 | - -webkit-box-shadow: none; | ||
53 | - -moz-box-shadow: none; | ||
54 | - box-shadow: none; | ||
55 | - display: none; | ||
56 | - opacity: 0; | ||
57 | - visibility: hidden; | ||
58 | - -webkit-transiton: opacity 0.2s; | ||
59 | - -moz-transition: opacity 0.2s; | ||
60 | - -ms-transition: opacity 0.2s; | ||
61 | - -o-transition: opacity 0.2s; | ||
62 | - -transition: opacity 0.2s; | ||
63 | -} | ||
64 | -ul li ul li { | ||
65 | - background: #555; | ||
66 | - display: block; | ||
67 | - color: #fff; | ||
68 | - text-shadow: 0 -1px 0 #000; | ||
69 | -} | ||
70 | -ul li ul li:hover { background: #666; } | ||
71 | -ul li:hover ul { | ||
72 | - display: block; | ||
73 | - opacity: 1; | ||
74 | - visibility: visible; | ||
75 | -} | ||
76 | -</style> | ||
77 | <script> | 17 | <script> |
78 | $(function () { | 18 | $(function () { |
79 | $('.click_genre').click(function () { | 19 | $('.click_genre').click(function () { |
80 | var str = $(this).text(); | 20 | var str = $(this).text(); |
21 | + $.ajax({ | ||
22 | + type:"GET", | ||
23 | + url:"errata", | ||
24 | + data:{'query':$("#search_input").val()}, | ||
25 | + success:function(args2){ | ||
26 | + | ||
27 | + if( args2.errata==""){ | ||
81 | var search = $("#search_input").val(); | 28 | var search = $("#search_input").val(); |
29 | + } | ||
30 | + else{ | ||
31 | + var search =args2.errata; | ||
32 | + } | ||
82 | $.ajax({ | 33 | $.ajax({ |
83 | type:"GET", | 34 | type:"GET", |
84 | url:"serach", | 35 | url:"serach", |
... | @@ -86,10 +37,103 @@ $(function () { | ... | @@ -86,10 +37,103 @@ $(function () { |
86 | success:function(args){ | 37 | success:function(args){ |
87 | $('#info').html(args); | 38 | $('#info').html(args); |
88 | //alert(args); | 39 | //alert(args); |
40 | + alert(str + " 장르를 선택하셨습니다"); | ||
41 | + }, | ||
42 | + }); | ||
43 | + }, | ||
44 | + }); | ||
45 | + }) | ||
46 | +}) | ||
47 | + | ||
48 | +$(function () { | ||
49 | + $('.click_year').click(function () { | ||
50 | + var str = $(this).text(); | ||
51 | + $.ajax({ | ||
52 | + type:"GET", | ||
53 | + url:"errata", | ||
54 | + data:{'query':$("#search_input").val()}, | ||
55 | + success:function(args2){ | ||
56 | + | ||
57 | + if( args2.errata==""){ | ||
58 | + var search = $("#search_input").val(); | ||
59 | + } | ||
60 | + else{ | ||
61 | + var search =args2.errata; | ||
62 | + } | ||
63 | + $.ajax({ | ||
64 | + type:"GET", | ||
65 | + url:"serach", | ||
66 | + data:{'year':str, 'search':search}, | ||
67 | + success:function(args){ | ||
68 | + $('#info').html(args); | ||
69 | + //alert(args); | ||
70 | + alert(str + " 영화를 선택하셨습니다"); | ||
71 | + }, | ||
72 | + }); | ||
89 | }, | 73 | }, |
90 | }); | 74 | }); |
91 | }) | 75 | }) |
92 | }) | 76 | }) |
77 | + | ||
78 | +$(function () { | ||
79 | + $('.click_country').click(function () { | ||
80 | + var str = $(this).text(); | ||
81 | + str = str.slice(0,2); | ||
82 | + $.ajax({ | ||
83 | + type:"GET", | ||
84 | + url:"errata", | ||
85 | + data:{'query':$("#search_input").val()}, | ||
86 | + success:function(args2){ | ||
87 | + | ||
88 | + if( args2.errata==""){ | ||
89 | + var search = $("#search_input").val(); | ||
90 | + } | ||
91 | + else{ | ||
92 | + var search =args2.errata; | ||
93 | + } | ||
94 | + $.ajax({ | ||
95 | + type:"GET", | ||
96 | + url:"serach", | ||
97 | + data:{'country':str , 'search':search}, | ||
98 | + success:function(args){ | ||
99 | + $('#info').html(args); | ||
100 | + //alert(args); | ||
101 | + alert(str + " 국가의 영화를 검색하셨습니다."); | ||
102 | + }, | ||
103 | + }); | ||
104 | + }, | ||
105 | + }); | ||
106 | + }) | ||
107 | +}) | ||
108 | + | ||
109 | +$(function () { | ||
110 | + $('.click_all').click(function () { | ||
111 | + $.ajax({ | ||
112 | + type:"GET", | ||
113 | + url:"errata", | ||
114 | + data:{'query':$("#search_input").val()}, | ||
115 | + success:function(args2){ | ||
116 | + | ||
117 | + if( args2.errata==""){ | ||
118 | + var searchAll = $("#search_input").val(); | ||
119 | + } | ||
120 | + else{ | ||
121 | + var searchAll =args2.errata; | ||
122 | + } | ||
123 | + $.ajax({ | ||
124 | + type:"GET", | ||
125 | + url:"serach", | ||
126 | + data:{'searchAll':searchAll}, | ||
127 | + success:function(args){ | ||
128 | + $('#info').html(args); | ||
129 | + alert(searchAll + " 이(가) 들어가는 모든 영화를 검색하셨습니다."); | ||
130 | + }, | ||
131 | + }); | ||
132 | + }, | ||
133 | + }); | ||
134 | + }) | ||
135 | +}) | ||
136 | + | ||
93 | </script> | 137 | </script> |
94 | 138 | ||
95 | <body> | 139 | <body> |
... | @@ -113,25 +157,29 @@ $(function () { | ... | @@ -113,25 +157,29 @@ $(function () { |
113 | </li> | 157 | </li> |
114 | 158 | ||
115 | <li> | 159 | <li> |
116 | - Rating | 160 | + Year |
117 | <ul> | 161 | <ul> |
118 | - <li>3.0 Above</li> | 162 | + <li class = "click_year" >1980년대</li> |
119 | - <li>3.5 Above</li> | 163 | + <li class = "click_year" >1990년대</li> |
120 | - <li>4.0 Above</li> | 164 | + <li class = "click_year" >2000년대</li> |
121 | - <li>4.5 Above</li> | 165 | + <li class = "click_year" >2010년대</li> |
122 | </ul> | 166 | </ul> |
123 | </li> | 167 | </li> |
124 | 168 | ||
125 | <li> | 169 | <li> |
126 | - Portfolio | 170 | + Country |
127 | <ul> | 171 | <ul> |
128 | - <li>Web Design</li> | 172 | + <li class = "click_country" >KR(한국)</li> |
129 | - <li>Web Development</li> | 173 | + <li class = "click_country" >JP(일본)</li> |
130 | - <li>Illustrations</li> | 174 | + <li class = "click_country" >US(미국)</li> |
175 | + <li class = "click_country" >HK(홍콩)</li> | ||
176 | + <li class = "click_country" >GB(영국)</li> | ||
177 | + <li class = "click_country" >FR(프랑스)</li> | ||
178 | + <li class = "click_country" >ETC(기타)</li> | ||
131 | </ul> | 179 | </ul> |
132 | </li> | 180 | </li> |
133 | - <li>Blog</li> | 181 | + |
134 | - <li>All</li> | 182 | + <li class = "click_all" >All</li> |
135 | </ul> | 183 | </ul> |
136 | 184 | ||
137 | <div id = info></div> | 185 | <div id = info></div> | ... | ... |
movie_info.ejs
deleted
100644 → 0
1 | + | ||
2 | + | ||
3 | +<table class="table table-condensed"> | ||
4 | +<thead> | ||
5 | + <tr> | ||
6 | + <th>제목</th> | ||
7 | + <th>사진</th> | ||
8 | + </tr> | ||
9 | + | ||
10 | +</thead> | ||
11 | +<tbody> | ||
1 | <% for(var i=0; i < item.length; i++) { %> | 12 | <% for(var i=0; i < item.length; i++) { %> |
2 | - <p><%= item[i]["title"]%></p> | 13 | +<tr> |
14 | + <td> <p><%= item[i]["title"]%></p></td> | ||
15 | + <td><img src="<%=item[i].image%>"></td> | ||
16 | +</tr> | ||
3 | <% } %> | 17 | <% } %> |
18 | +</tbody> | ||
19 | +</table> | ... | ... |
-
Please register or login to post a comment