$(function(){ AOS.init({ duration: 1500, delay: 200, // once: true }); const IS_MOBILE = function() { return navigator.userAgent.match(/Android/i) || navigator.userAgent.match(/webOS/i) || navigator.userAgent.match(/iPhone/i) || navigator.userAgent.match(/iPad/i) || navigator.userAgent.match(/iPod/i) || navigator.userAgent.match(/BlackBerry/i) || navigator.userAgent.match(/Windows Phone/i); } const IS_ENG = "en" == $("html").attr("lang") && "1px" == $("html").data("tpl"); $("section.hero, #brand_wrap .brand-cover").height(window.innerHeight+"px"); if (IS_MOBILE) { $("#brand_wrap .brand-cover").height(window.innerHeight+"px"); } $(window).on("resize", function(){ $("section.hero, #brand_wrap .brand-cover").height(window.innerHeight+"px"); }); /* Main - Hero Slide */ let bullets = null; let hero_swiper = new Swiper(".hero-swiper", { loop: true, speed: 800, effect: "fade", autoplay: { delay: 5000, disableOnInteraction: false, }, pagination: { el: ".hero-swiper .swiper-pagination", clickable: true, type: "bullets", renderBullet : function (index, className) { return ''; }, }, on: { autoplayTimeLeft: function(swiper, time, percent) { if (!bullets) bullets = $(".hero .hero-swiper .swiper-pagination-bullet span"); let width = (1 - percent) * 100; width = width > 100 ? 100 : width; bullets.eq(swiper.realIndex).width(width+'%'); }, slideChange: function() { $(".hero .hero-swiper .swiper-pagination-bullet span").width(0); } } }); /* Brand - Scroll Effect */ let $logo = $("#brand_wrap .cover-logo"); let $cover = $("#brand_wrap .cover-bg"); let $anim = $("#brand_wrap .cover-anim"); if ($logo.length) { TweenMax.to($cover, 2.2, { x: -30, ease: Sine.easeOut }); setTimeout(function(){ TweenMax.to($logo, 2, { autoAlpha: 1 }); TweenMax.to($anim, 1, { autoAlpha: 0.6 }); }, 1200); } $(window).on('scroll', function() { let wh = $(window).height(); let st = $(window).scrollTop(); if (st*3 > wh) { TweenMax.to($logo, 0.8, { autoAlpha: 0 }); } else { TweenMax.to($logo, 0.8, { autoAlpha: 1 }); } }); setTimeout(function(){ $("#brand_wrap .brand-cover").on("mousemove", function(e) { visualMove($cover, e.pageX, '40'); }); }, 2200); function visualMove(obj, pageX, gapX){ var valueX = parseInt(pageX * -1 / gapX); TweenMax.to(obj, 1.5, {x: valueX, ease: Sine.easeOut }); } /* IR page - Table */ let data_kind = location.search.split("kind="); data_kind = data_kind.length > 1 ? data_kind[1] : 0; if (data_kind == 1) { $("#kind_dropdown span").text("별도"); $("#kind_dropdown_a").text("연결").data("href", location.pathname); } let currentTable = $(".fc-table-wrap").eq(data_kind); currentTable.addClass("show"); $("#kind_dropdown_a").on("click", function(){ let txt1 = $("#kind_dropdown_a").text(); $("#kind_dropdown_a").text($("#kind_dropdown span").text()); $("#kind_dropdown span").text(txt1); let kind = txt1 == "연결" ? "" : "?kind=1"; $("#kind_dropdown_a").data("href", location.pathname + kind); }); $("#kind_select").on("click", function(){ location.href = $("#kind_dropdown_a").data("href"); }); setChart(); /* IR page - Chart */ function setChart() { if (!document.getElementById('fc_chart1')) {return false;} const ctxs = [document.getElementById('fc_chart1'), document.getElementById('fc_chart2'), document.getElementById('fc_chart3')]; let data = [ currentTable.find(".fc-tr[data-fc=1]").children().map(function(i){ if (i == 0) {return;} return Number($(this).text().replaceAll(",","")); }).toArray(), currentTable.find(".fc-tr[data-fc=2]").children().map(function(i){ if (i == 0) {return;} return Number($(this).text().replaceAll(",","")); }).toArray(), currentTable.find(".fc-tr[data-fc=3]").children().map(function(i){ if (i == 0) {return;} return Number($(this).text().replaceAll(",","")); }).toArray(), ]; let legends = currentTable.find(".fc-table .fc-tr[data-fc]").map(function(i){ let txt = $(this).find(".fc-td").eq(0).text(); $(".fc-section .fc-graph .graph-box h5").eq(i).text(txt); return txt; }); let labels = currentTable.find(".fc-table .fc-thead .fc-td").map(function(i){ if (i == 0) {return;} return $(this).text(); }); let colors = ["#D50000", "#CCCCCC", "#666666"]; for (let i=0;i<3;i++) { new Chart(ctxs[i], { type: 'bar', data: { labels: labels, datasets: [{ label: legends[i], data: data[i], borderWidth: 0, backgroundColor: colors[i], barThickness: "flex", barPercentage: 0.4 }] }, options: { plugins: { legend: { display: false, }, }, reponsive: false, maintainAspectRatio: false, tooltips: { callbacks: { label: function(tooltipItem) { return tooltipItem.yLabel; } } }, scales: { x: { grid: { display: false, drawTicks: false }, ticks: { font: { family: 'Pretendard', size: 12, }, color: "#666666", padding: 10 }, }, y: { grid: { color: "#eee" }, ticks: { count: 5, font: { family: 'Pretendard', size: 12 }, color: "#999999", padding: 10 }, border: { display: false }, beginAtZero: true, } } } }); } } set_notice(); /* IR Notice page */ function set_notice() { if (!$("#container").hasClass("renewal")) { return false; } if ($(".board-search").length) { // IR Notice List let wording = IS_ENG ? "Please enter a search word." : "검색어를 입력하세요."; $("#search_display1 input").attr("placeholder", wording ); $("#search_display1").append(''); $("#search-btn").on("click", function(){ $("#btn-search").trigger("click"); }); let notice_sel = $(".est_cate_cell .cateform"); let options = ""; notice_sel.children().each(function(){ options += '
  • '+$(this).text()+'
  • '; }); let search_sel = ``; notice_sel.after(search_sel); let imgButtonLink = $('img'); imgButtonLink.each(function () { let src = $(this).attr("src"); src.indexOf("arr_page_go.gif") > -1 && $(this).replaceWith(''); src.indexOf("arr_page_next.gif") > -1 && $(this).replaceWith(''); src.indexOf("arr_page_back.gif") > -1 && $(this).replaceWith(''); src.indexOf("arr_page_pre.gif") > -1 && $(this).replaceWith(''); }); let date_tags = $(".table-board-list .bbsetc_dateof_write"); date_tags.each(function(){ let date = $(this).text().replaceAll("-", "."); $(this).text(date); }); } else if ($(".table-article-view").length) { // IR Notice Read let trs = $(".table-article-view tr"); trs.each(function(i){ if ($(this).find("#post_area").length) {return false;} let desc = $(this).find(".board_desc"); desc.attr("colspan", 2); if (i == 1) { let date = desc.text().replaceAll("-", "."); desc.text(date); } $(this).find("td.board_bgcolor").remove(); }); let download = $(".table-article-view a"); download.each(function(){ if ($(this).attr("href").indexOf("file_download") > -1) { $(this).html($(this).prev("span")); $(this).addClass("download-link"); } }); let a = $(".board-view-buttons a"); $(".board-view-buttons").html(a); } } });