1const sections = document.body.querySelectorAll("main section"); 2const header = document.body.querySelector("header"); 3const footer = document.body.querySelector("footer"); 4const aside = document.body.querySelector("aside"); 5 6 7 8// index 9 10 11const Index = function(){} 12 13Index.prototype.load_function = function() { 14 15 16// ë°°ë 1 ì ëë©ì´ì 17Index.prototype.run_banner1_anim = function() { 18 this.back_banner2_anim(); 19 this.back_banner3_anim(); 20 let span = document.querySelectorAll(".banner .banner-1 h2 > strong > span"); 21 Array.prototype.forEach.call(span, function(k, v) { 22 k.classList.add('anim-slideUp'); 23 }); 24 let span2 = document.querySelectorAll(".banner .banner-1 h3 > strong > span"); 25 Array.prototype.forEach.call(span2, function(k, v) { 26 k.classList.add('anim-slideUp'); 27 }); 28 let strong = document.querySelectorAll(".banner .banner-1 h2 strong span strong"); 29 Array.prototype.forEach.call(strong, function(k, v) { 30 k.classList.add('active'); 31 }); 32 let button_span = document.querySelector(".banner .banner-1 .detail-button span"); 33 button_span.classList.add('anim-slideUp'); 34} 35Index.prototype.back_banner1_anim = function() { 36 let span = document.querySelectorAll(".banner .banner-1 h2 > strong > span"); 37 Array.prototype.forEach.call(span, function(k, v) { 38 k.classList.remove('anim-slideUp'); 39 }); 40 let span2 = document.querySelectorAll(".banner .banner-1 h3 > strong > span"); 41 Array.prototype.forEach.call(span2, function(k, v) { 42 k.classList.remove('anim-slideUp'); 43 }); 44 let strong = document.querySelectorAll(".banner .banner-1 h2 strong"); 45 Array.prototype.forEach.call(strong, function(k, v) { 46 k.classList.remove('active'); 47 }); 48 let button_span = document.querySelector(".banner .banner-1 .detail-button span"); 49 button_span.classList.remove('anim-slideUp'); 50} 51 52// ë°°ë 2 ì ëë©ì´ì 53Index.prototype.run_banner2_anim = function() { 54 this.back_banner1_anim(); 55 this.back_banner3_anim(); 56 let span = document.querySelectorAll(".banner .banner-2 .left strong span"); 57 Array.prototype.forEach.call(span, function(k, v) { 58 k.classList.add('anim-slideUp'); 59 }); 60 let strong = document.querySelectorAll(".banner .banner-2 .left strong span strong"); 61 Array.prototype.forEach.call(strong, function(k, v) { 62 k.classList.add('active'); 63 }); 64 let h2 = document.querySelector(".banner .banner-2 .right h2"); 65 h2.classList.add('anim-fadeIn'); 66 let h2_strong = document.querySelector(".banner .banner-2 .right h2 strong"); 67 h2_strong.classList.add('active'); 68 let li = document.querySelectorAll(".banner .banner-2 .right li"); 69 Array.prototype.forEach.call(li, function(k, v) { 70 k.classList.add('anim-fadeIn'); 71 }); 72 let button_span = document.querySelector(".banner .banner-2 .detail-button span"); 73 button_span.classList.add('anim-slideUp'); 74} 75Index.prototype.back_banner2_anim = function() { 76 let span = document.querySelectorAll(".banner .banner-2 .left strong span"); 77 Array.prototype.forEach.call(span, function(k, v) { 78 k.classList.remove('anim-slideUp'); 79 }); 80 let strong = document.querySelectorAll(".banner .banner-2 .left strong"); 81 Array.prototype.forEach.call(strong, function(k, v) { 82 k.classList.remove('active'); 83 }); 84 let h2 = document.querySelector(".banner .banner-2 .right h2"); 85 h2.classList.remove('anim-fadeIn'); 86 let h2_strong = document.querySelector(".banner .banner-2 .right h2 strong"); 87 h2_strong.classList.remove('active'); 88 let li = document.querySelectorAll(".banner .banner-2 .right li"); 89 Array.prototype.forEach.call(li, function(k, v) { 90 k.classList.remove('anim-fadeIn'); 91 }); 92 let button_span = document.querySelector(".banner .banner-2 .detail-button span"); 93 button_span.classList.remove('anim-slideUp'); 94} 95 96// ë°°ë 3 ì ëë©ì´ì 97Index.prototype.run_banner3_anim = function() { 98 this.back_banner1_anim(); 99 this.back_banner2_anim(); 100 let span = document.querySelectorAll(".banner .banner-3 h2 strong span"); 101 Array.prototype.forEach.call(span, function(k, v) { 102 k.classList.add('anim-slideUp'); 103 }); 104 let button_span = document.querySelectorAll(".banner .banner-3 .detail-button span");
105 Array.prototype.forEach.call(button_span, function(k, v) { 106 k.classList.add('anim-slideUp'); 107 }); 108 let box = document.querySelectorAll(".banner .banner-3 .box"); 109 Array.prototype.forEach.call(box, function(k, v) { 110 k.classList.add('anim-fadeInUp'); 111 }); 112} 113Index.prototype.back_banner3_anim = function() { 114 let span = document.querySelectorAll(".banner .banner-3 h2 strong span"); 115 Array.prototype.forEach.call(span, function(k, v) { 116 k.classList.remove('anim-slideUp'); 117 }); 118 let button_span = document.querySelectorAll(".banner .banner-3 .detail-button span"); 119 Array.prototype.forEach.call(button_span, function(k, v) { 120 k.classList.remove('anim-slideUp'); 121 }); 122 let box = document.querySelectorAll(".banner .banner-3 .box"); 123 Array.prototype.forEach.call(box, function(k, v) { 124 k.classList.remove('anim-fadeInUp'); 125 }); 126} 127 128// Page1 ì ëë©ì´ì 129 130Index.prototype.page1_loaded = false; 131Index.prototype.run_page1_anim = function() { 132 if(page1_loaded === true) 133 return; 134 page1_loaded = true; 135 let span = document.querySelectorAll(".page1 h2 strong span"); 136 Array.prototype.forEach.call(span, function(k, v) { 137 k.classList.add('anim-slideUp'); 138 }); 139} 140 141 142 143// Slide 144 145Index.prototype.slide_wrap = document.querySelector(".slide-wrap"); 146Index.prototype.slide_wrap.style.width = document.body.clientWidth; 147Index.prototype.slide_width = Index.prototype.slide_wrap.clientWidth; 148Index.prototype.slide_items = document.querySelectorAll(".slide-item"); 149Index.prototype.max_slide = Index.prototype.slide_items.length; 150Index.prototype.slide_nav_wrap = document.querySelector(".slide-nav-wrap"); 151for(let i = 0; i < Index.prototype.max_slide; i++) { 152 Index.prototype.slide_nav_wrap.innerHTML += "<div class='slide-nav-item'></div>"; 153} 154Index.prototype.slide_nav_items = document.querySelectorAll(".slide-nav-item"); 155for(let i = 0; i < Index.prototype.max_slide; i++) { 156 Index.prototype.slide_nav_items[i].addEventListener("click", (function() { 157 this.slide_slide(i); 158 }).bind(this)); 159} 160 161Index.prototype.current_slide = 0; 162 163Index.prototype.is_sliding = false; 164Index.prototype.slide_slide = function(n) { 165 if(this.is_sliding === true) 166 return; 167 this.is_sliding = true; 168 let before = this.current_slide; 169 this.current_slide = n; 170 if(this.current_slide >
170= this.max_slide || this.current_slide < 0) { 171 this.current_slide = 0; 172 } 173 this.slide_width = Math.max(document.documentElement.clientWidth, window.innerWidth); 174 const offset = this.current_slide * 100; 175 Array.prototype.forEach.call(this.slide_items, function(k, v){ 176 k.setAttribute("style", "left: " + (-offset) + "%"); 177 }); 178 this.slide_nav_items[before].style.backgroundColor = "#B1B1B1"; 179 this.slide_nav_items[this.current_slide].style.backgroundColor = "#ffffff"; 180 if(this.current_slide === 0) 181 this.run_banner1_anim(); 182 else if(this.current_slide === 1) 183 this.run_banner2_anim(); 184 else if(this.current_slide === 2) 185 this.run_banner3_anim(); 186 this.is_sliding = false; 187} 188 189 190 191Index.prototype.slide_slide(0); 192Index.prototype.slide_auto = setInterval((function() { 193 let next = this.current_slide + 1; 194 if(next >= this.max_slide) 195 next = 0; 196 this.slide_slide(next); 197}).bind(this), 10000); 198 199 200 201/* ì¤í¬ë¡¤ ì´ë²¤í¸ */ 202 203 204Index.prototype.current_page = 0; 205Index.prototype.scroll_function = function() {
206 let current_scroll_top = document.documentElement.scrollTop; 207 let page_before = this.current_page; 208 if(document.body.clientWidth < 864 || window.innerHeight < 750) { 209 if(sections[1].getBoundingClientRect().y - window.innerHeight > 0) { 210 this.current_page = 0; 211 } else if(sections[2].getBoundingClientRect().y - window.innerHeight > 0) { 212 this.current_page = 1; 213 } else if(sections[3].getBoundingClientRect().y - window.innerHeight > 0) { 214 this.current_page = 2; 215 } else { 216 this.current_page = 3; 217 } 218 } else { 219 if(current_scroll_top < 101) { 220 this.current_page = 0; 221 } else if(current_scroll_top < 1001) { 222 this.current_page = 1; 223 } else if(current_scroll_top < 1901) { 224 this.current_page = 2; 225 } else { 226 this.current_page = 3; 227 } 228 } 229 if(page_before !== this.current_page) { 230 if(document.body.clientWidth < 864) { 231 if(this.current_page == 0) { 232 this.slide_slide(this.current_slide + 1); 233 if(this.slide_auto) 234 clearInterval(this.slide_auto); 235 slide_auto = setInterval((function() { 236 let next = this.current_slide + 1; 237 if(next >= this.max_slide) 238 next = 0; 239 this.slide_slide(next); 240 }).bind(this), 10000); 241 } 242 } else { 243 if(this.current_page > 0) { 244 this.back_banner1_anim(); 245 this.back_banner2_anim(); 246 this.back_banner3_anim(); 247 if(this.slide_auto) 248 clearInterval(this.slide_auto); 249 } else { 250 this.slide_slide(this.current_slide); 251 if(this.slide_auto) 252 clearInterval(this.slide_auto); 253 slide_auto = setInterval((function() { 254 let next = this.current_slide + 1; 255 if(next >= this.max_slide) 256 next = 0; 257 this.slide_slide(next); 258 }).bind(this), 10000); 259 } 260 } 261 if(this.current_page == 0) { 262 if(header) 263 header.classList.add("white"); 264 } else { 265 if(header) 266 header.classList.remove("white"); 267 } 268 Array.prototype.forEach.call(sections, (function(k, v){ 269 if(v > this.current_page) { 270 k.classList.remove("active"); 271 k.classList.remove("up"); 272 } 273 else if(v == this.current_page) { 274 k.classList.add("active"); 275 k.classList.remove("up"); 276 } 277 else if(v < this.current_page) { 278 k.classList.add("active"); 279 k.classList.add("up"); 280 } 281 }).bind(this)); 282 } 283 if(window.pageYOffset + window.innerHeight >= document.body.scrollHeight - footer.clientHeight) { 284 if(document.body.clientWidth >= 864) { 285 document.body.querySelector(".page3 article").style.top = (-(window.pageYOffset + window.innerHeight - document.body.scrollHeight + footer.clientHeight)) + "px"; 286 document.body.querySelector(".page3 article").style.transition = "all 0s ease-in-out"; 287 } else { 288 document.body.querySelector(".page3 article").style.top = "0"; 289 document.body.querySelector(".page3 article").style.transition = ""; 290 } 291 } else { 292 document.body.querySelector(".page3 article").style.top = "0"; 293 document.body.querySelector(".page3 article").style.transition = ""; 294 } 295} 296 297Index.prototype.window_width = document.body.clientWidth; 298Index.prototype.resize_function = function(e) { 299 if(document.body.clientWidth !== this.window_width) { 300 this.window_width = document.body.clientWidth; 301 this.slide_slide(this.current_slide); //ì¬ë¼ì´ë ë°°ë ì´ë 302 document.body.querySelector(".banner .slide-item .banner-1").style.height = window.innerHeight + "px"; 303 document.body.querySelector(".banner .slide-item .banner-2").style.height = window.innerHeight + "px"; 304 document.body.querySelector(".banner .slide-item .banner-3").style.height = window.innerHeight + "px"; 305 } 306} 307 308Index.prototype.add_event = function() { 309 document.addEventListener('scroll', Index.prototype.scroll_function.bind(this)); 310 window.addEventListener("resize", Index.prototype.resize_function.bind(this)) 311} 312 313 314 315/* 견ì 문ì Form */ 316Index.prototype.check_submit = function() { 317 if(!document.getElementById("form-company").value?.trim()?.length) { 318 alert("íì¬ëª ì ì ë ¥í´ ì£¼ì¸ì."); 319 return; 320 } 321 322 if(!document.getElementById("form-tel").value?.trim()?.length) { 323 alert("ì íë²í¸ë¥¼ ì ë ¥í´ ì£¼ì¸ì."); 324 return; 325 } 326 327 if(!document.getElementById("form-agent").value?.trim()?.length) { 328 alert("ë´ë¹ìëª ì ì ë ¥í´ ì£¼ì¸ì."); 329 return; 330 } 331 332 if(!document.getElementById("form-email").value?.trim()?.length) { 333 alert("ì´ë©ì¼ì ì ë ¥í´ ì£¼ì¸ì."); 334 return; 335 } 336 337 if(!document.getElementById("form-url").value?.trim()?.length) { 338 alert("í매 URLì ì ë ¥í´ ì£¼ì¸ì."); 339 return; 340 } 341 342 let visit_value = null; 343 if(document.getElementById("form-visit-search").checked) { 344 visit_value = document.getElementById("form-visit-search").value; 345 } 346 else if(document.getElementById("form-visit-facebook").checked) { 347 visit_value = document.getElementById("form-visit-facebook").value; 348 }
349 else if(document.getElementById("form-visit-blog").checked) { 350 visit_value = document.getElementById("form-visit-blog").value; 351 } 352 else if(document.getElementById("form-visit-news").checked) { 353 visit_value = document.getElementById("form-visit-news").value; 354 } 355 else if(document.getElementById("form-visit-acquaintance").checked) { 356 visit_value = document.getElementById("form-visit-acquaintance").value; 357 } 358 else if(document.getElementById("form-visit-etc").checked) { 359 visit_value = document.getElementById("form-visit-etc").value; 360 } 361 else if(document.getElementById("form-visit-shopling").checked) { 362 visit_value = document.getElementById("form-visit-shopling").value; 363 } 364 if(!visit_value) { 365 alert("방문 ê²½ë¡ë¥¼ ì ë ¥í´ ì£¼ì¸ì."); 366 return false; 367 } 368 369 if(!document.getElementById("form-item").value?.trim()?.length) { 370 alert("ìíì í목ì ì ë ¥í´ ì£¼ì¸ì."); 371 return; 372 } 373 374 if(!document.getElementById("form-kind").value?.trim()?.length) { 375 alert("ìíì íì¢ ì를 ì ë ¥í´ ì£¼ì¸ì."); 376 return; 377 } 378 379 if(!document.getElementById("form-delivery").value?.trim()?.length) { 380 alert("ì íë°° ê±´ì를 ì ë ¥í´ ì£¼ì¸ì."); 381 return; 382 } 383 384 if(!document.getElementById("form-private").checked) { 385 alert("ê°ì¸ì ë³´ ìì§ ë° ì´ì©ì ëì íì ì¼ ë¬¸ìì ìê° ê°ë¥í©ëë¤."); 386 return; 387 } 388 389 // ì¬ê¸°ìì form ìë²ë¡ ë³´ë´ê¸° 390 391 alert("견ì 문ìê° ì ìëììµëë¤. íì¸ í ëµë³ëë¦¬ê² ìµëë¤."); 392} 393 394 395 396/* ê°ì¸ì ë³´ ìì§ì½ê´ */ 397 398Index.prototype.open_private_terms = function() { 399 const modal = document.getElementById("private-terms"); 400 modal.style.display = 'flex'; 401 document.body.style.overflowY = 'hidden'; 402} 403 404Index.prototype.close_private_terms = function() { 405 const modal = document.getElementById("private-terms"); 406 modal.style.display = 'none'; 407 document.body.style.overflowY = 'auto'; 408} 409 410 411 document.body.querySelector("#private-terms .modal").addEventListener("click", function(e) { 412 e.stopPropagation(); 413 }) 414 415 document.body.querySelector("#private-terms .modal a").addEventListener("click", (function(e) { 416 this.close_private_terms(); 417 }).bind(this)) 418 419 document.getElementById("private-terms").addEventListener("click", (function() { 420 this.close_private_terms(); 421 }).bind(this)) 422 423 document.body.querySelector(".banner .slide-item .banner-1").style.height = window.innerHeight + "px"; 424 document.body.querySelector(".banner .slide-item .banner-2").style.height = window.innerHeight + "px"; 425 document.body.querySelector(".banner .slide-item .banner-3").style.height = window.innerHeight + "px"; 426} 427 428 429 430 431 432 433 434// 견ì 문ì íì´ì§ 435 436 437const Estimation = function(){} 438 439Estimation.prototype.load_function = function() { 440 441 442/* 견ì 문ì Form */ 443Estimation.prototype.check_submit = function() { 444 if(!document.getElementById("form-company").value?.trim()?.length) { 445 alert("íì¬ëª ì ì ë ¥í´ ì£¼ì¸ì."); 446 return; 447 } 448 449 if(!document.getElementById("form-phone-first").value?.trim()?.length) { 450 alert("ì°ë½ì²ë¥¼ ì ë ¥í´ ì£¼ì¸ì."); 451 return; 452 } 453 if(!document.getElementById("form-phone-middle").value?.trim()?.length) { 454 alert("ì°ë½ì²ë¥¼ ì ë ¥í´ ì£¼ì¸ì."); 455 return; 456 } 457 if(!document.getElementById("form-phone-last").value?.trim()?.length) { 458 alert("ì°ë½ì²ë¥¼ ì ë ¥í´ ì£¼ì¸ì."); 459 return; 460 } 461 462 if(!document.getElementById("form-agent").value?.trim()?.length) { 463 alert("ë´ë¹ìëª ì ì ë ¥í´ ì£¼ì¸ì."); 464 return; 465 } 466 467 if(!document.getElementById("form-email-first").value?.trim()?.length) { 468 alert("ì´ë©ì¼ì ì ë ¥í´ ì£¼ì¸ì."); 469 return; 470 } 471 if(!document.getElementById("form-email-last").value?.trim()?.length) { 472 alert("ì´ë©ì¼ì ì ë ¥í´ ì£¼ì¸ì."); 473 return; 474 } 475 476 if(!document.getElementById("form-url").value?.trim()?.length) { 477 alert("í매 URLì ì ë ¥í´ ì£¼ì¸ì."); 478 return; 479 } 480 481 let visit_value = null; 482 if(document.getElementById("form-visit-search").checked) { 483 visit_value = document.getElementById("form-visit-search").value; 484 } 485 else if(document.getElementById("form-visit-facebook").checked) { 486 visit_value = document.getElementById("form-visit-facebook").value; 487 }
488 else if(document.getElementById("form-visit-blog").checked) { 489 visit_value = document.getElementById("form-visit-blog").value; 490 } 491 else if(document.getElementById("form-visit-news").checked) { 492 visit_value = document.getElementById("form-visit-news").value; 493 } 494 else if(document.getElementById("form-visit-acquaintance").checked) { 495 visit_value = document.getElementById("form-visit-acquaintance").value; 496 } 497 else if(document.getElementById("form-visit-etc").checked) { 498 visit_value = document.getElementById("form-visit-etc").value; 499 } 500 else if(document.getElementById("form-visit-shopling").checked) { 501 visit_value = document.getElementById("form-visit-shopling").value; 502 } 503 if(!visit_value) { 504 alert("방문 ê²½ë¡ë¥¼ ì ë ¥í´ ì£¼ì¸ì."); 505 return false; 506 } 507 508 if(!document.getElementById("form-item").value?.trim()?.length) { 509 alert("ìíì í목ì ì ë ¥í´ ì£¼ì¸ì."); 510 return; 511 } 512 513 if(!document.getElementById("form-kind").value?.trim()?.length) { 514 alert("ìíì íì¢ ì를 ì ë ¥í´ ì£¼ì¸ì."); 515 return; 516 } 517 518 if(!document.getElementById("form-delivery").value?.trim()?.length) { 519 alert("ì íë°° ê±´ì를 ì ë ¥í´ ì£¼ì¸ì."); 520 return; 521 } 522 523 if(!document.getElementById("form-private").checked) { 524 alert("ê°ì¸ì ë³´ ìì§ ë° ì´ì©ì ëì íì ì¼ ë¬¸ìì ìê° ê°ë¥í©ëë¤."); 525 return; 526 } 527 528 // ì¬ê¸°ìì form ìë²ë¡ ë³´ë´ê¸° 529 530 alert("견ì 문ìê° ì ìëììµëë¤. íì¸ í ëµë³ëë¦¬ê² ìµëë¤."); 531} 532 533 534 535 536 537/* ê°ì¸ì ë³´ ìì§ì½ê´ */ 538 539document.body.querySelector("#private-terms .modal").addEventListener("click", function(e) { 540 e.stopPropagation(); 541}) 542 543document.body.querySelector("#private-terms .modal a").addEventListener("click", (function(e) { 544 this.close_private_terms(); 545}).bind(this)) 546 547document.getElementById("private-terms").addEventListener("click", (function() { 548 this.close_private_terms(); 549}).bind(this)) 550 551Estimation.prototype.open_private_terms = function() { 552 const modal = document.getElementById("private-terms"); 553 modal.style.display = 'flex'; 554 document.body.style.overflowY = 'hidden'; 555} 556 557Estimation.prototype.close_private_terms = function() { 558 const modal = document.getElementById("private-terms"); 559 modal.style.display = 'none'; 560 document.body.style.overflowY = 'auto'; 561} 562 563 564 565/* ì¤í¬ë¡¤ ì´ë²¤í¸ */ 566Estimation.prototype.scroll_function = function() { 567 if(window.pageYOffset + window.innerHeight >= document.body.scrollHeight - footer.clientHeight) { 568 if(document.body.clientWidth >= 864) { 569 document.body.querySelector(".page2 article").style.top = (-(window.pageYOffset + window.innerHeight - document.body.scrollHeight + footer.clientHeight)) + "px"; 570 document.body.querySelector(".page2 article").style.transition = "all 0s ease-in-out"; 571 } else { 572 document.body.querySelector(".page2 article").style.top = "0"; 573 document.body.querySelector(".page2 article").style.transition = ""; 574 } 575 } else { 576 document.body.querySelector(".page2 article").style.top = "0"; 577 document.body.querySelector(".page2 article").style.transition = ""; 578 } 579} 580 581Estimation.prototype.add_event = function() { 582 document.addEventListener('scroll', Estimation.prototype.scroll_function.bind(this)); 583} 584 585} 586 587 588 589//ì¼í몰ì ìí 590 591const Shop = function(){} 592 593Shop.prototype.load_function = function() { 594 595 596/* ì¤í¬ë¡¤ ì´ë²¤í¸ */ 597 598 599Shop.prototype.current_page = -1; 600Shop.prototype.scroll_function = function() {
601 let current_scroll_top = document.documentElement.scrollTop; 602 let page_before = this.current_page; 603 if(document.body.clientWidth < 864 || window.innerHeight < 750) { 604 if(sections[1].getBoundingClientRect().y - window.innerHeight > 0) { 605 this.current_page = 0; 606 } else if(sections[2].getBoundingClientRect().y - window.innerHeight > 0) { 607 this.current_page = 1; 608 } else if(sections[3].getBoundingClientRect().y - window.innerHeight > 0) { 609 this.current_page = 2; 610 } else if(sections[4].getBoundingClientRect().y - window.innerHeight > 0) { 611 this.current_page = 3; 612 } else if(sections[5].getBoundingClientRect().y - window.innerHeight > 0) { 613 this.current_page = 4; 614 } else { 615 this.current_page = 5; 616 } 617 } else { 618 if(current_scroll_top < 101) { 619 this.current_page = 0; 620 } else if(current_scroll_top < 1001) { 621 this.current_page = 1; 622 } else if(current_scroll_top < 1901) { 623 this.current_page = 2; 624 } else if(current_scroll_top < 2801) { 625 this.current_page = 3; 626 } else if(current_scroll_top < 3701) { 627 this.current_page = 4; 628 } else { 629 this.current_page = 5; 630 } 631 } 632 if(page_before !== this.current_page) { 633 if(this.current_page == 0) { 634 if(header) 635 header.classList.add("white"); 636 } else { 637 if(header) 638 header.classList.remove("white"); 639 } 640 Array.prototype.forEach.call(sections, (function(k, v){ 641 if(v > this.current_page) { 642 k.classList.remove("active"); 643 k.classList.remove("up"); 644 } 645 else if(v == this.current_page) { 646 k.classList.add("active"); 647 k.classList.remove("up"); 648 } 649 else if(v < this.current_page) { 650 k.classList.add("active"); 651 k.classList.add("up"); 652 } 653 }).bind(this)); 654 } 655 if(window.pageYOffset + window.innerHeight >= document.body.scrollHeight - footer.clientHeight) { 656 if(document.body.clientWidth >= 864) { 657 document.body.querySelector(".page5 article").style.top = (-(window.pageYOffset + window.innerHeight - document.body.scrollHeight + footer.clientHeight)) + "px"; 658 document.body.querySelector(".page5 article").style.transition = "all 0s ease-in-out"; 659 } else { 660 document.body.querySelector(".page5 article").style.top = "0"; 661 document.body.querySelector(".page5 article").style.transition = ""; 662 } 663 } else { 664 document.body.querySelector(".page5 article").style.top = "0"; 665 document.body.querySelector(".page5 article").style.transition = ""; 666 } 667} 668 669/*page4 ì¬ë¼ì´ë */ 670Shop.prototype.current_slide = 0; 671Shop.prototype.slide_items = document.body.querySelectorAll(".page4 .slide-item"); 672Shop.prototype.slide_buttons = document.body.querySelectorAll(".page4 .list > div > div"); 673Shop.prototype.mobile_slide_info_items = document.body.querySelectorAll(".page4 .mobile-list .info-slide > div"); 674Shop.prototype.mobile_slide_nav_wrap = document.body.querySelector(".page4 .mobile-list .list-nav > div"); 675Shop.prototype.mobile_slide_nav_items = document.body.querySelectorAll(".page4 .mobile-list .list-nav > div > a"); 676Shop.prototype.mobile_slide_nav_nav_items = document.body.querySelectorAll(".page4 .mobile-list .slide-nav a"); 677Shop.prototype.mobile_slide_nav_page = 0; 678Shop.prototype.nav_page_slide = function(n) { 679 let page = 0; 680 if(n < 0) { 681 page = 0; 682 } else if(n >= this.mobile_slide_nav_nav_items.length) { 683 page = this.mobile_slide_nav_nav_items.length - 1; 684 } else { 685 page = n; 686 } 687 Array.prototype.forEach.call(this.mobile_slide_nav_nav_items, (function(k, v) { 688 if(v == page) 689 k.classList.add("active"); 690 else 691 k.classList.remove("active"); 692 }).bind(this)); 693 let wrap_width = this.mobile_slide_nav_items[page].clientWidth + 694 this.mobile_slide_nav_items[page+1].clientWidth + this.mobile_slide_nav_items[page+2].
694clientWidth + 18; 695 this.mobile_slide_nav_wrap.style.width = wrap_width + "px"; 696 let offset = this.mobile_slide_nav_items[page].offsetLeft - parseInt(this.mobile_slide_nav_items[0].offsetLeft); 697 Array.prototype.forEach.call(this.mobile_slide_nav_items, (function(k, v) { 698 k.setAttribute("style", "left: " + (-offset) + "px"); 699 }).bind(this)); 700} 701Shop.prototype.slide = function(n) { 702 if(n >= 0 && n < this.slide_buttons.length) { 703 //pc 704 this.current_slide = n; 705 Array.prototype.forEach.call(this.slide_buttons, (function(k, v) { 706 if(v == n) 707 k.classList.add("active"); 708 else 709 k.classList.remove("active"); 710 }).bind(this)); 711 Array.prototype.forEach.call(this.slide_items, (function(k, v) { 712 k.setAttribute("style", "left: " + (-k.clientWidth * n) + "px"); 713 }).bind(this)); 714 //mobile 715 Array.prototype.forEach.call(this.mobile_slide_nav_items, (function(k, v) { 716 if(v == n) 717 k.classList.add("active"); 718 else 719 k.classList.remove("active"); 720 }).bind(this)); 721 Array.prototype.forEach.call(this.mobile_slide_info_items, (function(k, v) { 722 k.setAttribute("style", "left: " + (-(k.clientWidth + 20) * n) + "px"); 723 }).bind(this)); 724 Shop.prototype.nav_page_slide(n - 1); 725 } 726} 727Array.prototype.forEach.call(Shop.prototype.slide_buttons, function(k, v) { 728 k.addEventListener("click", function() { 729 Shop.prototype.slide(v); 730 }) 731}); 732Array.prototype.forEach.call(Shop.prototype.mobile_slide_nav_items, function(k, v) { 733 k.addEventListener("click", function() { 734 Shop.prototype.slide(v); 735 }) 736}); 737Array.prototype.forEach.call(Shop.prototype.mobile_slide_nav_nav_items, function(k, v) { 738 k.addEventListener("click", function() { 739 Shop.prototype.nav_page_slide(v); 740 }) 741}); 742Shop.prototype.is_slide_auto = false; 743Shop.prototype.auto_slide = setInterval((function() { 744 if(this.is_slide_auto) { 745 let next_slide = this.current_slide + 1; 746 if(next_slide >= this.slide_buttons.length) { 747 next_slide = 0; 748 } 749 this.slide(next_slide); 750 } 751}).bind(this), 5000); 752document.body.querySelector(".page4 .mobile-list .list-nav > a:first-child").addEventListener("click", (function() { 753 let prev_slide = this.current_slide - 1; 754 if(prev_slide < 0) { 755 prev_slide = this.slide_buttons.length - 1; 756 } 757 this.slide(prev_slide); 758}).bind(this)); 759document.body.querySelector(".page4 .mobile-list .list-nav > a:last-child").addEventListener("click", (function() { 760 let next_slide = this.current_slide + 1; 761 if(next_slide >= this.slide_buttons.length) { 762 next_slide = 0; 763 } 764 this.slide(next_slide); 765}).bind(this)); 766 767Shop.prototype.window_width = 0; 768Shop.prototype.window_height = 0; 769Shop.prototype.resize_function = function(e) { 770 if(document.body.clientWidth !== this.window_width || window.innerHeight !== this.window_height) { 771 this.window_width = document.body.clientWidth; 772 this.window_height = window.innerHeight; 773 this.slide(this.current_slide); 774 if(document.body.clientWidth < 864 || window.innerHeight < 750) { 775 this.is_slide_auto = true; 776 } else { 777 this.is_slide_auto = false; 778 } 779 } 780 document.body.querySelector(".banner > article").style.height = window.innerHeight + "px"; 781} 782 783Shop.prototype.add_event = function() { 784 document.addEventListener('scroll', Shop.prototype.scroll_function.bind(this)); 785 window.addEventListener("resize", Shop.prototype.resize_function.bind(this)); 786 window.addEventListener("load", function() { 787 setTimeout(function() { 788 Shop.prototype.slide(0); 789 }, 300); 790 }); 791} 792 793document.body.querySelector(".banner > article").style.height = window.innerHeight + "px"; 794 795Shop.prototype.scroll_function(); 796Shop.prototype.resize_function(); 797Shop.prototype.slide(0); 798} 799 800 801 802//ì¼í몰ì ìí 803 804const Chango = function(){} 805 806Chango.prototype.load_function = function() { 807 808 809/* ì¤í¬ë¡¤ ì´ë²¤í¸ */ 810 811 812Chango.prototype.current_page = -1; 813Chango.prototype.scroll_function = function() {
814 let current_scroll_top = document.documentElement.scrollTop; 815 let page_before = this.current_page; 816 if(document.body.clientWidth < 864 || window.innerHeight < 750) { 817 if(sections[1].getBoundingClientRect().y - window.innerHeight > 0) { 818 this.current_page = 0; 819 } else if(sections[2].getBoundingClientRect().y - window.innerHeight > 0) { 820 this.current_page = 1; 821 } else if(sections[3].getBoundingClientRect().y - window.innerHeight > 0) { 822 this.current_page = 2; 823 } else { 824 this.current_page = 3; 825 } 826 } else { 827 if(current_scroll_top < 101) { 828 this.current_page = 0; 829 } else if(current_scroll_top < 1001) { 830 this.current_page = 1; 831 } else if(current_scroll_top < 1901) { 832 this.current_page = 2; 833 } else { 834 this.current_page = 3; 835 } 836 } 837 if(page_before !== this.current_page) { 838 if(this.current_page == 0) { 839 if(header) 840 header.classList.add("white"); 841 } else { 842 if(header) 843 header.classList.remove("white"); 844 } 845 Array.prototype.forEach.call(sections, (function(k, v){ 846 if(v > this.current_page) { 847 k.classList.remove("active"); 848 k.classList.remove("up"); 849 } 850 else if(v == this.current_page) { 851 k.classList.add("active"); 852 k.classList.remove("up"); 853 } 854 else if(v < this.current_page) { 855 k.classList.add("active"); 856 k.classList.add("up"); 857 } 858 }).bind(this)); 859 } 860 if(window.pageYOffset + window.innerHeight >= document.body.scrollHeight - footer.clientHeight) { 861 if(document.body.clientWidth >= 864) { 862 document.body.querySelector(".page3 article").style.top = (-(window.pageYOffset + window.innerHeight - document.body.scrollHeight + footer.clientHeight)) + "px"; 863 document.body.querySelector(".page3 article").style.transition = "all 0s ease-in-out"; 864 } else { 865 document.body.querySelector(".page3 article").style.top = "0"; 866 document.body.querySelector(".page3 article").style.transition = ""; 867 } 868 } else { 869 document.body.querySelector(".page3 article").style.top = "0"; 870 document.body.querySelector(".page3 article").style.transition = ""; 871 } 872} 873 874Chango.prototype.window_width = 0; 875Chango.prototype.window_height = 0; 876Chango.prototype.resize_function = function(e) { 877 if(document.body.clientWidth !== this.window_width || window.innerHeight !== this.window_height) { 878 this.window_width = document.body.clientWidth; 879 this.window_height = window.innerHeight; 880 } 881 document.body.querySelector(".banner > article").style.height = window.innerHeight + "px"; 882} 883 884Chango.prototype.add_event = function() { 885 document.addEventListener('scroll', Chango.prototype.scroll_function.bind(this)); 886 window.addEventListener("resize", Chango.prototype.resize_function.bind(this)); 887} 888 889document.body.querySelector(".banner > article").style.height = window.innerHeight + "px"; 890 891Chango.prototype.scroll_function(); 892Chango.prototype.resize_function(); 893} 894 895 896 897 898 899 900 901 902 903 904// FAQ íì´ì§ 905 906 907 908const FAQ = function() {} 909 910 911FAQ.prototype.load_function = function() { 912 913 914/* ë°°ë ëì´ ì¡°ì */ 915document.body.querySelector(".banner").style.height = window.innerHeight + "px"; 916 917 918/* ì¤í¬ë¡¤ ì´ë²¤í¸ */ 919FAQ.prototype.scroll_event = function() { 920 if(sections[1].getBoundingClientRect().y >= window.innerHeight / 2) { 921 if(header) 922 header.classList.add("white"); 923 if(sections[0]) 924 sections[0].classList.add("active"); 925 } else { 926 if(header) 927 header.classList.remove("white"); 928 } 929 if(sections[1].getBoundingClientRect().y < 0) { 930 if(sections[0]) 931 sections[0].classList.remove("active"); 932 } 933} 934 935 936/* FAQí´ë¦ ì´ë²¤í¸ */ 937FAQ.prototype.faq_items = document.body.querySelectorAll(".page1 .faq > div"); 938FAQ.prototype.select_faq = function(n) { 939 if(this.faq_items[n]) { 940 Array.prototype.forEach.call(this.faq_items, function(k, v) { 941 if(v == n) 942 k.classList.toggle('active'); 943 else 944 k.classList.remove('active'); 945 }); 946 return true; 947 } 948 return false;
949} 950 951 952/* menu í´ë¦ ì´ë²¤í¸ */ 953FAQ.prototype.menu_items = document.body.querySelectorAll(".page1 .menu li a"); 954FAQ.prototype.select_menu = function(n) { 955 if(this.menu_items[n]) { 956 let data_text = this.menu_items[n].dataset?.text; 957 Array.prototype.forEach.call(this.menu_items, function(k, v) { 958 if(v == n) { 959 k.classList.add('active'); 960 } else { 961 k.classList.remove('active'); 962 } 963 }); 964 if(data_text) { 965 Array.prototype.forEach.call(this.faq_items, function(k, v) { 966 if(k.classList.contains(data_text)) 967 k.classList.add('show'); 968 else 969 k.classList.remove('show'); 970 }); 971 } else { 972 Array.prototype.forEach.call(this.faq_items, function(k, v) { 973 k.classList.add('show'); 974 }); 975 } 976 return true; 977 } 978 return false; 979} 980FAQ.prototype.select_menu(0); 981 982 983/* ìëì° í¬ê¸°ê° ë°ëìì ë */ 984FAQ.prototype.window_width = window.innerWidth; 985FAQ.prototype.window_height = window.innerHeight; 986FAQ.prototype.resize_function = function(e) { 987 if(window.innerWidth !== this.window_width) { 988 window_width = window.innerWidth; 989 } 990 if(window.innerHeight != this.window_height) { 991 window_height = window.innerHeight; 992 document.body.querySelector(".banner").style.height = window.innerHeight + "px"; 993 } 994} 995 996 997FAQ.prototype.add_event = function() { 998 window.addEventListener("resize", FAQ.prototype.resize_function.bind(this)); 999 document.addEventListener('scroll', this.scroll_event.bind(this)); 1000} 1001 1002FAQ.prototype.scroll_event(); 1003 1004 1005} 1006 1007 1008 1009 1010 1011 1012// ë§ì´ì°½ê³ ìê° íì´ì§ 1013 1014const Introduction = function() {} 1015 1016 1017Introduction.prototype.load_function = function() { 1018 1019/* ë°°ë ëì´ ì¡°ì */ 1020document.body.querySelector(".banner").style.height = window.innerHeight + "px"; 1021 1022 1023/* ì¤í¬ë¡¤ ì´ë²¤í¸ */ 1024Introduction.prototype.about_nav = document.body.querySelector(".about-nav"); 1025Introduction.prototype.scroll_event = function() { 1026 if(sections[1].getBoundingClientRect().y >= window.innerHeight / 2) { 1027 if(header) 1028 header.classList.add("white"); 1029 if(sections[0]) 1030 sections[0].classList.add("active"); 1031 } else { 1032 if(header) 1033 header.classList.remove("white"); 1034 } 1035 if(sections[1].getBoundingClientRect().y < 0) { 1036 if(sections[0]) 1037 sections[0].classList.remove("active"); 1038 } 1039 if(this.about_nav.getBoundingClientRect().y < 164) { 1040 this.about_nav.classList.add("fixed"); 1041 // header.classList.add("disable"); 1042 } else { 1043 this.about_nav.classList.remove("fixed"); 1044 // header.classList.remove("disable"); 1045 } 1046 if(sections[2].getBoundingClientRect().y < window.innerHeight - 100) { 1047 sections[2].classList.add("active"); 1048 } else { 1049 sections[2].classList.remove("active"); 1050 } 1051} 1052 1053 1054/* ìëì° í¬ê¸°ê° ë°ëìì ë */ 1055Introduction.prototype.window_width = window.innerWidth; 1056Introduction.prototype.window_height = window.innerHeight; 1057Introduction.prototype.resize_function = function(e) { 1058 if(window.innerWidth !== this.window_width) { 1059 window_width = window.innerWidth; 1060 } 1061 if(window.innerHeight != this.window_height) { 1062 window_height = window.innerHeight; 1063 document.body.querySelector(".banner").style.height = window.innerHeight + "px"; 1064 } 1065} 1066 1067 1068Introduction.prototype.add_event = function() { 1069 window.addEventListener("resize", Introduction.prototype.resize_function.bind(this)); 1070 document.addEventListener('scroll', this.scroll_event.bind(this)); 1071} 1072 1073Introduction.prototype.scroll_event(); 1074 1075 1076} 1077 1078 1079 1080//ì°í íì´ì§ 1081 1082const History = function() {} 1083 1084 1085History.prototype.load_function = function() { 1086 1087/* ë°°ë ëì´ ì¡°ì */ 1088document.body.querySelector(".banner").style.height = window.innerHeight + "px"; 1089 1090 1091/* ì¤í¬ë¡¤ ì´ë²¤í¸ */ 1092History.prototype.about_nav = document.body.querySelector(".about-nav"); 1093History.prototype.history_title = document.body.querySelector(".history .page1 .left"); 1094History.prototype.history_anchor = document.body.querySelector(".history .page1 .left > div"); 1095History.prototype.years = document.body.querySelectorAll(".history .page1 .left > div > div > strong"); 1096History.prototype.years_content = document.body.querySelectorAll(".history .page1 .right > div"); 1097History.prototype.year_before = 0; 1098History.prototype.story_text = document.body.querySelector(".history .page1 .story"); 1099History.prototype.story_text_inner = document.body.querySelector(".history .page1 .story strong"); 1100History.prototype.scroll_event = function() { 1101 if(sections[1].getBoundingClientRect().y >= window.innerHeight / 2) { 1102 if(header) 1103 header.classList.add("white"); 1104 if(sections[0]) 1105 sections[0].classList.add("active"); 1106 } else { 1107 if(header) 1108 header.classList.remove("white"); 1109 } 1110 if(sections[1].getBoundingClientRect().y < 0) { 1111 if(sections[0]) 1112 sections[0].classList.remove("active"); 1113 } 1114 if(this.about_nav.getBoundingClientRect().y < 164) { 1115 this.about_nav.classList.add("fixed"); 1116 this.history_title.classList.add("fixed"); 1117 } else { 1118 this.about_nav.classList.remove("fixed"); 1119 this.history_title.classList.remove("fixed"); 1120 } 1121 if(sections[2].getBoundingClientRect().y < window.innerHeight - 100) { 1122 sections[2].classList.add("active"); 1123 } else { 1124 sections[2].classList.remove("active"); 1125 }
1126 let current_year = 0; 1127 for(let i = 0; i < this.years_content.length; i++) { 1128 if(this.years_content[i].getBoundingClientRect().y >= this.history_anchor.getBoundingClientRect().y) { 1129 current_year = i; 1130 break; 1131 } 1132 } 1133 console.log(this.story_text.getBoundingClientRect().bottom, innerHeight - 100) 1134 if(this.story_text.getBoundingClientRect().bottom < innerHeight - 100) { 1135 this.story_text.classList.add("fixed"); 1136 } else { 1137 this.story_text.classList.remove("fixed"); 1138 } 1139 if(window.pageYOffset + window.innerHeight >= document.body.scrollHeight - footer.clientHeight) { 1140 this.story_text_inner.style.transform = "translateY(" + (-window.innerHeight + footer.getBoundingClientRect().y) + "px)"; 1141 } else { 1142 this.story_text_inner.style.transform = ""; 1143 } 1144 if(current_year != this.year_before) { 1145 this.year_before = current_year; 1146 let offset = current_year * 160; 1147 Array.prototype.forEach.call(this.years, (function(k, v) { 1148 k.setAttribute("style", "transform: translateY(" + (-offset) + "px)"); 1149 }).bind(this)); 1150 } 1151} 1152History.prototype.scroll_event(); 1153 1154 1155/* ìëì° í¬ê¸°ê° ë°ëìì ë */ 1156History.prototype.window_width = window.innerWidth; 1157History.prototype.window_height = window.innerHeight; 1158History.prototype.resize_function = function(e) { 1159 if(window.innerWidth !== this.window_width) { 1160 window_width = window.innerWidth; 1161 } 1162 if(window.innerHeight != this.window_height) { 1163 window_height = window.innerHeight; 1164 document.body.querySelector(".banner").style.height = window.innerHeight + "px"; 1165 } 1166} 1167 1168 1169History.prototype.add_event = function() { 1170 window.addEventListener("resize", History.prototype.resize_function.bind(this)); 1171 document.addEventListener('scroll', this.scroll_event.bind(this)); 1172} 1173 1174History.prototype.scroll_event(); 1175 1176 1177} 1178 1179 1180 1181 1182 1183// ìì íì´ì§ 1184 1185const News = function() {} 1186 1187 1188News.prototype.load_function = function() { 1189 1190/* ë°°ë ëì´ ì¡°ì */ 1191document.body.querySelector(".banner").style.height = window.innerHeight + "px"; 1192 1193 1194/* ì¤í¬ë¡¤ ì´ë²¤í¸ */ 1195News.prototype.about_nav = document.body.querySelector(".about-nav"); 1196News.prototype.scroll_event = function() { 1197 if(sections[1].getBoundingClientRect().y >= window.innerHeight / 2) { 1198 if(header) 1199 header.classList.add("white"); 1200 if(sections[0]) 1201 sections[0].classList.add("active"); 1202 } else { 1203 if(header) 1204 header.classList.remove("white"); 1205 } 1206 if(sections[1].getBoundingClientRect().y < 0) { 1207 if(sections[0]) 1208 sections[0].classList.remove("active"); 1209 } 1210 if(this.about_nav.getBoundingClientRect().y < 164) { 1211 this.about_nav.classList.add("fixed"); 1212 } else { 1213 this.about_nav.classList.remove("fixed"); 1214 } 1215 if(sections[2].getBoundingClientRect().y < window.innerHeight - 100) { 1216 sections[2].classList.add("active"); 1217 } else { 1218 sections[2].classList.remove("active"); 1219 } 1220} 1221 1222 1223/* Modal */ 1224News.prototype.open_modal = function() { 1225 let modal = document.body.querySelector(".modal"); 1226 modal.classList.add("active"); 1227} 1228News.prototype.close_modal = function() { 1229 let modal = document.body.querySelector(".modal"); 1230 modal.classList.remove("active"); 1231} 1232let modals = document.body.querySelectorAll(".modal > .background"); 1233Array.prototype.forEach.call(modals, (function(k, v) { 1234 k.addEventListener("click", (function() { 1235 this.close_modal(); 1236 }).bind(this)); 1237}).bind(this)); 1238let modal_close_buttons = document.body.querySelectorAll(".modal .close-button"); 1239Array.prototype.forEach.call(modal_close_buttons, (function(k, v) { 1240 k.addEventListener("click", (function(e) { 1241 e.stopPropagation(); 1242 this.close_modal(); 1243 }).bind(this)); 1244}).bind(this)); 1245 1246 1247/* ìëì° í¬ê¸°ê° ë°ëìì ë */ 1248News.prototype.window_width = window.innerWidth; 1249News.prototype.window_height = window.innerHeight; 1250News.prototype.resize_function = function(e) { 1251 if(window.innerWidth !== this.window_width) { 1252 window_width = window.innerWidth; 1253 } 1254 if(window.innerHeight != this.window_height) { 1255 window_height = window.innerHeight; 1256 document.body.querySelector(".banner").style.height = window.innerHeight + "px"; 1257 } 1258} 1259 1260 1261News.prototype.add_event = function() { 1262 window.addEventListener("resize", News.prototype.resize_function.bind(this)); 1263 document.addEventListener('scroll', this.scroll_event.bind(this)); 1264} 1265 1266News.prototype.scroll_event(); 1267 1268} 1269 1270 1271 1272// ì¤ìë길 íì´ì§ 1273 1274const Map = function() {} 1275 1276 1277Map.prototype.load_function = function() { 1278 1279/* ë°°ë ëì´ ì¡°ì */ 1280document.body.querySelector(".banner").style.height = window.innerHeight + "px"; 1281 1282 1283/* ì¤í¬ë¡¤ ì´ë²¤í¸ */ 1284Map.prototype.about_nav = document.body.querySelector(".about-nav"); 1285Map.prototype.scroll_event = function() { 1286 if(sections[1].getBoundingClientRect().y >= window.innerHeight / 2) { 1287 if(header) 1288 header.classList.add("white"); 1289 if(sections[0]) 1290 sections[0].classList.add("active"); 1291 } else { 1292 if(header) 1293 header.classList.remove("white"); 1294 } 1295 if(sections[1].getBoundingClientRect().y < 0) { 1296 if(sections[0]) 1297 sections[0].classList.remove("active"); 1298 } 1299 if(this.about_nav.getBoundingClientRect().y < 164) { 1300 this.about_nav.classList.add("fixed"); 1301 } else { 1302 this.about_nav.classList.remove("fixed"); 1303 } 1304 if(sections[2].getBoundingClientRect().y < window.innerHeight - 100) { 1305 sections[2].classList.add("active"); 1306 } else { 1307 sections[2].classList.remove("active"); 1308 } 1309} 1310 1311 1312/* ìëì° í¬ê¸°ê° ë°ëìì ë */ 1313Map.prototype.window_width = window.innerWidth;
1314Map.prototype.window_height = window.innerHeight; 1315Map.prototype.resize_function = function(e) { 1316 if(window.innerWidth !== this.window_width) { 1317 window_width = window.innerWidth; 1318 } 1319 if(window.innerHeight != this.window_height) { 1320 window_height = window.innerHeight; 1321 document.body.querySelector(".banner").style.height = window.innerHeight + "px"; 1322 } 1323} 1324 1325 1326Map.prototype.add_event = function() { 1327 window.addEventListener("resize", Map.prototype.resize_function.bind(this)); 1328 document.addEventListener('scroll', this.scroll_event.bind(this)); 1329} 1330 1331Map.prototype.scroll_event(); 1332 1333} 1334 1335 1336 1337// íì´ì§ ê³µíµ 1338 1339 1340let page; 1341if(document.body.classList.contains("index")) { 1342 page = Index; 1343} else if(document.body.classList.contains("estimation")) { 1344 page = Estimation; 1345} else if(document.body.classList.contains("shop")) { 1346 page = Shop; 1347} else if(document.body.classList.contains("chango")) { 1348 page = Chango; 1349} else if(document.body.classList.contains("faq")) { 1350 page = FAQ; 1351} else if(document.body.classList.contains("introduction")) { 1352 page = Introduction; 1353} else if(document.body.classList.contains("history")) { 1354 page = History; 1355} else if(document.body.classList.contains("news")) { 1356 page = News; 1357} else if(document.body.classList.contains("map")) { 1358 page = Map; 1359} else { 1360 page = function(){} 1361 page.prototype.load_function = function() {} 1362 page.prototype.add_event = function() {} 1363} 1364page.prototype.load_function(); 1365page.prototype.add_event(); 1366 1367 1368 1369//scroll ì´ë²¤í¸ 1370document.addEventListener('scroll', function() { 1371 //aside 1372 if(window.pageYOffset + window.innerHeight >= document.body.scrollHeight - footer.clientHeight) { 1373 aside.className = "up"; 1374 } else { 1375 aside.className = ""; 1376 } 1377}); 1378 1379 1380/* navë©ë´ í ê¸ */ 1381 1382function toggle_menu(holder) { 1383 if(holder.classList.contains("on")) { 1384 holder.classList.remove("on"); 1385 document.body.style.overflowY = "auto"; 1386 holder.children[0].children[0].style.transform = ""; 1387 holder.children[0].children[1].style.opacity = "1"; 1388 holder.children[0].children[2].style.transform = ""; 1389 document.body.querySelector("header nav").style.opacity = "0"; 1390 document.body.querySelector("header nav").style.visibility = "hidden"; 1391 document.body.querySelector("header nav").style.pointerEvents = "none"; 1392 } else { 1393 holder.classList.add("on"); 1394 holder.children[0].children[0].style.transform = "translateY(9px) rotate(45deg)"; 1395 holder.children[0].children[1].style.opacity = "0"; 1396 holder.children[0].children[2].style.transform = "translateY(-9px) rotate(-45deg)"; 1397 document.body.querySelector("header nav").style.visibility = "visible"; 1398 document.body.querySelector("header nav").style.opacity = "1"; 1399 document.body.querySelector("header nav").style.pointerEvents = "auto"; 1400 document.body.style.overflowY = "hidden"; 1401 } 1402} 1403 1404function get_url_param(name, url = window.location.href) { 1405 name = name.replace(/[\[\]]/g, '\\$&'); 1406 let regex = new RegExp('[?&]' + name + '(=([^&#]*)|&|#|$)'); 1407 let results = regex.exec(url); 1408 if (!results) return null; 1409 if (!results[2]) return ''; 1410 return decodeURIComponent(results[2].replace(/\+/g, ' ')); 1411} 1412 1413window.addEventListener("load", function() { 1414 let page = get_url_param("page"); 1415 if(page) { 1416 if(page == "page1") { 1417 let page1 = window.document.querySelector("section.page1"); 1418 if(document.body.clientWidth < 864 || window.innerHeight < 750) 1419 window.scrollTo(0, page1.getBoundingClientRect().y - 150); 1420 else 1421 window.scrollTo(0, page1.getBoundingClientRect().y - 243); 1422 } 1423 } 1424});
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.