hyunjong

네이버, 다음 로그인 에러 처리, 클린코드

...@@ -9,27 +9,27 @@ var NaverStrategy = require('passport-naver').Strategy; ...@@ -9,27 +9,27 @@ var NaverStrategy = require('passport-naver').Strategy;
9 var GoogleStrategy = require('passport-google-oauth').OAuth2Strategy; 9 var GoogleStrategy = require('passport-google-oauth').OAuth2Strategy;
10 var router = express.Router(); 10 var router = express.Router();
11 11
12 -// 설명 12 +// kakao login API
13 var kakaoKey = { 13 var kakaoKey = {
14 clientID : '5634a5f8ca5c9a5eb378d6b6e6e869a0', 14 clientID : '5634a5f8ca5c9a5eb378d6b6e6e869a0',
15 callbackURL : '/auth/login/kakao/callback' 15 callbackURL : '/auth/login/kakao/callback'
16 }; 16 };
17 17
18 -// 18 +// naver login API
19 var naverKey = { 19 var naverKey = {
20 clientID : 'OHmCrpQuVFnIEB4GkmF_', 20 clientID : 'OHmCrpQuVFnIEB4GkmF_',
21 callbackURL : '/auth/login/naver/callback', 21 callbackURL : '/auth/login/naver/callback',
22 clientSecret : 'BBgcRdnj0M' 22 clientSecret : 'BBgcRdnj0M'
23 }; 23 };
24 24
25 -// 25 +// google login API
26 var googleKey = { 26 var googleKey = {
27 clientID : '924802195853-ir977i2ohnddaaninlqlbeg6sov629hq.apps.googleusercontent.com', 27 clientID : '924802195853-ir977i2ohnddaaninlqlbeg6sov629hq.apps.googleusercontent.com',
28 callbackURL : '/auth/login/google/callback', 28 callbackURL : '/auth/login/google/callback',
29 clientSecret : 'NaWeoJouUzYq4VfBesTkdUfA' 29 clientSecret : 'NaWeoJouUzYq4VfBesTkdUfA'
30 }; 30 };
31 31
32 -// 32 +// kakao passport
33 passport.use(new KakaoStrategy(kakaoKey, 33 passport.use(new KakaoStrategy(kakaoKey,
34 function(accessToken, refreshToken,params, profile, done) { 34 function(accessToken, refreshToken,params, profile, done) {
35 console.log(profile); 35 console.log(profile);
...@@ -41,7 +41,7 @@ passport.use(new KakaoStrategy(kakaoKey, ...@@ -41,7 +41,7 @@ passport.use(new KakaoStrategy(kakaoKey,
41 } 41 }
42 )); 42 ));
43 43
44 -// 44 +// naver passport
45 passport.use(new NaverStrategy(naverKey, 45 passport.use(new NaverStrategy(naverKey,
46 function (accessToken, refreshToken, profile, done) { 46 function (accessToken, refreshToken, profile, done) {
47 console.log(profile); 47 console.log(profile);
...@@ -53,7 +53,7 @@ passport.use(new NaverStrategy(naverKey, ...@@ -53,7 +53,7 @@ passport.use(new NaverStrategy(naverKey,
53 } 53 }
54 )); 54 ));
55 55
56 -// 56 +// google passport
57 passport.use(new GoogleStrategy(googleKey, 57 passport.use(new GoogleStrategy(googleKey,
58 function (accessToken, refreshToken, profile, done) { 58 function (accessToken, refreshToken, profile, done) {
59 console.log(profile); 59 console.log(profile);
...@@ -68,29 +68,28 @@ passport.use(new GoogleStrategy(googleKey, ...@@ -68,29 +68,28 @@ passport.use(new GoogleStrategy(googleKey,
68 // kakao 로그인, 로그인 콜백 68 // kakao 로그인, 로그인 콜백
69 router.get('/auth/login/kakao', passport.authenticate('kakao')); 69 router.get('/auth/login/kakao', passport.authenticate('kakao'));
70 router.get('/auth/login/kakao/callback', passport.authenticate('kakao', { 70 router.get('/auth/login/kakao/callback', passport.authenticate('kakao', {
71 - successRedirect: '/mytoons', 71 + successRedirect: '/mytoons',
72 - failureRedirect: '/' 72 + failureRedirect: '/'
73 - }) 73 + })
74 ); 74 );
75 75
76 -// naver 로그인 76 +// naver 로그인, 로그인 콜백
77 router.get('/auth/login/naver', passport.authenticate('naver')); 77 router.get('/auth/login/naver', passport.authenticate('naver'));
78 -router.get('/auth/login/naver/callback', 78 +router.get('/auth/login/naver/callback', passport.authenticate('naver', {
79 - passport.authenticate('naver', { 79 + successRedirect: '/mytoons',
80 - successRedirect: '/mytoons', 80 + failureRedirect: '/'
81 - failureRedirect: '/'
82 }) 81 })
83 ); 82 );
84 83
85 // facebook 로그인, 로그인 콜백 84 // facebook 로그인, 로그인 콜백
86 router.get('/auth/login/google', passport.authenticate('google', { scope: ['email profile'] })); 85 router.get('/auth/login/google', passport.authenticate('google', { scope: ['email profile'] }));
87 router.get('/auth/login/google/callback', passport.authenticate('google', { 86 router.get('/auth/login/google/callback', passport.authenticate('google', {
88 - successRedirect: '/mytoons', 87 + successRedirect: '/mytoons',
89 - failureRedirect: '/' 88 + failureRedirect: '/'
90 }) 89 })
91 ); 90 );
92 91
93 -// 설명 92 +// 로그인 처리
94 function loginByThirdparty(info, done) { 93 function loginByThirdparty(info, done) {
95 var stmt_duplicated = "select *from `user` where id = id"; 94 var stmt_duplicated = "select *from `user` where id = id";
96 //'select *from `user` where `id` = ? 95 //'select *from `user` where `id` = ?
...@@ -125,27 +124,27 @@ function loginByThirdparty(info, done) { ...@@ -125,27 +124,27 @@ function loginByThirdparty(info, done) {
125 }); 124 });
126 } 125 }
127 126
128 -router.get('/login', function(req,res){ 127 +router.get('/login', function(req,res) {
129 res.render('login_page') 128 res.render('login_page')
130 }) 129 })
131 130
132 131
133 // 라우터 설정, 카카오 132 // 라우터 설정, 카카오
134 router.get('/auth/logout/kakao',function (req,res) { 133 router.get('/auth/logout/kakao',function (req,res) {
135 - req.logout(); 134 + req.logout();
136 - res.redirect('/'); 135 + res.redirect('/');
137 }) 136 })
138 137
139 // 라우터 설정, 페이스북 138 // 라우터 설정, 페이스북
140 router.get('/auth/logout/naver',function (req,res) { 139 router.get('/auth/logout/naver',function (req,res) {
141 - req.logout(); 140 + req.logout();
142 - res.redirect('/'); 141 + res.redirect('/');
143 }) 142 })
144 143
145 // 라우터 설정, 구글 144 // 라우터 설정, 구글
146 router.get('/auth/logout/google',function (req,res) { 145 router.get('/auth/logout/google',function (req,res) {
147 - req.logout(); 146 + req.logout();
148 - res.redirect('/'); 147 + res.redirect('/');
149 }) 148 })
150 149
151 // 150 //
...@@ -153,87 +152,134 @@ function getLatestToon(titleid, day ,cb) { ...@@ -153,87 +152,134 @@ function getLatestToon(titleid, day ,cb) {
153 152
154 } 153 }
155 154
156 -function getDaumToons(_day){ 155 +//_day요일의 다음웹툰 불러오기
157 - // X요일 다음 웹툰 156 +function getDaumToons(_day) {
157 +
158 var day = _day; 158 var day = _day;
159 var day_name = day; 159 var day_name = day;
160 var daum = `http://webtoon.daum.net/data/pc/webtoon/list_serialized/${day}?timeStamp=1515819276574`; 160 var daum = `http://webtoon.daum.net/data/pc/webtoon/list_serialized/${day}?timeStamp=1515819276574`;
161 var site = 'daum'; 161 var site = 'daum';
162 162
163 - client.fetch(daum, {}, function (err, $, res, body) { 163 + client.fetch(daum, {}, function (err, $, res, body){
164 164
165 - var data = JSON.parse(body); 165 + var data = JSON.parse(body);
166 - var list = data["data"]; 166 + var list = data["data"];
167 167
168 - list.forEach(function (item, idx) { 168 + list.forEach(function (item, idx) {
169 169
170 - var webtoon_link = 'http://webtoon.daum.net/webtoon/view/' + item.nickname.toString(); 170 + var webtoon_link = 'http://webtoon.daum.net/webtoon/view/' + item.nickname.toString();
171 - var webtoon = { 171 + var webtoon = {
172 - toon_index : item.id, 172 + toon_index : item.id,
173 - name : item.title, 173 + name : item.title,
174 - thum_link : item.pcThumbnailImage.url, 174 + thum_link : item.pcThumbnailImage.url,
175 - webtoon_link : webtoon_link, 175 + webtoon_link : webtoon_link,
176 - week : day_name, 176 + week : day_name,
177 - site : site, 177 + site : site,
178 - latest : 0 178 + latest : 0
179 - }; 179 + };
180 180
181 allWebtoonList.push(webtoon); 181 allWebtoonList.push(webtoon);
182 - }); 182 + });
183 }); 183 });
184 } 184 }
185 185
186 -// 186 +// 네이버 전체 웹툰 불러오기
187 -function getNaverToons(){ 187 +function getNaverToons() {
188 +
188 var allWeeklyToonsUrl = "http://comic.naver.com/webtoon/weekday.nhn"; 189 var allWeeklyToonsUrl = "http://comic.naver.com/webtoon/weekday.nhn";
190 +
189 request(allWeeklyToonsUrl,function (err, res, html) { 191 request(allWeeklyToonsUrl,function (err, res, html) {
190 - if(!err){ 192 + if(!err){
191 - var $ = cheerio.load(html); 193 + var $ = cheerio.load(html);
192 - var p = Promise.resolve(); 194 + var p = Promise.resolve();
193 - var eachs = $(".thumb").each(function (i) { 195 + var eachs = $(".thumb").each(function (i) {
194 - var week = $(this).parent().parent().prev().attr('class'); 196 +
195 - var webtoon_link = "http://comic.naver.com" + $(this).children().first().attr('href'); 197 + var week = $(this).parent().parent().prev().attr('class');
196 - var thumb_link = $(this).children().first().children().first().attr('src'); 198 + var webtoon_link = "http://comic.naver.com" + $(this).children().first().attr('href');
197 - var name = $(this).next().text(); 199 + var thumb_link = $(this).children().first().children().first().attr('src');
198 - var titleid = webtoon_link.split('?')[1].split('&')[0].split('=')[1]; 200 + var name = $(this).next().text();
199 - var site = 'naver'; 201 + var titleid = webtoon_link.split('?')[1].split('&')[0].split('=')[1];
200 - var webtoon= { 202 + var site = 'naver';
201 - toon_index: titleid, 203 + var webtoon= {
202 - name : name, 204 + toon_index: titleid,
203 - thum_link : thumb_link, 205 + name : name,
204 - webtoon_link : webtoon_link, 206 + thum_link : thumb_link,
205 - week : week, 207 + webtoon_link : webtoon_link,
206 - site : site, 208 + week : week,
207 - latest : 0 209 + site : site,
208 - }; 210 + latest : 0
209 - allWebtoonList.push(webtoon); 211 + };
210 - }); 212 +
213 + allWebtoonList.push(webtoon);
214 + });
211 215
212 - p.then(function() { 216 + p.then(function() {
213 - i = 0; 217 + i = 0;
214 - allWebtoonList.forEach(function (webtoon) { 218 + allWebtoonList.forEach(function (webtoon) {
215 - var sql= "INSERT INTO `toon` (toon_index, name, thum_link, webtoon_link, week, site, latest) VALUES(?) ON DUPLICATE KEY UPDATE latest=latest"; 219 + var sql= "INSERT INTO `toon` (toon_index, name, thum_link, webtoon_link, week, site, latest) VALUES(?) ON DUPLICATE KEY UPDATE latest=latest";
216 - var values=[webtoon.toon_index, webtoon.name, webtoon.thum_link, webtoon.webtoon_link,webtoon.week, webtoon.site, webtoon.latest]; 220 + var values=[webtoon.toon_index, webtoon.name, webtoon.thum_link, webtoon.webtoon_link,webtoon.week, webtoon.site, webtoon.latest];
217 - 221 +
218 - connection.query(sql,[values],function(err,result){ 222 + connection.query(sql,[values],function(err,result){
219 - if (err) { 223 + if (err) {
220 - console.log("웹툰 DB 에러 : " + err); 224 + console.log("웹툰 DB 에러 : " + err);
221 - } else { 225 + } else {
222 - console.log("웹툰 DB처리 완료!"); 226 + console.log("웹툰 DB처리 완료!");
223 - } 227 + }
224 - });
225 - })
226 }); 228 });
227 - } 229 + })
230 + });
231 + }
228 }); 232 });
229 } 233 }
230 234
231 // 구현중 235 // 구현중
232 function getTomicsToons(){ 236 function getTomicsToons(){
237 + var allWeeklyToonsUrl = "https://www.lezhin.com/ko/scheduled";
233 238
239 + request(allWeeklyToonsUrl,function (err, res, html) {
240 + if(!err){
241 + var $ = cheerio.load(html);
242 + var p = Promise.resolve();
243 + var eachs = $(".thumb").each(function (i) {
244 + var week = $(this).parent().parent().prev().attr('class');
245 + var webtoon_link = "https://www.lezhin.com/ko" + $(this).children().first().attr('href');
246 + var thumb_link = $(this).children().first().children().first().attr('src');
247 + var name = $(this).next().text();
248 + var titleid = webtoon_link.split('?')[1].split('&')[0].split('=')[1];
249 + var site = 'naver';
250 + var webtoon= {
251 + toon_index: titleid,
252 + name : name,
253 + thum_link : thumb_link,
254 + webtoon_link : webtoon_link,
255 + week : week,
256 + site : site,
257 + latest : 0
258 + };
259 +
260 + allWebtoonList.push(webtoon);
261 + });
262 +
263 + p.then(function() {
264 + i = 0;
265 + allWebtoonList.forEach(function (webtoon) {
266 + var sql= "INSERT INTO `toon` (toon_index, name, thum_link, webtoon_link, week, site, latest) VALUES(?) ON DUPLICATE KEY UPDATE latest=latest";
267 + var values=[webtoon.toon_index, webtoon.name, webtoon.thum_link, webtoon.webtoon_link,webtoon.week, webtoon.site, webtoon.latest];
268 +
269 + connection.query(sql,[values],function(err,result){
270 + if (err) {
271 + console.log("웹툰 DB 에러 : " + err);
272 + } else {
273 + console.log("웹툰 DB처리 완료!");
274 + }
275 + });
276 + })
277 + });
278 + }
279 + });
234 } 280 }
235 281
236 -// 설명 282 +// 모든 웹튼을 담고있는 배열
237 allWebtoons = new Array(); 283 allWebtoons = new Array();
238 284
239 // 설명 285 // 설명
......
...@@ -3,257 +3,243 @@ ...@@ -3,257 +3,243 @@
3 <head> 3 <head>
4 <title><%= title %></title> 4 <title><%= title %></title>
5 <link rel='stylesheet' href='/stylesheets/style.css' /> 5 <link rel='stylesheet' href='/stylesheets/style.css' />
6 - <!-- Bootstrap --> 6 + <!-- Bootstrap -->
7 - <link rel="stylesheet" type="text/css" href="/stylesheets/bootstrap.css"> 7 + <link rel="stylesheet" type="text/css" href="/stylesheets/bootstrap.css">
8 - <link rel="stylesheet" type="text/css" href="/stylesheets/font-awesome.css"> 8 + <link rel="stylesheet" type="text/css" href="/stylesheets/font-awesome.css">
9 - 9 +
10 - <!-- Stylesheet 10 + <!-- Stylesheet ================================================== -->
11 - ================================================== --> 11 + <link rel="stylesheet" type="text/css" href="/stylesheets/style.css">
12 - <link rel="stylesheet" type="text/css" href="/stylesheets/style.css"> 12 + <link rel="stylesheet" type="text/css" href="/stylesheets/nivo-lightbox/nivo-lightbox.css">
13 - <link rel="stylesheet" type="text/css" href="/stylesheets/nivo-lightbox/nivo-lightbox.css"> 13 + <link rel="stylesheet" type="text/css" href="/stylesheets/nivo-lightbox/default.css">
14 - <link rel="stylesheet" type="text/css" href="/stylesheets/nivo-lightbox/default.css"> 14 + <link href="https://fonts.googleapis.com/css?family=Raleway:300,400,500,600,700" rel="stylesheet">
15 - <link href="https://fonts.googleapis.com/css?family=Raleway:300,400,500,600,700" rel="stylesheet"> 15 + <link href="https://fonts.googleapis.com/css?family=Open+Sans:300,400,600,700" rel="stylesheet">
16 - <link href="https://fonts.googleapis.com/css?family=Open+Sans:300,400,600,700" rel="stylesheet"> 16 + <link href="https://fonts.googleapis.com/css?family=Dancing+Script:400,700" rel="stylesheet">
17 - <link href="https://fonts.googleapis.com/css?family=Dancing+Script:400,700" rel="stylesheet"> 17 + <link href="https://fonts.googleapis.com/css?family=Gugi&amp;subset=korean" rel="stylesheet">
18 - <link href="https://fonts.googleapis.com/css?family=Gugi&amp;subset=korean" rel="stylesheet"> 18 + <script src="http://developers.kakao.com/sdk/js/kakao.min.js">
19 - <script src="http://developers.kakao.com/sdk/js/kakao.min.js"> 19 + function daum_click(){
20 - function daum_click() 20 + if(Daum_webtoons.display == "none")
21 - { 21 + Daum_webtoons.display == "block";
22 - if(Daum_webtoons.display == "none") 22 + if(Daum_webtoons.display = "block")
23 - Daum_webtoons.display == "block"; 23 + Daum_webtoons.display == "none";
24 - if(Daum_webtoons.display = "block") 24 + }
25 - Daum_webtoons.display == "none"; 25 + function naver_click(){
26 - } 26 + if(Naver_webtoons.display == "none")
27 - function naver_click() 27 + Naver_webtoons.display == "block";
28 - { 28 + if(Naver_webtoons.display = "block")
29 - if(Naver_webtoons.display == "none") 29 + Naver_webtoons.display == "none";
30 - Naver_webtoons.display == "block"; 30 + }
31 - if(Naver_webtoons.display = "block") 31 + </script>
32 - Naver_webtoons.display == "none";
33 - }
34 - </script>
35 </head> 32 </head>
36 33
37 <body id="page-top" data-spy="scroll" data-target=".navbar-fixed-top"> 34 <body id="page-top" data-spy="scroll" data-target=".navbar-fixed-top">
38 <!-- Navigation ==========================================--> 35 <!-- Navigation ==========================================-->
39 <nav id="menu" class="navbar navbar-default navbar-fixed-top"> 36 <nav id="menu" class="navbar navbar-default navbar-fixed-top">
40 - <div class="container"> 37 + <div class="container">
41 - <!-- Brand and toggle get grouped for better mobile display --> 38 + <!-- Brand and toggle get grouped for better mobile display -->
42 - <div class="navbar-header"> 39 + <div class="navbar-header">
43 - <button type="button" class="navbar-toggle collapsed" data-toggle="collapse" data-target="#bs-example-navbar-collapse-1"> <span class="sr-only">Toggle navigation</span> <span class="icon-bar"></span> <span class="icon-bar"></span> <span class="icon-bar"></span> </button> 40 + <button type="button" class="navbar-toggle collapsed" data-toggle="collapse" data-target="#bs-example-navbar-collapse-1"> <span class="sr-only">Toggle navigation</span> <span class="icon-bar"></span> <span class="icon-bar"></span> <span class="icon-bar"></span>
44 - <a class="navbar-brand page-scroll" href="#page-top" style="font-family:Gugi">니툰내툰</a> </div> 41 + </button>
45 - <!-- Collect the nav links, forms, and other content for toggling --> 42 + <a class="navbar-brand page-scroll" href="#page-top" style="font-family:Gugi">니툰내툰</a>
46 - <div class="collapse navbar-collapse" id="bs-example-navbar-collapse-1"> 43 + </div>
47 - <ul class="nav navbar-nav navbar-right"> 44 + <!-- Collect the nav links, forms, and other content for toggling -->
48 - <li><a href="#about" class="page-scroll">About</a></li> 45 + <div class="collapse navbar-collapse" id="bs-example-navbar-collapse-1">
49 - <li><a href="#portfolio" class="page-scroll">Webtoons</a></li> 46 + <ul class="nav navbar-nav navbar-right">
50 - <li><a href="/login" class="page-scroll">Login</a></li> 47 + <li><a href="#about" class="page-scroll">About</a></li>
51 - </ul> 48 + <li><a href="#portfolio" class="page-scroll">Webtoons</a></li>
52 - </div> 49 + <li><a href="/login" class="page-scroll">Login</a></li>
53 - <!-- /.navbar-collapse --> 50 + </ul>
54 </div> 51 </div>
52 + <!-- /.navbar-collapse -->
53 + </div>
55 </nav> 54 </nav>
56 <!-- Header --> 55 <!-- Header -->
57 <header id="header"> 56 <header id="header">
58 - <div class="intro"> 57 + <div class="intro">
59 - <div class="overlay"> 58 + <div class="overlay">
60 - <div class="container"> 59 + <div class="container">
61 - <div class="row"> 60 + <div class="row">
62 - <div class="intro-text"> 61 + <div class="intro-text">
63 - 62 + <h1 style="font-family:Gugi">니툰내툰</h1>
64 - <h1 style="font-family:Gugi">니툰내툰</h1> 63 + <p> NAVER / DAUM / Lezhin </p>
65 - <p> NAVER / DAUM / WEBTOONS </p> 64 + <a href="#about" class="btn btn-custom btn-lg page-scroll">All the Webtoons</a>
66 - <a href="#about" class="btn btn-custom btn-lg page-scroll">All the Webtoons</a> </div> 65 + </div>
67 - </div>
68 - </div>
69 </div> 66 </div>
67 + </div>
70 </div> 68 </div>
69 + </div>
71 </header> 70 </header>
72 71
73 <!-- About Section --> 72 <!-- About Section -->
74 <div id="about"> 73 <div id="about">
75 - <div class="container"> 74 + <div class="container">
76 - <div class="row"> 75 + <div class="row">
77 - <div class="col-xs-12 col-md-6 "> 76 + <div class="col-xs-12 col-md-6 ">
78 - <div class="about-img"><img src="images/toon.png" class="img-responsive" alt=""></div> 77 + <div class="about-img"><img src="images/toon.png" class="img-responsive" alt="">
79 - </div> 78 + </div>
80 - <div class="col-xs-12 col-md-6"> 79 + </div>
81 - <div class="about-text"> 80 +
82 - <h2>Our Term-Project</h2> 81 + <div class="col-xs-12 col-md-6">
83 - <hr> 82 + <div class="about-text">
84 - <!--수정해주세욤!--> 83 + <h2>Our Term-Project</h2>
85 - <p>마더 프로젝트 니툰내툰(YTMT)를 개선하는 프로젝트입니다. 네이버 웹툰 뿐만 아니라 다음 웹툰도 담을 수 있으며, 타인이 담은 웹툰도 확인할 수 있습니다.</p> 84 + <hr><p>마더프로젝트 니툰내툰을 개선하는 프로젝트입니다. 네이버웹툰, 다음웹툰, 레진웹툰을 담을 수 있으며 다른 사용자가 담은 웹툰도 확인할 수 있습니다.</p>
86 - <h3>Programmers</h3> 85 + <h3>Developers</h3>
87 - <p>2013100924 이현종, 2018102151 Abdullaev Akhidjon</p> 86 + <p>2013100924 이현종, 2018102151 Abdullaev Akhidjon</p>
88 - </div>
89 - </div>
90 </div> 87 </div>
88 + </div>
91 </div> 89 </div>
90 + </div>
92 </div> 91 </div>
92 +
93 <!-- Portfolio Section --> 93 <!-- Portfolio Section -->
94 <div id="portfolio"> 94 <div id="portfolio">
95 - <div class="section-title text-center center"> 95 + <div class="section-title text-center center">
96 - <div class="overlay"> 96 + <div class="overlay">
97 - <h2>Gallery</h2> 97 + <h2>Gallery</h2>
98 - <hr> 98 + <hr><p>니툰내툰에서 제공하는 웹툰 리스트입니다</p>
99 - <p>니툰내툰에서 제공하는 웹툰 리스트입니다</p>
100 - </div>
101 </div> 99 </div>
102 - <div class="container"> 100 + </div>
103 - <div class="row"> 101 +
104 - <div class="categories"> 102 + <div class="container">
105 - <ul class="cat"> 103 + <div class="row">
106 - 104 + <div class="categories">
107 - <font size = 30> 105 + <ul class="cat">
108 - 다음 웹툰 106 + <font size = 30>
109 - </font> 107 + 다음 웹툰
110 - 108 + </font>
111 - <a onclick="Daum_webtoons.style.display=(Daum_webtoons.style.display=='none')?'block':'none';" href="javascript:void(0)"> 109 + <a onclick="Daum_webtoons.style.display=(Daum_webtoons.style.display=='none')?'block':'none';" href="javascript:void(0)">
112 - <img src ='/images/daumicon.png' width="83" height="90" onclick="daum_click" /> 110 + <img src ='/images/daumicon.png' width="90" height="90" onclick="daum_click" />
113 - </a> 111 + </a>
114 - <div style="display:none" id="Daum_webtoons"> 112 +
115 - <table> 113 + <div style="display:none" id="Daum_webtoons">
116 - <% 114 + <table>
117 - var current = ""; 115 + <%var current = "";
118 - for(webtoon in list){
119 -
120 - if(current!=list[webtoon].week && list[webtoon].site == 'daum'){
121 - if(current!=""){
122 - %>
123 - </tr>
124 - <% } %>
125 - <tr>
126 - <th><%= list[webtoon].week %></th>
127 - <% } %>
128 - <%
129 - if(list[webtoon].site == 'daum')
130 - {
131 - %>
132 - <td>
133 - <a href="<%= list[webtoon].webtoon_link %>">
134 - <img alt="img" width="83" height="90" src="<%= list[webtoon].thum_link %>"/>
135 - </a>
136 - <%= list[webtoon].name %>
137 - </td>
138 - <%
139 - }
140 - %>
141 -
142 - <%
143 - if(current!=list[webtoon].week) {
144 - current = list[webtoon].week;
145 - %>
146 -
147 - <%
148 - }
149 - }
150 - %>
151 - </tr>
152 - </table>
153 - <!--</br>-->
154 - </div>
155 - <!--<br>-->
156 -
157 - <font size = 30>
158 - 네이버 웹툰
159 - </font>
160 - <a onclick="Naver_webtoons.style.display=(Naver_webtoons.style.display=='none')?'block':'none';" href="javascript:void(0)">
161 - <img src ='/images/navericon.png' width="83" height="90"/>
162 - </a>
163 - <div id="Naver_webtoons" style = "display:none">
164 -
165 - <table>
166 - <%
167 - var current = "";
168 for(webtoon in list){ 116 for(webtoon in list){
169 - 117 + if(current!=list[webtoon].week && list[webtoon].site == 'daum'){
170 - if(current!=list[webtoon].week && list[webtoon].site == 'naver'){ 118 + if(current!=""){
171 - if(current!=""){ 119 + %>
172 - %> 120 + </tr>
173 - </tr> 121 + <% } %>
174 - <% } %> 122 + <tr>
175 - <tr> 123 + <th>
176 - <th><%= list[webtoon].week %></th> 124 + <% = list[webtoon].week %>
177 - <% } %> 125 + </th>
178 - <% 126 + <% } %>
179 - if(list[webtoon].site == 'naver') 127 + <%
180 - { 128 + if(list[webtoon].site == 'daum'){
181 - %> 129 + %>
182 <td> 130 <td>
183 - <a href="<%= list[webtoon].webtoon_link %>">
184 - <img alt="img" width="83" height="90" src="<%= list[webtoon].thum_link %>"/>
185 - </a>
186 - <%= list[webtoon].name %>
187 - </td>
188 - <%
189 - }
190 - %>
191 -
192 - <%
193 - if(current!=list[webtoon].week) {
194 - current = list[webtoon].week;
195 - %>
196 -
197 - <%
198 - }
199 - }
200 - %>
201 - </tr>
202 - </table>
203 - </br>
204 -
205 - </div>
206 -
207 -
208 - <font size = 30>
209 - 투믹스 웹툰
210 -</font>
211 -<a onclick="Naver_webtoons.style.display=(Naver_webtoons.style.display=='none')?'block':'none';" href="javascript:void(0)">
212 - <img src ='https://is4-ssl.mzstatic.com/image/thumb/Purple128/v4/d9/c7/99/d9c79934-4e9a-4926-fa53-b4863bae52b4/source/512x512bb.jpg' width="83" height="90"/>
213 -</a>
214 -<div id="toomiks" style = "display:none">
215 -
216 - <table>
217 - <%
218 - var current = "";
219 - for(webtoon in list){
220 -
221 - if(current!=list[webtoon].week && list[webtoon].site == 'toomiks'){
222 - if(current!=""){
223 - %>
224 - </tr>
225 - <% } %>
226 - <tr>
227 - <th><%= list[webtoon].week %></th>
228 - <% } %>
229 - <%
230 - if(list[webtoon].site == 'toomiks')
231 - {
232 - %>
233 - <td>
234 <a href="<%= list[webtoon].webtoon_link %>"> 131 <a href="<%= list[webtoon].webtoon_link %>">
235 - <img alt="img" width="83" height="90" src="<%= list[webtoon].thum_link %>"/> 132 + <img alt="img" width="83" height="90" src="<%= list[webtoon].thum_link %>"/>
236 </a> 133 </a>
237 - <%= list[webtoon].name %> 134 + <% = list[webtoon].name %>
238 - </td> 135 + </td>
239 - <% 136 + <% } %>
240 - } 137 +
241 - %> 138 + <% if(current!=list[webtoon].week){
242 - 139 + current = list[webtoon].week;
243 - <% 140 + }
244 - if(current!=list[webtoon].week) { 141 + }
245 - current = list[webtoon].week; 142 + %>
246 - %> 143 + </tr>
247 - 144 + </table>
248 - <% 145 + </div>
249 - } 146 +
250 - } 147 + <font size = 30>
251 - %> 148 + 네이버 웹툰
252 - </tr> 149 + </font>
253 - </table> 150 + <a onclick="Naver_webtoons.style.display=(Naver_webtoons.style.display=='none')?'block':'none';" href="javascript:void(0)">
254 - </br> 151 + <img src ='/images/navericon.png' width="90" height="90"/>
152 + </a>
153 +
154 + <div id="Naver_webtoons" style = "display:none">
155 + <table>
156 + <%
157 + var current = "";
158 + for(webtoon in list){
159 +
160 + if(current!=list[webtoon].week && list[webtoon].site == 'naver'){
161 + if(current!=""){
162 + %>
163 + </tr>
164 + <% } %>
165 + <tr>
166 + <th><%= list[webtoon].week %></th>
167 + <% } %>
168 + <%
169 + if(list[webtoon].site == 'naver')
170 + {
171 + %>
172 + <td>
173 + <a href="<%= list[webtoon].webtoon_link %>">
174 + <img alt="img" width="83" height="90" src="<%= list[webtoon].thum_link %>"/>
175 + </a>
176 + <%= list[webtoon].name %>
177 + </td>
178 + <%
179 + }
180 + %>
181 +
182 + <%
183 + if(current!=list[webtoon].week) {
184 + current = list[webtoon].week;
185 + %>
186 +
187 + <%
188 + }
189 + }
190 + %>
191 + </tr>
192 + </table>
193 + </div>
194 +
195 + <font size = 30>
196 + 레진 웹툰
197 + </font>
198 + <a onclick="Lezhin_webtoons.style.display=(Lezhin_webtoons.style.display=='none')?'block':'none';" href="javascript:void(0)">
199 + <img src ='/images/lezhinicon.png' width="90" height="90"/>
200 + </a>
201 +
202 + <div id="Lezhin_webtoons" style = "display:none">
203 + <table>
204 + <%
205 + var current = "";
206 + for(webtoon in list){
207 + if(current!=list[webtoon].week && list[webtoon].site == 'naver'){
208 + if(current!=""){
209 + %>
210 + </tr>
211 + <% } %>
212 + <tr>
213 + <th><%= list[webtoon].week %></th>
214 + <% } %>
215 + <%
216 + if(list[webtoon].site == 'naver')
217 + {
218 + %>
219 + <td>
220 + <a href="<%= list[webtoon].webtoon_link %>">
221 + <img alt="img" width="83" height="90" src="<%= list[webtoon].thum_link %>"/>
222 + </a>
223 + <%= list[webtoon].name %>
224 + </td>
225 + <%
226 + }
227 + %>
228 +
229 + <%
230 + if(current!=list[webtoon].week) {
231 + current = list[webtoon].week;
232 + }
233 + }
234 + %>
235 + </tr>
236 + </table>
237 + </div>
238 + </ul>
255 239
256 -</div> 240 + </div>
241 + </div>
242 + </div>
243 + </div>
257 </body> 244 </body>
258 -
259 </html> 245 </html>
......
1 <!DOCTYPE html> 1 <!DOCTYPE html>
2 <html> 2 <html>
3 -<head> 3 + <head>
4 <title>내툰</title> 4 <title>내툰</title>
5 <link rel='stylesheet' href='/stylesheets/style2.css' /> 5 <link rel='stylesheet' href='/stylesheets/style2.css' />
6 +
6 <<!-- Bootstrap --> 7 <<!-- Bootstrap -->
7 <link rel="stylesheet" type="text/css" href="/stylesheets/bootstrap.css"> 8 <link rel="stylesheet" type="text/css" href="/stylesheets/bootstrap.css">
8 <link rel="stylesheet" type="text/css" href="/stylesheets/font-awesome.css"> 9 <link rel="stylesheet" type="text/css" href="/stylesheets/font-awesome.css">
9 10
10 - <!-- Stylesheet 11 + <!-- Stylesheet================================================== -->
11 - ================================================== -->
12 <link rel="stylesheet" type="text/css" href="/stylesheets/style.css"> 12 <link rel="stylesheet" type="text/css" href="/stylesheets/style.css">
13 <link rel="stylesheet" type="text/css" href="/stylesheets/nivo-lightbox/nivo-lightbox.css"> 13 <link rel="stylesheet" type="text/css" href="/stylesheets/nivo-lightbox/nivo-lightbox.css">
14 <link rel="stylesheet" type="text/css" href="/stylesheets/nivo-lightbox/default.css"> 14 <link rel="stylesheet" type="text/css" href="/stylesheets/nivo-lightbox/default.css">
...@@ -16,191 +16,153 @@ ...@@ -16,191 +16,153 @@
16 <link href="https://fonts.googleapis.com/css?family=Open+Sans:300,400,600,700" rel="stylesheet"> 16 <link href="https://fonts.googleapis.com/css?family=Open+Sans:300,400,600,700" rel="stylesheet">
17 <link href="https://fonts.googleapis.com/css?family=Dancing+Script:400,700" rel="stylesheet"> 17 <link href="https://fonts.googleapis.com/css?family=Dancing+Script:400,700" rel="stylesheet">
18 <link href="https://fonts.googleapis.com/css?family=Gugi&amp;subset=korean" rel="stylesheet"> 18 <link href="https://fonts.googleapis.com/css?family=Gugi&amp;subset=korean" rel="stylesheet">
19 - <!--===============================================================================================-->
20 19
21 - <!--===============================================================================================-->
22 <link rel="stylesheet" type="text/css" href="fonts/font-awesome-4.7.0/css/font-awesome.min.css"> 20 <link rel="stylesheet" type="text/css" href="fonts/font-awesome-4.7.0/css/font-awesome.min.css">
23 - <!--===============================================================================================-->
24 <link rel="stylesheet" type="text/css" href="vendor/animate/animate.css"> 21 <link rel="stylesheet" type="text/css" href="vendor/animate/animate.css">
25 - <!--===============================================================================================-->
26 <link rel="stylesheet" type="text/css" href="vendor/select2/select2.min.css"> 22 <link rel="stylesheet" type="text/css" href="vendor/select2/select2.min.css">
27 - <!--===============================================================================================-->
28 <link rel="stylesheet" type="text/css" href="vendor/perfect-scrollbar/perfect-scrollbar.css"> 23 <link rel="stylesheet" type="text/css" href="vendor/perfect-scrollbar/perfect-scrollbar.css">
29 - <!--===============================================================================================-->
30 <link rel="stylesheet" type="text/css" href="stylesheets/util.css"> 24 <link rel="stylesheet" type="text/css" href="stylesheets/util.css">
31 <link rel="stylesheet" type="text/css" href="stylesheets/main.css"> 25 <link rel="stylesheet" type="text/css" href="stylesheets/main.css">
32 - <!--===============================================================================================--> 26 + </head>
33 - <!-- HTML5 shim and Respond.js for IE8 support of HTML5 elements and media queries -->
34 - <!-- WARNING: Respond.js doesn't work if you view the page via file:// -->
35 - <!--[if lt IE 9]>
36 - <script src="https://oss.maxcdn.com/html5shiv/3.7.2/html5shiv.min.js"></script>
37 - <script src="https://oss.maxcdn.com/respond/1.4.2/respond.min.js"></script>
38 - <![endif]-->
39 - <!--
40 - <style>
41 - .toon_name,.toon_thumbnail{
42 - width:10%;
43 - }
44 -
45 - td{
46 - vertical-align: middle;
47 - border-bottom: 1px solid #bcbcbc;
48 - border-left: 1px solid #bcbcbc;
49 - border-right: 1px solid #bcbcbc;
50 - margin:0;
51 - Text-align:center;
52 - }
53 - table{
54 - border-collapse:collapse;
55 - border: 2px solid #474747;
56 - }
57 - th{
58 - border-bottom:2px solid #474747;
59 - }
60 - </style>
61 --->
62 -</head>
63 -
64 27
28 + <body id="page-top" data-spy="scroll" data-target=".navbar-fixed-top">
65 29
66 -<body id="page-top" data-spy="scroll" data-target=".navbar-fixed-top"> 30 + <!-- Navigation==========================================-->
67 -<!-- Navigation
68 - ==========================================-->
69 <div class="nabvar"> 31 <div class="nabvar">
70 <nav id="menu" class="navbar navbar-default navbar-fixed-top"> 32 <nav id="menu" class="navbar navbar-default navbar-fixed-top">
71 - <div class="container"> 33 + <div class="container">
72 - <!-- Brand and toggle get grouped for better mobile display --> 34 +
73 - <div class="navbar-header"> 35 + <!-- Brand and toggle get grouped for better mobile display -->
74 - <button type="button" class="navbar-toggle collapsed" data-toggle="collapse" data-target="#bs-example-navbar-collapse-1"> <span class="sr-only">Toggle navigation</span> <span class="icon-bar"></span> <span class="icon-bar"></span> <span class="icon-bar"></span> </button> 36 + <div class="navbar-header">
75 - <a class="navbar-brand page-scroll" href="#page-top" style="font-family:Gugi">내툰</a> </div> 37 + <button type="button" class="navbar-toggle collapsed" data-toggle="collapse" data-target="#bs-example-navbar-collapse-1"> <span class="sr-only">Toggle navigation</span> <span class="icon-bar"></span> <span class="icon-bar"></span> <span class="icon-bar"></span> </button>
76 - <!-- Collect the nav links, forms, and other content for toggling --> 38 + <a class="navbar-brand page-scroll" href="#page-top" style="font-family:Gugi">내툰</a>
77 - <div class="collapse navbar-collapse" id="bs-example-navbar-collapse-1">
78 - <ul class="nav navbar-nav navbar-right">
79 - <li><a href="#mylist" class="page-scroll">MyList</a></li>
80 - <li><a href="/setting/"><!--<img src = "/images/basket.png" height="50" witdh="50">-->웹툰 담기</a>
81 - <li><a href="/yourtoons/">OtherList</a>
82 - <li><a href="/auth/logout/kakao" class="page-scroll">Logout</a></li>
83 - </ul>
84 - </div>
85 - <!-- /.navbar-collapse -->
86 </div> 39 </div>
87 - </nav> 40 +
88 - </div> 41 + <!-- Collect the nav links, forms, and other content for toggling -->
89 -<div id="mylist"> 42 + <div class="collapse navbar-collapse" id="bs-example-navbar-collapse-1">
90 - <div class="section-title text-center center"> 43 + <ul class="nav navbar-nav navbar-right">
91 - <div class="overlay"> 44 + <li><a href="#mylist" class="page-scroll">MyList</a></li>
92 - <h2>내툰</h2> 45 + <li><a href="/setting/"><!--<img src = "/images/basket.png" height="50" witdh="50">-->웹툰 담기</a>
93 - <hr> 46 + <li><a href="/yourtoons/">OtherList</a>
94 - <p>웹툰 담기를 통해 담은 웹툰들의 리스트입니다</p> 47 + <li><a href="/auth/logout/kakao" class="page-scroll">Logout</a></li>
48 + </ul>
49 + </div>
50 + <!-- /.navbar-collapse -->
95 </div> 51 </div>
52 + </nav>
96 </div> 53 </div>
97 - <div class="container">
98 - <div class="row">
99 - <div class="categories">
100 - <div class="limiter">
101 - <div class="container-table100">
102 - <div class="wrap-table100">
103 - <div class="table100 ver1 m-b-110">
104 - <div class="table100-head">
105 - <table>
106 - <thead>
107 - <tr class="row100 head">
108 - <th class="cell100 column1">썸네일 </th>
109 - <th class="cell100 column2">웹툰명 </th>
110 - <th class="cell100 column3">요일 </th>
111 - <th class="cell100 column4">사이트 </th>
112 - <th class="cell100 column5">바로가기 </th>
113 - <th class="cell100 column6">오늘 업데이트됨 </th>
114 - </tr>
115 - </thead>
116 - </table>
117 - </div>
118 - <div class ="table100-body js-pscroll">
119 - <table>
120 - <%if (mytoons.length==0){
121 - %>
122 - <th>내툰리스트에 웹툰이 없습니다! 수정하기 버튼을 눌러서 추가하세요!</th>
123 - <%}%>
124 - <% for(i=0;i
125 - <mytoons.length; i++){
126 - %>
127 - <tr>
128 - <td class="cell100 column1"><image src="<%= mytoons[i].thum_link%>" /></td>
129 - <td class="cell100 column2"><%= mytoons[i].name %></td>
130 - <td class="cell100 column3"><%= mytoons[i].week.toLowerCase() %></td>
131 - <td class="cell100 column4"><%= mytoons[i].site %></td>
132 - <td class="cell100 column5"><a href="<%=mytoons[i].webtoon_link%>">바로가기</a></td>
133 - <td class="cell100 column6">
134 - <% var d = new Date();
135 - if(d.getDay() == 0 && mytoons[i].week == "sun")
136 - { %>업데이트됨
137 - <%} %>
138 - <%
139 - if(d.getDay() == 0 && mytoons[i].week == "SUN")
140 - { %>업데이트됨
141 - <%} %>
142 - <%
143 - if(d.getDay() == 1 && mytoons[i].week == "mon")
144 - { %>업데이트됨
145 - <%} %>
146 - <%
147 - if(d.getDay() == 1 && mytoons[i].week == "MON")
148 - { %>업데이트됨
149 - <%} %>
150 - <%
151 - if(d.getDay() == 2 && mytoons[i].week == "tue")
152 - { %>업데이트됨
153 - <%} %>
154 - <%
155 - if(d.getDay() == 2 && mytoons[i].week == "TUE")
156 - { %>업데이트됨
157 - <%} %>
158 - <%
159 - if(d.getDay() == 3 && mytoons[i].week == "wed")
160 - { %>업데이트됨
161 - <%} %>
162 - <%
163 - if(d.getDay() == 3 && mytoons[i].week == "WED")
164 - { %>업데이트됨
165 - <%} %>
166 - <%
167 - if(d.getDay() == 4 && mytoons[i].week == "thu")
168 - { %>업데이트됨
169 - <%} %>
170 - <%
171 - if(d.getDay() == 4 && mytoons[i].week == "THU")
172 - { %>업데이트됨
173 - <%} %>
174 - <%
175 - if(d.getDay() == 5 && mytoons[i].week == "fri")
176 - { %>업데이트됨
177 - <%} %>
178 - <%
179 - if(d.getDay() == 5 && mytoons[i].week == "FRI")
180 - { %>업데이트됨
181 - <%} %>
182 - <%
183 - if(d.getDay() == 6 && mytoons[i].week == "sat")
184 - { %>업데이트됨
185 - <%} %>
186 - <%
187 - if(d.getDay() == 6 && mytoons[i].week == "SAT")
188 - { %>업데이트됨
189 - <%} %>
190 - </td>
191 54
192 - </tr> 55 + <div id="mylist">
193 - <% } %> 56 + <div class="section-title text-center center">
194 - </table> 57 + <div class="overlay">
58 + <h2>내툰</h2>
59 + <hr><p>웹툰 담기를 통해 담은 웹툰들의 리스트입니다</p>
60 + </div>
61 + </div>
195 62
196 - </div> 63 + <div class="container">
64 + <div class="row">
65 + <div class="categories">
66 + <div class="limiter">
67 + <div class="container-table100">
68 + <div class="wrap-table100">
69 + <div class="table100 ver1 m-b-110">
70 + <div class="table100-head">
71 + <table>
72 + <thead>
73 + <tr class="row100 head">
74 + <th class="cell100 column1">썸네일 </th>
75 + <th class="cell100 column2">웹툰명 </th>
76 + <th class="cell100 column3">요일 </th>
77 + <th class="cell100 column4">사이트 </th>
78 + <th class="cell100 column5">바로가기 </th>
79 + <th class="cell100 column6">오늘 업데이트됨 </th>
80 + </tr>
81 + </thead>
82 + </table>
83 + </div>
197 84
198 -</br> 85 + <div class ="table100-body js-pscroll">
86 + <table>
87 + <%if(mytoons.length==0){ %>
88 + <th>내툰리스트에 웹툰이 없습니다! 수정하기 버튼을 눌러서 추가하세요!</th>
89 + <%}%>
90 + <% for(i=0;i<mytoons.length; i++){%>
91 + <tr>
92 + <td class="cell100 column1"><image src="<%= mytoons[i].thum_link%>" /></td>
93 + <td class="cell100 column2"><%= mytoons[i].name %></td>
94 + <td class="cell100 column3"><%= mytoons[i].week.toLowerCase() %></td>
95 + <td class="cell100 column4"><%= mytoons[i].site %></td>
96 + <td class="cell100 column5"><a href="<%=mytoons[i].webtoon_link%>">바로가기</a></td>
97 + <td class="cell100 column6">
98 + <% var d = new Date();
99 + if(d.getDay() == 0 && mytoons[i].week == "sun")
100 + { %>업데이트됨
101 + <%} %>
102 + <%
103 + if(d.getDay() == 0 && mytoons[i].week == "SUN")
104 + { %>업데이트됨
105 + <%} %>
106 + <%
107 + if(d.getDay() == 1 && mytoons[i].week == "mon")
108 + { %>업데이트됨
109 + <%} %>
110 + <%
111 + if(d.getDay() == 1 && mytoons[i].week == "MON")
112 + { %>업데이트됨
113 + <%} %>
114 + <%
115 + if(d.getDay() == 2 && mytoons[i].week == "tue")
116 + { %>업데이트됨
117 + <%} %>
118 + <%
119 + if(d.getDay() == 2 && mytoons[i].week == "TUE")
120 + { %>업데이트됨
121 + <%} %>
122 + <%
123 + if(d.getDay() == 3 && mytoons[i].week == "wed")
124 + { %>업데이트됨
125 + <%} %>
126 + <%
127 + if(d.getDay() == 3 && mytoons[i].week == "WED")
128 + { %>업데이트됨
129 + <%} %>
130 + <%
131 + if(d.getDay() == 4 && mytoons[i].week == "thu")
132 + { %>업데이트됨
133 + <%} %>
134 + <%
135 + if(d.getDay() == 4 && mytoons[i].week == "THU")
136 + { %>업데이트됨
137 + <%} %>
138 + <%
139 + if(d.getDay() == 5 && mytoons[i].week == "fri")
140 + { %>업데이트됨
141 + <%} %>
142 + <%
143 + if(d.getDay() == 5 && mytoons[i].week == "FRI")
144 + { %>업데이트됨
145 + <%} %>
146 + <%
147 + if(d.getDay() == 6 && mytoons[i].week == "sat")
148 + { %>업데이트됨
149 + <%} %>
150 + <%
151 + if(d.getDay() == 6 && mytoons[i].week == "SAT")
152 + { %>업데이트됨
153 + <%} %>
154 + </td>
155 + </tr>
156 + <% } %>
157 + </table>
158 + </div></br>
159 + </div>
160 + </div>
161 + </div>
199 </div> 162 </div>
163 + </div>
200 </div> 164 </div>
165 + </div>
201 </div> 166 </div>
202 -</div> 167 + </body>
203 -
204 -</body>
205 -
206 </html> 168 </html>
......