');
// drawer.js
//$('.drawer').drawer();
$('.drawer-toggle').on('click', function () {
$('body').toggleClass('is-fixed');
});
// ヘッダー高さ取得・余白追加
headerHeight = $('#header').height();
$("main").css("padding-top", headerHeight + "px");
// News&Topics テキスト高さ取得
$('.news .nav-tabs .nav-link').on('click', function () {
const txtHeight = setTimeout(() => {
const $setPotion = $('.txtHeight');
if ($('.txtHeight').length) {
$('.txtHeight').matchHeight();
}
}, 200);
});
// カレント表示
/* $('.drawer-navbar .drawer-menu-item.current').removeClass('current');
$('.drawer-navbar .drawer-menu-item').filter(function () {
return $(this).prop('href') == location.href;
}).addClass('current'); */
// wow.js
wow = new WOW({
animateClass: 'animate__animated'
})
wow.init();
//scroll hint
window.onload = function() {
new ScrollHint('.js-scrollable', {
suggestiveShadow: false,
i18n: {
scrollable: 'スクロールできます'
}
});
}
});
jQuery(document).ready(function ($) {
$('.drawer').drawer();
$('a.drawer-dropdown-toggler').on('click', e => {
let item = $(e.currentTarget);
let p = item.parent();
let cn = p.attr('class');
if (cn.includes('open')) {
p.removeClass('open');
} else {
p.addClass('open');
}
});
});
// ===================================
// スムーズスクロール
// ===================================
jQuery(document).ready(function ($) {
//URLのハッシュ値を取得
var urlHash = location.hash;
//ハッシュ値があればページ内スクロール
if (urlHash) {
//スクロールを0に戻す
$('body,html').stop().scrollTop(0);
setTimeout(function () {
//ロード時の処理を待ち、時間差でスクロール実行
scrollToAnker(urlHash);
}, 100);
}
//通常のクリック時
$('a[href*="#"]').not('a.notscroll').click(function () {
var href = $(this).attr("href");
var pageURL = location.pathname;
reg = new RegExp(pageURL);
//ページ名が同じならスクロール移動
if (href.match(reg)) {
var clkUrl = href.split('#');
scrollToAnker("#" + clkUrl[1]);
} else {
scrollToAnker(href);
}
//リンク無効化
return false;
});
// 関数:スムーススクロール
// 指定したアンカー(#ID)へアニメーションでスクロール
function scrollToAnker(hash) {
var headerHeight = $('header').outerHeight();
var target = $(hash);
var position = target.offset().top - headerHeight;
$('body,html').stop().animate({ scrollTop: position }, 800, 'swing');
}
// トップへ戻る
var pagetop = $('#pagetop');
pagetop.click(function () {
$('body,html').animate({
scrollTop: 0
}, 800, 'swing');
return false;
});
// unitegallery.js
//$("#gallery").unitegallery();
});
// ===================================
// スライダー
// ===================================
jQuery(function($) {
$('.slick-slider').on('init', function () {
$('.slick-slider').addClass('initialized');
});
// メインビジュアル
$('.mv-slider').slick({
autoplay: true,
autoplaySpeed: 3000,
speed: 2000,
arrows: true,
infinite: true,
dots: true,
fade: true,
slidesToShow: 1,
slidesToScroll: 1,
focusOnSelect: true,
responsive: [{
breakpoint: 600,
settings: {
arrows: false,
}
}]
});
// グルメ&ショップ
$('.gourmetshop-slider').slick({
autoplay: true,
arrows: false,
infinite: true,
dots: false,
centerMode: true,
centerPadding: '10%',
slidesToShow: 3,
slidesToScroll: 1,
focusOnSelect: true,
responsive: [
{
breakpoint: 768,
settings: "unslick",
},
]
});
$(window).on("resize orientationchange", function () {
$(".gourmetshop-slider").slick("resize");
return false;
});
// オフィススライダー
$('.office-slider').slick({
arrows: false,
dots: true,
autoplay: true,
autoplaySpeed: 4000,
centerMode: true,
centerPadding: '30%',
slidesToShow: 1,
slidesToScroll: 1,
pauseOnFocus: false,
pauseOnHover: false,
responsive: [{
breakpoint: 769,
settings: {
centerPadding: '15%'
}
}]
});
$('.loop-slider').slick({
autoplay: true,
autoplaySpeed: 0,
speed: 5000,
cssEase: "linear",
slidesToShow: 4,
swipe: false,
arrows: false,
dots: false,
pauseOnFocus: false,
pauseOnHover: false,
responsive: [
{
breakpoint: 640,
settings: {
slidesToShow: 3,
}
}
]
});
// 商業施設スライダー
$('.commerce-slider').slick({
arrows: false,
dots: true,
autoplay: true,
autoplaySpeed: 4000,
centerMode: true,
centerPadding: '30%',
slidesToShow: 1,
slidesToScroll: 1,
pauseOnFocus: false,
pauseOnHover: false,
responsive: [{
breakpoint: 769,
settings: {
centerPadding: '15%'
}
}]
});
// 店舗詳細スライダー
$('.shopinfo-slider').slick({
autoplay: true,
autoplaySpeed: 4000,
arrows: false,
infinite: true,
dots: true,
slidesToShow: 1,
slidesToScroll: 1,
focusOnSelect: true,
});
// 貸し会議室
$('.conference-slider').slick({
autoplay: true,
autoplaySpeed: 4000,
speed: 2000,
arrows: false,
infinite: true,
dots: true,
fade: true,
slidesToShow: 1,
slidesToScroll: 1,
focusOnSelect: true,
responsive: [{
breakpoint: 600,
settings: {
arrows: false,
}
}]
});
// 貸し会議室/施設案内ページ
$('.hall-slider').slick({
arrows: false,
dots: true,
autoplay: true,
autoplaySpeed: 4000,
centerMode: true,
centerPadding: '30%',
infinite: true,
slidesToShow: 1,
slidesToScroll: 1,
responsive: [{
breakpoint: 769,
settings: {
centerMode: false,
centerPadding: '0'
}
}]
});
});
// ===================================
// 要素の高さ揃え / オブジェクトフィット処理
// ===================================
jQuery(function($) {
//要素の高さ揃え
if ($('.mHeight').length) {
$('.mHeight').matchHeight();
}
if ($('.ttlHeight').length) {
$('.ttlHeight').matchHeight();
}
if ($('.txtHeight').length) {
$('.txtHeight').matchHeight();
}
$(document).on('click', '.nav-tabs .nav-link', function () {
if ($('.ttlHeight').length) {
$('.ttlHeight').matchHeight();
}
});
//オブジェクトフィット処理
objectFitImages('img.object-fit-img');
});
jQuery(document).ready(function ($) {
if($('.js_syncTarget').length){
var myBreakPoint = 991;//ブレイクポイント
var target = $('.js_syncTarget');//高さをそろえたい要素の親要素
var target_c;//高さをそろえる要素
var group_amount;//高さを揃えたいグループの総数
var maxHeight = 0;//グループ内で最も高い要素を記憶する
function heightSync(target){
target.each(function(){
group_amount = $(this).data('group_amount');
for (var i = 0; i < group_amount; i++) {
maxHeight = 0;
// console.log(i);
target_c = $(this).find('.js_syncTarget_c.g' + (i + 1));
target_c.height('auto');
target_c.each(function(){
if($(this).height() > maxHeight) {
maxHeight = $(this).height();
}
});
target_c.height(maxHeight);
}
});
}
heightSync(target);
$(window).resize(function(){
var w = $(window).width();
if(w > myBreakPoint) {
heightSync(target);
} else {
$('.js_syncTarget_c').height('auto');
}
});
}
});
jQuery(function($) {
// マウスオーバー画像切り替え処理
$('img.js-img').each(function() {
var elem = $(this);
var offImg = $(this).attr('src');
var onImg = $(this).attr('src').replace('off', 'on');
elem.hover(
function () {
elem.attr('src', onImg).css('transition', '.5s');
},
function () {
elem.attr('src', offImg).css('transition', '.5s');
}
);
});
// 下層ページ 開閉コンテンツ
$('[class^="toggle_panel"]').children('tbody').children('tr').children('td:first-of-type').click(function () {
$(this).parent().next().children('td').slideToggle('slow');
$(this).children('h3').toggleClass('toggle_open');
});
});
// ===================================
// IE スムーススクロールチラつき処理
// ===================================
jQuery(function($) {
if (navigator.userAgent.match(/MSIE 10/i) || navigator.userAgent.match(/Trident\/7\./) || navigator.userAgent.match(/Edge\/12\./)) {
$('body').on("mousewheel", function () {
event.preventDefault();
var wd = event.wheelDelta;
var csp = window.pageYOffset;
window.scrollTo(0, csp - wd);
});
}
});
jQuery(function($) {
// フローティングバナークリック処理
$('.floating-toggle').on('click', function () {
$('.l-footer-floating').toggleClass('open');
});
if (window.matchMedia('(min-width: 768px)').matches) {
$("#js-floating").show();
$("#js-close-btn").click(function(){
$("#js-floating").fadeOut();
});
}
else {
$("#js-floating").hide();
}
// フローティングバナーフッター固定 余白自動追加(スマホ対応)
$(window).on('load resize', function(){
var height = $("#c-floating").height();
if (window.matchMedia('(min-width: 768px)').matches){
$(".copyright").css("padding-bottom", "0");
} else {
$(".copyright").css("padding-bottom", height + 20);
}
});
$(window).on('load resize', function(){
var height = $(".p-footer-floating").height();
if (window.matchMedia('(min-width: 768px)').matches){
$(".copyright").css("padding-bottom", "0");
} else {
$(".copyright").css("padding-bottom", height);
}
});
});
// ===================================
// トップページアニメーション
// ===================================
let images = [
'anima_icon01.svg',
'anima_icon02.svg',
'anima_icon03.svg',
'anima_icon04.svg',
'anima_icon05.svg',
'anima_icon06.svg',
'anima_icon07.svg',
'anima_icon08.svg',
'anima_icon09.svg',
];
for( let i = 10; i <= 133; i++ ){
images.push( 'anima_icon' + i + '.svg' );
}
function randIcon() {
return images[Math.floor(Math.random() * images.length)];
}
function animationIconInit() {
// グリーン&アートエリア 初期配置
for ( let i = 0; i < 50; i++ ){
// stateIcon();
var Rand = Math.round(Math.random() * (75000 - 500)) + 500;
(function animationIconLoop() {
setTimeout(function() {
animationIcon();
}, Rand);
}());
}
}
function stateIcon() {
jQuery( function($){
//縦横軸用の乱数生成
var x = Math.floor(Math.random() * 100);
var icon = $('
 + ')
').appendTo('.green-artarea');
});
}
function animationIcon() {
jQuery( function($){
//縦横軸用の乱数生成
var x = Math.floor(Math.random() * 100);
var Delay = Math.random() * 2.5;
var icon = $('
 + ')
')
.appendTo('.green-artarea');
var top = $("#animation-top").offset().top;
var bottom = $("#footer").offset().top;
var atop = bottom - top - 100;
icon.addClass('animation_icon_action').animate({
bottom: atop,
opacity: 0
}, 75000,
function(){
icon.remove();
animationIcon();
});
});
}