function uaChange() {
var ua = navigator.userAgent
var os = navigator.platform
var bs = window.navigator.userAgent.toLowerCase()
var body = document.getElementsByTagName('body')
if (ua.indexOf('iPhone') != -1 || ua.indexOf('iPod') != -1) {
body[0].classList.add('ua-sp', 'ua-iphone')
} else if (ua.indexOf('iPad') != -1 || (ua.indexOf('Macintosh') > -1 && 'ontouchend' in document)) {
body[0].classList.add('ua-tb', 'ua-ipad')
} else if (ua.indexOf('Android') != -1) {
if (ua.indexOf('Mobile') != -1) {
body[0].classList.add('ua-sp', 'ua-android')
} else {
body[0].classList.add('ua-tb', 'ua-android')
}
} else if (os.indexOf('Win') != -1) {
body[0].classList.add('ua-pc', 'ua-win')
} else {
body[0].classList.add('ua-pc', 'ua-not-win')
}
if (bs.indexOf('msie') != -1 || bs.indexOf('trident') != -1) {
body[0].classList.add('ua-ie')
} else if (bs.indexOf('edge') != -1) {
body[0].classList.add('ua-edge')
} else if (bs.indexOf('chrome') != -1) {
body[0].classList.add('ua-chrome')
} else if (bs.indexOf('safari') != -1) {
body[0].classList.add('ua-safari')
} else if (bs.indexOf('firefox') != -1) {
body[0].classList.add('ua-firefox')
} else if (bs.indexOf('opera') != -1) {
body[0].classList.add('ua-opera')
} else {
body[0].classList.add('ua-other-browser')
}
var win7 = ua.indexOf('Windows NT 6.1') != -1
if (win7) {
document.getElementsByTagName('body')[0].classList.add('ua-win7')
}
}
$(function() {
uaChange();
objectFitImages();
})
// main
var layzr = Layzr({
normal: 'data-layzr',
threshold: 50
});
layzr.on('src:after', function (elm) {
objectFitImages(elm);
if(!elm.hasAttribute('data-layzr-bg')) return;
elm.style.backgroundImage = 'url(' + elm.getAttribute('src') + ')';
elm.removeAttribute('src');
elm.removeAttribute('data-layzr-bg');
});
document.addEventListener('DOMContentLoaded', function() {
layzr.update().check().handlers(true)
}, false);
var userAgent = window.navigator.userAgent.toLowerCase();
var is_ie = (userAgent.indexOf('msie') != -1 || userAgent.indexOf('trident') != -1) ? true : false;
Swiper.prototype.getBreakpoint = function (breakpoints) {
var window_size = window.innerWidth
|| document.documentElement.clientWidth
|| document.body.clientWidth;
var swiper = this;
// Get breakpoint for window width
if (!breakpoints) {
return undefined;
}
var breakpoint = false;
var points = [];
Object.keys(breakpoints).forEach(function (point) {
points.push(point);
});
points.sort(function (a, b) {
return parseInt(a, 10) - parseInt(b, 10);
});
for (var i = 0; i < points.length; i += 1) {
var point = points[i];
if (swiper.params.breakpointsInverse) {
if (point <= window_size) {
breakpoint = point;
}
} else if (point >= window_size && !breakpoint) {
breakpoint = point;
}
}
return breakpoint || 'max';
};
$('.js-rotate3d').each(function() {
rotate3d($(this));
});
$('a[href]').on('click tap', function(e) {
var ref = location.href;
var url = $(this).attr('href');
var a_target = $(this).attr('target')
if(a_target !== '_blank') {
if( ref.indexOf(url.replace(/#.*$/, '')) != -1 && url.indexOf('#') != -1 ) {
var speed = 300;
var href= url.match(/#.*$/);
var target = $(href[0]);
var position = target.offset().top - $('.js-header').outerHeight();
$('body, html').animate({ scrollTop: position }, speed, 'swing');
return false;
} else {
url = $(this).attr('href');
if (url !== '') {
$('body').attr('data-status', 'loadstart');
setTimeout(function() {
return true;
}, 200);
}
}
}
});
$('.js-accrodion-btn').on('click tap', function(e) {
$(this).next('.js-accrodion-target').slideToggle();
$(this).toggleClass('is-active');
});
var lock = false;
$('.js-menu-toggle').on('click tap', function() {
if(lock) return;
var $body = $('body');
var $header = $('.js-header');
var scrollBar_w = window.innerWidth - $(window).width();
var status = $body.attr('data-menu');
if( status == 'active' ) {
lock = true;
$body.attr('data-menu', '');
$('#js-sp-menu').one('transitionend', function() {
$(this).addClass('js-hide');
$body.removeClass('js-hidden');
$body.removeAttr('style');
$header.removeAttr('style');
lock = false;
});
} else {
$('#js-sp-menu').removeClass('js-hide');
$body.addClass('js-hidden').attr('data-menu', 'active');
// $body.css('paddingRight', scrollBar_w);
$header.css('paddingRight', scrollBar_w);
}
});
$('.p-pagetop').on('click tap', function() {
$('body, html').animate({
scrollTop: 0
}, 300, 'swing');
});
$(window).on('load resize', function() {
if( ($('.js-grid-col')[0] && $('.js-grid-col .js-grid-col-text')[0]) ) {
$('.js-grid-col .js-grid-col-text').matchHeight();
}
});
$(window).on('load scroll', function() {
var h = $(window).height();
var scrollTop = $(window).scrollTop();
if( $('.js-pagetop')[0] ) {
if (scrollTop > h / 2) {
$('.js-pagetop').addClass('is-active');
}
else {
$('.js-pagetop').removeClass('is-active');
}
}
if( $('.p-header')[0] ) {
if (scrollTop > h / 4) {
$('.p-header').addClass('is-black');
}
else {
$('.p-header').removeClass('is-black');
}
}
});
$(window).on('load', function() {
if( location.hash && $(location.hash)[0] ) {
var hash = location.hash;
console.log(hash);
setTimeout( function() {
$('body, html').animate({
scrollTop: $(hash).offset().top - $('.js-header').outerHeight() }, 300, 'linear');
}, 300 );
$('.p-gnav-link').each(function() {
if(location.href.indexOf($(this).attr('href')) > 0) {
$('.p-gnav-link').removeClass('is-active');
$(this).addClass('is-active');
}
});
if( $(location.hash).hasClass('js-accrodion-btn') ) {
$(location.hash).trigger('click');
}
}
loadContents();
$('.js-mheight').matchHeight();
$('.js-mheight2').matchHeight();
$('.js-mheight3').matchHeight();
});
function is_mobile() {
if (
(navigator.userAgent.indexOf('iPhone') > 0 && navigator.userAgent.indexOf('iPad') == -1) ||
navigator.userAgent.indexOf('iPod') > 0 ||
navigator.userAgent.indexOf('Android') > 0
) {
return true;
}
else {
return false;
}
}
function getParam(name, url) {
if (!url) url = window.location.href;
name = name.replace(/[[]]/g, '\\$&');
var regex = new RegExp('[?&]' + name + '(=([^]*)|&|#|$)'),
results = regex.exec(url);
if (!results) return null;
if (!results[2]) return '';
return decodeURIComponent(results[2].replace(/\+/g, ' '));
}
function loadContents() {
var content_show_timeout = ( location.hash && $(location.hash)[0] ) ? 300 : 200;
var animate_start_timeout = ( location.hash && $(location.hash)[0] ) ? 300 : 200;
setTimeout(function() {
$('body').attr('data-status', 'loaded');
$('.l-loader').hide();
}, content_show_timeout);
setTimeout(function() {
var timer = false;
$(window).on('scroll', function () {
eachAnimate();
if( timer !== false ){
clearTimeout( timer );
}
timer = setTimeout( function() {
eachAnimate();
}, 400 );
});
eachAnimate();
setTimeout( function() {
eachAnimate();
}, 400 );
if( $('.js-main-visual-slide')[0] && $('.p-main-visual-slide-item').length > 1) {
// eslint-disable-next-line no-undef
var mainVisualSwiper = new Swiper('.js-main-visual-slide .swiper-container', {
effect: 'fade',
fadeEffect: {
crossFade: true,
},
loop: true,
slidesPerView: 1,
speed: 2000,
autoplay: {
delay: 3000,
},
noSwiping: true,
on: {
slideChange: function () {
var mainTitle = $('.js-main-visual-ttl');
var classList = this.slides[this.activeIndex].classList.value;
mainTitle.removeClass('is-white');
if (classList && classList.indexOf('swiper-slide-white') >= 0) {
mainTitle.addClass('is-white');
}
},
},
});
}
if( $('.js-index-reason-slide')[0] && $('.p-index-reason-list-card').length > 1) {
var reasonSwiper = new Swiper('.js-index-reason-slide.swiper-container', {
effect: 'slide',
loop: true,
slidesPerView: 3.2,
centeredSlides : true,
speed: 1000,
pagination: {
el: '.js-index-reason-swiper-pagination',
clickable: true,
},
autoplay: {
delay: 5000,
disableOnInteraction: false,
},
spaceBetween: 32,
noSwiping: true,
breakpoints: {
1024: {
spaceBetween: 16,
slidesPerView: 1.2,
}
}
});
}
if( $('.p-index-plan-list')[0] && $('.p-index-plan-list-card').length > 1 && $(window).width() < 1024 ) {
var planSwiper = new Swiper('.js-index-plan-swiper', {
effect: 'slide',
loop: true,
slidesPerView: 1,
centeredSlides : true,
speed: 1000,
pagination: {
el: '.js-index-plan-swiper-pagination',
clickable: true,
},
autoplay: {
delay: 3000,
},
spaceBetween: 16,
noSwiping: true,
});
}
var window_width = window.innerWidth;
var plan_item_height = 0;
if(window_width < 768) {
$('.js-work-list-detail-txt-container').each(function(){
var item_height = $(this).outerHeight();
if(plan_item_height < item_height) {
plan_item_height = item_height;
}
});
$('.js-work-slider').outerHeight(plan_item_height + 170);
}
//plan
if( $('.js-work-slider-nav')[0] && $('.swiper-slide').length > 1) {
var plan_slider_nav = new Swiper('.js-work-slider-nav', {
direction: 'vertical',
slidesPerView: 4,
freeMode: true,
watchSlidesVisibility: true,
watchSlidesProgress: true,
navigation: {
nextEl: '.js-work-slider-nav-next',
prevEl: '.js-work-slider-nav-prev',
},
});
}
$('.js-slide-item').on('click',function(){
var position = $('#p-work-list-main').offset().top;
var header_height = $('.p-header').outerHeight();
//$('html,body').animate({scrollTop:position - header_height}, 500, 'swing');
})
//plan_main
if( $('.js-work-slider-nav')[0] && $('.swiper-slide').length > 1) {
var plan_slider = new Swiper('.js-work-slider', {
slidesPerView: 1,
spaceBetween: 305,
thumbs: {
swiper: plan_slider_nav,
clickable: true
},
navigation: {
nextEl: '.js-work-slider-nav-next',
prevEl: '.js-work-slider-nav-prev',
},
});
};
afterLoadFile('https://fonts.googleapis.com/css2?family=Lato:wght@400;700&family=Roboto:wght@500&display=swap', 'css');
afterLoadFile('https://use.fontawesome.com/releases/v5.6.1/css/all.css', 'css');
}, animate_start_timeout);
}
function rotate3d(elm) {
elm
.on('mouseenter', function(e) {
$(this)
.attr('data-hover', 'start')
.delay(200)
.queue(function(next) {
$(this).attr('data-hover', 'end'); next();
});
})
.on('mousemove', function(e) {
var offset = $(this).offset();
var ax = -( $(this).outerWidth() / 2 - (e.pageX - offset.left) ) / 15;
var ay = ( $(this).outerHeight() / 2 - (e.pageY - offset.top) ) / 30;
$(this).children().attr('style', 'transform: perspective(1000px) scale3d(1, 1, 1) rotateY('+ax+'deg) rotateX('+ay+'deg);-webkit-transform: perspective(1000px) scale3d(1, 1, 1) rotateY('+ax+'deg) rotateX('+ay+'deg);-moz-transform: perspective(1000px) scale3d(1, 1, 1) rotateY('+ax+'deg) rotateX('+ay+'deg)');
})
.on('mouseleave', function(e) {
$(this).children().attr('style', 'transform: perspective(1000px) scale3d(1, 1, 1) rotateY(0deg) rotateX(0deg);-webkit-transform: perspective(1000px) scale3d(1, 1, 1) rotateY(0deg) rotateX(0deg);-moz-transform: perspective(1000px) scale3d(1, 1, 1) rotateY(0deg) rotateX(0deg)');
});
}
function eachAnimate() {
$('.js-animate').each(function () {
var pos = $(this).offset().top;
var h = $(window).height();
var offset = ($(this).data('offset')) ? $(this).data('offset') : 200;
var scrollTop = $(window).scrollTop() + offset;
if (scrollTop > pos - h / 1.5) {
$(this).addClass('is-active');
$(this).removeClass('js-animate');
}
});
}
function afterLoadFile(src, type) {
if( type == 'js' ) {
$('body').append('');
}
else if( type == 'css' ) {
$('body').append('');
}
else {
return false;
}
}
function set_liquid_font_size(elm, parent, size) {
if (matchMedia('only screen and (min-width: 768px)').matches) {
var h = $(parent).outerHeight();
var percent = (h * (size / 100));
$(elm).css('font-size', percent + 'px');
} else {
$(elm).removeAttr('style');
}
}
//# sourceMappingURL=maps/main.js.map