"use strict";
var _typeof = typeof Symbol === "function" && typeof Symbol.iterator === "symbol" ? function (obj) { return typeof obj; } : function (obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; };
!function i(o, a, r) {
function l(n, e) {
if (!a[n]) {
if (!o[n]) {
var t = "function" == typeof require && require;
if (!e && t) return t(n, !0);
if (s) return s(n, !0);
throw (e = new Error("Cannot find module '" + n + "'")).code = "MODULE_NOT_FOUND", e;
}
t = a[n] = {
exports: {}
}, o[n][0].call(t.exports, function (e) {
var t = o[n][1][e];
return l(t || e);
}, t, t.exports, i, o, a, r);
}
return a[n].exports;
}
for (var s = "function" == typeof require && require, e = 0; e < r.length; e++) {
l(r[e]);
}return l;
}({
1: [function (e, t, n) {
try {
var i = new window.CustomEvent("test");
if (i.preventDefault(), !0 !== i.defaultPrevented) throw new Error("Could not prevent default");
} catch (e) {
var o = function o(e, t) {
var n, i;
return t = t || {
bubbles: !1,
cancelable: !1,
detail: void 0
}, (n = document.createEvent("CustomEvent")).initCustomEvent(e, t.bubbles, t.cancelable, t.detail), i = n.preventDefault, n.preventDefault = function () {
i.call(this);
try {
Object.defineProperty(this, "defaultPrevented", {
get: function get() {
return !0;
}
});
} catch (e) {
this.defaultPrevented = !0;
}
}, n;
};
o.prototype = window.Event.prototype, window.CustomEvent = o;
}
}, {}],
2: [function (e, t, n) {
"use strict";
function i(e, t) {
if (null == e) throw new TypeError("Cannot convert first argument to object");
for (var n = Object(e), i = 1; i < arguments.length; i++) {
var o = arguments[i];
if (null != o) for (var a = Object.keys(Object(o)), r = 0, l = a.length; r < l; r++) {
var s = a[r],
d = Object.getOwnPropertyDescriptor(o, s);
void 0 !== d && d.enumerable && (n[s] = o[s]);
}
}
return n;
}
t.exports = {
assign: i,
polyfill: function polyfill() {
Object.assign || Object.defineProperty(Object, "assign", {
enumerable: !1,
configurable: !0,
writable: !0,
value: i
});
}
};
}, {}],
3: [function (e, t, n) {
"use strict";
function i(e) {
e.fn.modalVideo = function (e) {
return "strings" != typeof e && new o(this, e), this;
};
}
var o = e("../index");
"function" == typeof define && define.amd ? define(["jquery"], i) : void 0 !== (e = window.jQuery || window.$) && i(e), t.exports = i;
}, {
"../index": 5
}],
4: [function (e, t, n) {
"use strict";
Object.defineProperty(n, "__esModule", {
value: !0
});
var i = function i(e, t, n) {
return t && o(e.prototype, t), n && o(e, n), e;
};
function o(e, t) {
for (var n = 0; n < t.length; n++) {
var i = t[n];
i.enumerable = i.enumerable || !1, i.configurable = !0, "value" in i && (i.writable = !0), Object.defineProperty(e, i.key, i);
}
}
e("custom-event-polyfill");
var f = e("../lib/util");
var a = e("es6-object-assign").assign,
r = {
channel: "youtube",
facebook: {},
youtube: {
autoplay: 1,
cc_load_policy: 1,
color: null,
controls: 1,
disablekb: 0,
enablejsapi: 0,
end: null,
fs: 1,
h1: null,
iv_load_policy: 1,
loop: 0,
modestbranding: null,
mute: 0,
origin: null,
playsinline: null,
rel: 0,
showinfo: 1,
start: 0,
wmode: "transparent",
theme: "dark",
nocookie: !1
},
ratio: "16:9",
vimeo: {
api: !1,
autopause: !0,
autoplay: !0,
byline: !0,
callback: null,
color: null,
controls: !0,
height: null,
loop: !1,
maxheight: null,
maxwidth: null,
muted: !1,
player_id: null,
portrait: !0,
title: !0,
width: null,
xhtml: !1
},
allowFullScreen: !0,
allowAutoplay: !0,
animationSpeed: 300,
classNames: {
modalVideo: "modal-video",
modalVideoClose: "modal-video-close",
modalVideoBody: "modal-video-body",
modalVideoInner: "modal-video-inner",
modalVideoIframeWrap: "modal-video-movie-wrap",
modalVideoCloseBtn: "modal-video-close-btn"
},
aria: {
openMessage: "You just openned the modal video",
dismissBtnMessage: "Close the modal by clicking here"
}
},
e = (i(l, [{
key: "getPadding",
value: function value(e) {
var e = e.split(":"),
t = Number(e[0]);
return 100 * Number(e[1]) / t + "%";
}
}, {
key: "getWidthFulfillAspectRatio",
value: function value(e, t, n) {
var e = e.split(":"),
i = Number(e[0]),
e = Number(e[1]);
return t < n * (e / i) ? Math.floor(i / e * t) + "px" : "100%";
}
}, {
key: "getQueryString",
value: function value(t) {
var n = "";
return Object.keys(t).forEach(function (e) {
n += e + "=" + t[e] + "&";
}), console.log(n), n.substr(0, n.length - 1);
}
}, {
key: "getVideoUrl",
value: function value(e, t, n) {
return "youtube" === t ? this.getYoutubeUrl(e.youtube, n) : "vimeo" === t ? this.getVimeoUrl(e.vimeo, n) : "facebook" === t ? this.getFacebookUrl(e.facebook, n) : "custom" === t ? e.url : "";
}
}, {
key: "getVimeoUrl",
value: function value(e, t) {
return "//player.vimeo.com/video/" + t + "?" + this.getQueryString(e);
}
}, {
key: "getYoutubeUrl",
value: function value(e, t) {
var n = this.getQueryString(e);
return !0 === e.nocookie ? "//www.youtube-nocookie.com/embed/" + t + "?" + n : "//www.youtube.com/embed/" + t + "?" + n;
}
}, {
key: "getFacebookUrl",
value: function value(e, t) {
return "//www.facebook.com/v2.10/plugins/video.php?href=https://www.facebook.com/facebook/videos/" + t + "&" + this.getQueryString(e);
}
}, {
key: "getHtml",
value: function value(e, t, n) {
var i = this.getPadding(e.ratio),
o = e.classNames;
return '\n
\n ';
}
}]), l);
function l(e, t) {
var s = this;
if (!(this instanceof l)) throw new TypeError("Cannot call a class as a function");
var d = a({}, r, t),
t = "string" == typeof e ? document.querySelectorAll(e) : e,
c = document.querySelector("body"),
u = d.classNames,
p = d.animationSpeed;
[].forEach.call(t, function (l) {
l.addEventListener("click", function (e) {
"A" === l.tagName && e.preventDefault();
function t() {
clearTimeout(r), r = setTimeout(function () {
var e = s.getWidthFulfillAspectRatio(d.ratio, window.innerHeight, window.innerWidth),
t = document.getElementById("modal-video-inner-" + i);
t.style.maxWidth !== e && (t.style.maxWidth = e);
}, 10);
}
var e = l.dataset.videoId,
n = l.dataset.channel || d.channel,
i = (0, f.getUniqId)(),
n = l.dataset.videoUrl || s.getVideoUrl(d, n, e),
e = s.getHtml(d, n, i),
o = ((0, f.append)(c, e), document.getElementById(i)),
a = o.querySelector(".js-modal-video-dismiss-btn"),
r = void 0;
o.focus(), o.addEventListener("click", function () {
(0, f.addClass)(o, u.modalVideoClose), window.removeEventListener("resize", t), setTimeout(function () {
(0, f.remove)(o), l.focus();
}, p);
}), o.addEventListener("keydown", function (e) {
9 === e.which && (e.preventDefault(), (document.activeElement === o ? a : (o.setAttribute("aria-label", ""), o)).focus());
}), window.addEventListener("resize", t), a.addEventListener("click", function () {
(0, f.triggerEvent)(o, "click");
});
});
});
}
n.default = e, t.exports = n.default;
}, {
"../lib/util": 6,
"custom-event-polyfill": 1,
"es6-object-assign": 2
}],
5: [function (e, t, n) {
"use strict";
t.exports = e("./core/");
}, {
"./core/": 4
}],
6: [function (e, t, n) {
"use strict";
Object.defineProperty(n, "__esModule", {
value: !0
});
n.append = function (e, t) {
var n = document.createElement("div");
for (n.innerHTML = t; 0 < n.children.length;) {
e.appendChild(n.children[0]);
}
}, n.getUniqId = function () {
return (Date.now().toString(36) + Math.random().toString(36).substr(2, 5)).toUpperCase();
}, n.remove = function (e) {
e && e.parentNode && e.parentNode.removeChild(e);
}, n.addClass = function (e, t) {
e.classList ? e.classList.add(t) : e.className += " " + t;
}, n.triggerEvent = function (e, t, n) {
var i = void 0;
window.CustomEvent ? i = new CustomEvent(t, {
cancelable: !0
}) : (i = document.createEvent("CustomEvent")).initCustomEvent(t, !1, !1, n), e.dispatchEvent(i);
};
}, {}]
}, {}, [3]), function (e) {
"function" == typeof define && define.amd ? define(["jquery"], e) : "object" == (typeof exports === "undefined" ? "undefined" : _typeof(exports)) ? module.exports = e(require("jquery")) : e(jQuery);
}(function (d) {
var c,
u,
i,
p = [],
f = document,
v = window,
m = f.documentElement;
function t() {
if (p.length) {
var e,
t,
n = 0,
i = d.map(p, function (e) {
var t = e.data.selector,
e = e.$element;
return t ? e.find(t) : e;
});
for (c = c || (t = (t = {
height: v.innerHeight,
width: v.innerWidth
}).height || !(e = f.compatMode) && d.support.boxModel ? t : {
height: (e = "CSS1Compat" === e ? m : f.body).clientHeight,
width: e.clientWidth
}), u = u || {
top: v.pageYOffset || m.scrollTop || f.body.scrollTop,
left: v.pageXOffset || m.scrollLeft || f.body.scrollLeft
}; n < p.length; n++) {
if (d.contains(m, i[n][0])) {
var o = d(i[n]),
a = o[0].offsetHeight,
r = o[0].offsetWidth,
l = o.offset(),
s = o.data("inview");
if (!u || !c) return;
l.top + a > u.top && l.top < u.top + c.height && l.left + r > u.left && l.left < u.left + c.width ? s || o.data("inview", !0).trigger("inview", [!0]) : s && o.data("inview", !1).trigger("inview", [!1]);
}
}
}
}
d.event.special.inview = {
add: function add(e) {
p.push({
data: e,
$element: d(this),
element: this
}), !i && p.length && (i = setInterval(t, 250));
},
remove: function remove(e) {
for (var t = 0; t < p.length; t++) {
var n = p[t];
if (n.element === this && n.data.guid === e.guid) {
p.splice(t, 1);
break;
}
}
p.length || (clearInterval(i), i = null);
}
}, d(v).on("scroll resize scrollstop", function () {
c = u = null;
}), !m.addEventListener && m.attachEvent && m.attachEvent("onfocusin", function () {
u = null;
});
}), $(function () {
new Swiper(".p-top__fv", {
loop: !0,
effect: "fade",
speed: 1500,
autoplay: {
delay: 1500,
disableOnInteraction: !1
},
pagination: {
el: ".swiper-pagination",
type: "bullets",
clickable: !0
}
}), new Swiper(".p-top__topics__swiper", {
loop: !1,
centeredSlides: !1,
slidesPerView: "auto",
spaceBetween: 20,
speed: 600,
navigation: {
nextEl: ".swiper-button-next",
prevEl: ".swiper-button-prev"
},
scrollbar: {
el: ".swiper-scrollbar",
hide: !1,
draggable: !0
},
breakpoints: {
1e3: {
spaceBetween: 30
}
}
}), new Swiper(".c-related-link__swiper", {
centeredSlides: !1,
slidesPerView: "auto",
spaceBetween: 20,
speed: 600,
breakpoints: {
1e3: {
spaceBetween: 60
}
}
}), new Swiper(".p-page-craftsmanship__dna__swiper", {
slidesPerView: "auto",
speed: 600,
navigation: {
nextEl: ".swiper-button-next",
prevEl: ".swiper-button-prev"
},
pagination: {
el: ".swiper-pagination",
type: "bullets",
clickable: !0
}
}), new Swiper(".c-craftmanship-link__swiper", {
loop: !0,
centeredSlides: !1,
slidesPerView: "auto",
spaceBetween: 10,
speed: 600,
breakpoints: {
1e3: {
spaceBetween: 40
}
}
}), $(".js-nav-btn, .js-navClose").click(function () {
$(".c-nav__menu").toggleClass("is-open"), $("body").toggleClass("is-menu-open");
}), $(".js-video").modalVideo(), $(".p-archive__popular__btn").click(function () {
$(this).parent().toggleClass("is-active"), $(this).parent().next().slideToggle();
});
var e = ".p-archive__item";
$(e + ":nth-child(n + 13)").addClass("is-hidden"), $(".p-archive__more").on("click", function () {
$(e + ".is-hidden").slice(0, 12).removeClass("is-hidden"), 0 == $(e + ".is-hidden").length && $(".p-archive__more").fadeOut();
}), $(".p-page__col__video--play").on("inview", function () {
this.play();
}), $(".p-page__col__video--play").off("inview", function () {
this.stop();
});
});
//@prepros-prepend partial/base.js
$(function () {
// TOPページヒーロースライダー
new Swiper(".home_hero_slide", {
loop: !0,
effect: "fade",
speed: 2000,
autoplay: {
delay: 3500,
disableOnInteraction: !1
}
// pagination: {
// el: ".swiper-pagination",
// type: "bullets",
// clickable: !0
// }
});
// TOPページ NEWS スライダー
new Swiper(".home_news_slide", {
speed: 750,
allowSlideNext: true,
allowSlidePrev: true,
loop: true,
navigation: {
nextEl: '.home_news_slide_nav_next',
prevEl: '.home_news_slide_nav_prev'
},
pagination: {
el: ".home_news_slide_pagination",
type: "bullets",
clickable: !0
},
slidesPerView: 1.1,
centeredSlides: true,
spaceBetween: 0,
breakpoints: {
// when window width is >= 320px
499: {
centeredSlides: false,
slidesPerView: 2,
spaceBetween: 20
},
// when window width is >= 480px
979: {
centeredSlides: false,
slidesPerView: 3,
spaceBetween: 30
},
// when window width is >= 640px
1199: {
centeredSlides: false,
slidesPerView: 4,
spaceBetween: 50
}
}
});
// [済っぽい]トップのみに機能させたいけど、なんかエラー出たので日和った書き方してる
// ちゃんとエラーにならない書き方(first_cntの有無判定つけて、トップは可変、配下ページはデフォで固定にしたい)
$(window).scroll(function () {
var ele = $(".first_cnt");
if (ele.length > 0) {
var target = $(".first_cnt").offset().top - 100;
if ($(window).scrollTop() > target) {
// console.info(1)
$("body").addClass('js_nav_fixed');
} else {
// console.info(2)
$("body").removeClass('js_nav_fixed');
}
}
});
// 検索フォーム表示/非表示
// ------------------------------------------------------------
$(".cmn_header_search_btn").on("click", function (e) {
// console.info("btn : show / hide");
e.stopPropagation();
$(this).parent().toggleClass("js_show_search");
});
$('.cmn_header_search_form').on("click", function (e) {
e.stopPropagation();
});
// 空クリックで非表示(class付け替え)
$("body").on("click", function () {
// 検索フォーム用
if ($(".cmn_header_search").hasClass("js_show_search")) {
$(".cmn_header_search").removeClass("js_show_search");
};
//サブナビ用
if ($("body").hasClass("js_nav_show")) {
$("body").removeClass("js_nav_show");
}
});
// ハンバーガー
// ------------------------------------------------------------
$(".cmn_header_btn").on("click", function (e) {
e.stopPropagation();
$("body").toggleClass("js_nav_show");
});
});
// let app = app || {};
// $(function () {
// "use strict";
// // タブ
// // ------------------------------------------------------------
// $(".js-tab li button").on("click", function () {
// let $e = $(this);
// let $p = $e.parent().parent().parent().parent();
// // console.info($e)
// if ($e.attr("data-tab-index")) {
// let ind = $e.attr("data-tab-index");
// $p.attr("data-tab-stat", ind);
// }
// });
// // アコーディオン
// // ------------------------------------------------------------
// $(".js-aco__btn").on("click", function () {
// let $e = $(this);
// let $p = $e.parent().parent();
// /* 開閉が一つだけのパターン
// let selfOpen = $p.hasClass("on");
// let allOpen = ($(".js_aco.on").length > 0) ? true : false;
// if (selfOpen && allOpen) {
// $(".js_aco.on").removeClass("on")
// } else if (!selfOpen && !allOpen) {
// $p.toggleClass("on");
// } else {
// $(".js_aco.on").removeClass("on");
// $p.toggleClass("on");
// }
// /*/ // 単に開閉するだけのパターン
// $p.toggleClass("js-aco--on");
// //*/
// })
// // app.toggleClass = (ele, name) => {
// // ele.classList.toggle(name);
// // }
// // app.addClass = (ele, name) => {
// // ele.classList.add(name);
// // }
// // app.removeClass = (ele, name) => {
// // ele.classList.remove(name);
// // }
// // スクロールインタラクション
// // ------------------------------------------------------------
// app.setScrollIntaraction = (name, param, dur, toggle) => {
// const elements = document.querySelectorAll(name);
// const observer = new IntersectionObserver((entries) => {
// let delay = 0;
// let during = dur || 250;
// entries.forEach(entry => {
// if (entry.isIntersecting) {
// setTimeout(() => {
// if (toggle) {
// // app.toggleClass(entry.target, "js_on");
// entry.target.classList.toggle("js-anim--on");
// } else {
// // app.addClass(entry.target, "js_on");
// entry.target.classList.add("js-anim--on");
// }
// }, delay);
// delay += during;
// }
// });
// }, {
// rootMargin: param || "0px 0px 20%",
// threshold: 0
// });
// elements.forEach(element => {
// observer.observe(element);
// });
// }
// app.setScrollIntaraction(".js-anim", "-30% 0px", 250);
// setTimeout(() => {
// $(".g-sorairo-util").addClass("isAnimated");
// }, 6500)
// })