1"use strict"; 2 3function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } 4 5function _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } 6 7function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); return Constructor; } 8 9var FUJI = FUJI || { 10 data: { 11 url: '', 12 $body: $('body'), 13 $window: $(window), 14 $MQ: 'LANDSCAPE', 15 scrollTop: 0, 16 lockTop: 0, 17 winW: '', 18 winH: '', 19 jqXHR: '', 20 scrollTopflag: false, 21 transitonEnd: 'webkitTransitionEnd mozTransitionEnd msTransitionEnd oTransitionEnd transitionend', 22 animationStart: 'webkitAnimationStart mozAnimationStart msAnimationStart oAnimationStart animationStart', 23 animationEnd: 'webkitAnimationEnd mozAnimationEnd msAnimationEnd oAnimationEnd animationEnd' 24 }, 25 common: { 26 init: {} 27 } 28}; 29 30FUJI.common = function (pageScript) { 31 // ã³ã³ã¹ãã©ã¯ã¿ ================================================================= 32 function init(pageScript) { 33 setUtilityData(); 34 setBrowser(); 35 $('.anchorLink')[0] && initAnchorLink(); 36 initFloatButton(); 37 initNavLineup(); 38 initHeader(); 39 initModal(); 40 $('.js-buttonApp')[0] && initAppPopup(); 41 $('.js-scrollTableParent')[0] && initScrollbar(); 42 $('.js-priceZineTable_head')[0] && initZineTableHeading(); 43 $('.js-howtoInfo_text_trigger')[0] && initHowToAccordion(); 44 $('.js-fixedMakeButton')[0] && initFixedMakeButton(); 45 $('.js-canvaSlider')[0] && initCanvaSlide(); 46 pageScript && pageScript(); 47 } // public functions ========================================================== 48 49 /* 50 * UtilityDataã®åå¾ 51 * ç¹å®ãã¼ã¸ã®ã¿ã§ä½¿ç¨ãããã¼ã¿ã¯ãã¼ã¸JSã§åå¾ãããã¨ã 52 * 53 */ 54 55 56 function setUtilityData() { 57 FUJI.data.url = window.location.pathname; 58 getScrollTop(); 59 FUJI.data.$window.on('scroll', getScrollTop); 60 getWindowSize(); 61 FUJI.data.$window.on('resize', function () { 62 getWindowSize(); 63 }); 64 } 65 66 var scrollFlag = false; 67 68 function getScrollTop() { 69 if (!scrollFlag) { 70 requestAnimationFrame(function () { 71 scrollFlag = false; 72 FUJI.data.$window.trigger('scroll.custom'); 73 FUJI.data.scrollTop = FUJI.data.$window.scrollTop(); 74 }); 75 scrollFlag = true; 76 } 77 78 return true; 79 } 80 81 function getWindowSize() { 82 FUJI.data.winW = FUJI.data.$window.width(); 83 FUJI.data.winH = FUJI.data.$window.height(); 84 var cssContent = $('body').css('content'); 85 86 if (cssContent.indexOf('portrait') != -1) { 87 FUJI.data.$MQ = 'PORTRAIT'; 88 } else { 89 FUJI.data.$MQ = 'LANDSCAPE'; 90 } 91 92 if (FUJI.data.oldMQ && FUJI.data.oldMQ !== FUJI.data.$MQ) { 93 FUJI.data.$window.trigger('onBreakpointChange'); 94 } 95 96 FUJI.data.oldMQ = FUJI.data.$MQ; 97 } // HO TO USE 98 // FUJI.data.$window.on('onBreakpointChange', å®è¡æ); 99 100 /* 101 * 102 * ãã©ã¦ã¶å¤å® 103 * 104 */ 105 106 107 function setBrowser() { 108 FUJI.data.ua = { 109 Safari: typeof window.chrome == 'undefined' && 'WebkitAppearance' in document.documentElement.style, 110 Firefox: 'MozAppearance' in document.documentElement.style, 111 IE: window.navigator.userAgent.toLowerCase().indexOf('msie') !== -1 || window.navigator.userAgent.toLowerCase().indexOf('trident') !== -1, 112 IE9: window.navigator.appVersion.toLowerCase().indexOf('msie 9.') !== -1, 113 ltIE9: typeof window.addEventListener === 'undefined' && typeof document.getElementsByClassName === 'undefined', 114 Touch: typeof document.ontouchstart !== 'undefined', 115 Pointer: window.navigator.pointerEnabled, 116 MSPoniter: window.navigator.msPointerEnabled, 117 Windows: window.navigator.userAgent.toLowerCase().indexOf('win') !== -1, 118 Mac: window.navigator.userAgent.toLowerCase().indexOf('mac') !== -1, 119 Mobile: window.navigator.userAgent.toLowerCase().indexOf('iphone') > 0 || window.navigator.userAgent.toLowerCase().indexOf('ipod') > 0 || window.navigator.userAgent.toLowerCase().indexOf('android') > 0 && window.navigator.userAgent.toLowerCase().indexOf('mobile') > 0, 120 Tablet: window.navigator.userAgent.toLowerCase().indexOf('ipad') > 0 || window.navigator.userAgent.toLowerCase().indexOf('macintosh') > 0 && 'ontouchend' in document || window.navigator.userAgent.toLowerCase().indexOf('android') > 0 && window.navigator.userAgent.toLowerCase().indexOf('mobile') == -1 121 }; 122 123 if (FUJI.data.ua.Safari) { 124 $('html').addClass('safari'); 125 } 126 127 if (FUJI.data.ua.Firefox) { 128 $('html').addClass('firefox'); 129 } 130 131 if (FUJI.data.ua.IE) { 132 $('html').addClass('ie'); 133 } 134 135 if (FUJI.data.ua.IE9) { 136 $('html').addClass('ie9'); 137 } 138 139 if (FUJI.data.ua.ltIE9) { 140 $('html').addClass('ie8'); 141 } 142 143 if (FUJI.data.ua.Tablet) { 144 $('html').addClass('tablet'); 145 } 146 } // event functions ================================================================= 147 148 /* 149 * 150 * ã¢ã³ã«ã¼ãªã³ã¯ 151 * 152 */ 153 154 155 function initAnchorLink() { 156 $('.anchorLink').on('click', function () { 157 var href = $(this).attr("href"), 158 headerH = FUJI.data.$MQ == 'LANDSCAPE' ? 80 : 50, 159 target = $(href === "#" || href === "" ? 'html' : href), 160 offset = target.offset().top - headerH; 161 $('html, body').animate({ 162 scrollTop: offset 163 }, 500); 164 return false;
165 }); 166 } // ãã¼ã¸ãã¨èªã¿è¾¼ã¿ event functions ========================================================== 167 168 /* 169 * 170 * 171 * ã¹ãã¬ã¼ã¸ setã»get 172 * 173 */ 174 // ã»ãã·ã§ã³ã¹ãã¬ã¼ã¸ - ã»ãã 175 176 177 function setSessionStrage(key, value) { 178 if (!window.sessionStorage) return; 179 180 try { 181 sessionStorage.setItem(key, value); 182 } catch (err) {} 183 } // ãã¼ã«ã«ã¹ãã¬ã¼ã¸ - ã»ãã 184 185 186 function setLocalStrage(key, value) { 187 if (!window.localStorage) return; 188 189 try { 190 localStorage.setItem(key, value); 191 } catch (err) {} 192 } // ã»ãã·ã§ã³ã¹ãã¬ã¼ã¸ - ã²ãã 193 194 195 function getSessionStrage(targetStrage) { 196 var strage; 197 if (!window.sessionStorage) return; 198 199 try { 200 strage = window.sessionStorage.getItem(targetStrage); 201 } catch (err) {} 202 203 return strage; 204 } // ãã¼ã«ã«ã¹ãã¬ã¼ã¸ - ã²ãã 205 206 207 function getLocalStrage(targetStrage) { 208 var strage; 209 if (!window.localStorage) return; 210 211 try { 212 strage = window.localStorage.getItem(targetStrage); 213 } catch (err) {} 214 215 return strage; 216 } 217 /* 218 * 219 * ç»åèªã¿è¾¼ã¿æ°ã«ã¦ã³ã¿ 220 * @target - jQueryãªãã¸ã§ã¯ãã§æå®ãæå®ãããè¦ç´ å ã®imgã®ãã¼ããç£è¦ããã 221 * promiseãè¿ãã®ã§ãæ»ãå¤ã«å¯¾ãã¦.doneã§ã³ã¼ã«ããã¯ãå®è£ ããã 222 */ 223 224 225 function countImgLoaded(target, runnninng) { 226 var deferred = new $.Deferred(); 227 var $img = target ? target.find('img') : $('img'); 228 var total = $img.length; 229 var count = 0; 230 $img.each(function () { 231 var myImg = new Image(); 232 myImg.src = $(this).attr('src'); 233 234 myImg.onload = function () { 235 count++; 236 var progress = count / total; 237 238 if (runnninng) { 239 runnninng(progress); 240 } 241 242 if (count >= total) { 243 deferred.resolve(); 244 } 245 }; 246 247 myImg.onerror = function () { 248 deferred.reject(); 249 }; 250 }); 251 return deferred.promise(); 252 } 253 /* 254 * ã¹ã¯ãã¼ã«ãã㯠255 * 256 */ 257 258 259 function screenLock() { 260 $('html').addClass('scrollLock'); 261 } 262 263 ; 264 265 function screenUnlock() { 266 $('html').removeClass('scrollLock'); 267 } 268 269 ; 270 /* 271 * ããã©ãããã¯ãä½ãã追å¾ãã¿ã³ã»ããã¼ã®å¶å¾¡ 272 * 273 */ 274 275 var floatButtonTimer; 276 277 function initFloatButton() { 278 // FUJI.data.$window.on('scroll', judgeFloatButtonVisualable); 279 // judgeFloatButtonVisualable(); 280 $('.js-fixedBannerClose').on('click', closeFloatButton); 281 } 282 283 ; 284 285 function judgeFloatButtonVisualable() { 286 var fixedBannerVisualableStatus = getSessionStrage('closeFloatButton'); 287 clearTimeout(floatButtonTimer); 288 $('.js-floatButton').removeClass('is-show'); // $('.js-fixedBanner').removeClass('is-show'); 289 290 floatButtonTimer = setTimeout(function () { 291 $('.js-floatButton').addClass('is-show'); 292 if (fixedBannerVisualableStatus) return; 293 $('.js-fixedBanner').addClass('is-show'); 294 }, 2000); 295 } 296 297 function closeFloatButton() { 298 // setSessionStrage('closeFloatButton', 'true'); 299 $('.js-fixedBanner').removeClass('is-show'); 300 } 301 /* 302 * ååç´¹ä»ããã¼ã®ã¡ãã¥ã¼éé 303 * 304 */ 305 306 307 var $headerNavParent = $('.js-headerTop_navParent'), 308 $headerNavLink = $('.js-headerTop_navLink'), 309 $headerNavChild = $('.js-headerTop_navChild'); 310 311 function initNavLineup() { 312 $headerNavLink.on('mouseenter', addClassNavLineup); 313 $headerNavChild.on('mouseenter', addClassNavLineup); 314 $headerNavLink.on('mouseleave', removeClassNavLineup); 315 $headerNavChild.on('mouseleave', removeClassNavLineup); 316 $headerNavLink.on('click', changeClassNavLineup); 317 } 318 319 function addClassNavLineup() { 320 if (!FUJI.data.ua.Tablet && FUJI.data.$MQ == 'LANDSCAPE') { 321 $(this).parents('.js-headerTop_navParent').addClass('is-open'); 322 } 323 } 324 325 function removeClassNavLineup() { 326 if (!FUJI.data.ua.Tablet && FUJI.data.$MQ == 'LANDSCAPE') { 327 $headerNavParent.removeClass('is-open'); 328 } 329 } 330 331 function changeClassNavLineup() { 332 if ($headerNavParent.hasClass('is-open')) { 333 $headerNavParent.removeClass('is-open'); 334 } else { 335 $(this).parents('.js-headerTop_navParent').addClass('is-open'); 336 } 337 } 338 /* 339 * ã¢ããªå°ç·éé 340 * 341 */ 342 343 344 var $appButton = $('.js-buttonApp'), 345 $appCloseButton = $('.js-appPopup_close'); 346 347 function initAppPopup() { 348 $appButton.on('click', showAppPopup); 349 $appCloseButton.on('click', hideAppPopup); 350 $appButton.on('mouseenter', changeAppPopupStatusPc); 351 $appButton.on('mouseleave', changeAppPopupStatusPc); 352 } 353 354 function showAppPopup() { 355 if (!FUJI.data.ua.Tablet && FUJI.data.$MQ == 'LANDSCAPE') return; 356 changeAppPopupStatus(this); 357 } 358 359 function hideAppPopup() { 360 if (!FUJI.data.ua.Tablet && FUJI.data.$MQ == 'LANDSCAPE') return; 361 var $target = $(this).parents('.js-buttonApp'); 362 $target.removeClass('is-open'); 363 return false;
364 } 365 366 function changeAppPopupStatus(target) { 367 if ($(target).hasClass('is-open')) { 368 $(target).removeClass('is-open'); 369 } else { 370 $(target).addClass('is-open'); 371 } 372 } 373 374 function changeAppPopupStatusPc() { 375 if (!FUJI.data.ua.Tablet && FUJI.data.$MQ == 'LANDSCAPE') { 376 changeAppPopupStatus(this); 377 } 378 379 ; 380 } 381 /* 382 * ãããã¼ 383 * 384 */ 385 386 387 var $header = $('.js-header'), 388 $headerMenuTrigger = $('.js-headeMenuTrigger'); 389 390 function initHeader() { 391 $headerMenuTrigger.on('click', changeHeaderStatus); 392 FUJI.data.$window.on('scroll', changeHeaderBackground); 393 FUJI.data.$window.on('scroll', toggleHeaderOnScroll); // design_template ã®ã¨ãã¯åæç¶æ ã§ãããã¼ãé表示 394 395 if (FUJI.data.$body.attr('data-current') === 'design_template') { 396 $header.addClass('is-hidden'); // $header.css('display', 'none'); 397 } 398 } 399 /* ãããã¼éé */ 400 401 402 function changeHeaderStatus() { 403 if ($header.hasClass('is-open')) { 404 $header.removeClass('is-open'); 405 FUJI.common.screenUnlock(); 406 } else { 407 $header.addClass('is-open'); 408 FUJI.common.screenLock(); 409 } 410 } 411 /* ãããã¼ã¹ã¯ãã¼ã«ã«å¿ãã¦åãæ¿ã */ 412 413 414 function changeHeaderBackground() { 415 if (FUJI.data.scrollTop > FUJI.data.winH) { 416 $header.addClass('is-background'); 417 } else { 418 $header.removeClass('is-background'); 419 } 420 }
421 /* ã¹ã¯ãã¼ã«æ¹åã«å¿ãã¦ã表示åãæ¿ã */ 422 423 424 var lastScrollPosition = 0; 425 426 function toggleHeaderOnScroll() { 427 if (FUJI.data.scrollTop > lastScrollPosition) { 428 // ä¸ã¹ã¯ãã¼ã«æ 429 $header.addClass('is-hidden'); // design_template ã®ã¨ã㯠fixedNav ã®ã¹ã¯ãã¼ã«ç¶æ ãè§£é¤ 430 431 if (FUJI.data.$body.attr('data-current') === 'design_template') { 432 $('.fixedNav').removeClass('is-scroll'); // design_template ã§ã¯å®å ¨ã«é表示 433 434 $header.addClass('is-hidden'); 435 } 436 } else { 437 // ä¸ã¹ã¯ãã¼ã«æ 438 $header.removeClass('is-hidden'); // design_template ã®ã¨ã㯠fixedNav ã«ã¹ã¯ãã¼ã«ç¶æ ãä»ä¸ 439 440 if (FUJI.data.$body.attr('data-current') === 'design_template') { 441 $('.fixedNav').addClass('is-scroll'); // design_template ã§ã¯è¡¨ç¤º 442 443 $header.removeClass('is-hidden'); 444 } 445 } 446 447 lastScrollPosition = FUJI.data.scrollTop; 448 } 449 /* 450 * ãããã¼ 451 * 452 */ 453 454 455 var $fixedMakeButton = $('.js-fixedMakeButton'); 456 var $windowGhostDetector = $('.js-windowEdgeDetector'); 457 var $footer = $('.js-footer'); 458 459 function initFixedMakeButton() { 460 FUJI.data.$window.on('scroll', toggleFixedMakeButtonOnScroll); 461 $windowGhostDetector.on('mouseenter', toggleFixedMakeButtonOnMouseEnter); // $windowGhostDetector.on('mouseleave', toggleFixedMakeButtonOnMouseEnter); 462 } 463 464 function toggleFixedMakeButtonOnScroll() { 465 if (FUJI.data.scrollTop < 100 || FUJI.data.scrollTop > $footer.position().top - FUJI.data.winH) { 466 $fixedMakeButton.addClass('is-hidden'); 467 $windowGhostDetector.addClass('is-hidden'); 468 } else { 469 $fixedMakeButton.removeClass('is-hidden'); 470 $windowGhostDetector.removeClass('is-hidden'); 471 } 472 } 473 474 function toggleFixedMakeButtonOnMouseEnter() { 475 $header.removeClass('is-hidden'); 476 } 477 /* 478 * ã¢ã¼ãã«ã®éé 479 * 480 */ 481 482 483 var $modal = $('.js-modal'), 484 $modalTrigger = $('.js-modalTrigger'), 485 $modalCloseButton = $('.js-modalCloseButton'), 486 $modalBackground = $('.js-modalBackground'), 487 $modalScrollWrapper = $('.js-modalScrollWrapper'), 488 $modalTriggerResponsive = $('.js-modalTriggerResponsive'); 489 490 function initModal() { 491 $modalTrigger.on('click', openHeaderStatus); 492 $modalCloseButton.on('click', closeHeaderStatus); 493 $modalBackground.on('click', closeHeaderStatus); 494 $modalTriggerResponsive.on('click', modalJudgePerDevice); 495 } 496 497 function openHeaderStatus(_this) { 498 var $_this = $(this).length ? $(this) : _this, 499 targetModalContent = $_this.attr('data-target'), 500 $targetModal = $(".js-modal[data-content=\"".concat(targetModalContent, "\"]")); 501 $modalScrollWrapper.scrollTop(0); 502 $modal.removeClass('is-show'); 503 $targetModal.addClass('is-show'); 504 FUJI.common.screenLock(); 505 /* ãããã¼ãéãã¦ãããéãã */ 506 507 if ($header.hasClass('is-open')) { 508 $header.removeClass('is-open'); 509 } 510 } 511 512 function closeHeaderStatus() { 513 $modal.removeClass('is-show'); 514 FUJI.common.screenUnlock(); 515 } 516 517 function modalJudgePerDevice() { 518 var linkType = $(this).attr('data-type'); 519 520 switch (linkType) { 521 case 'pc-link_sp-modal': 522 if (FUJI.data.$MQ == 'LANDSCAPE') { 523 if ($(this).attr('data-link-target') == '_blank') { 524 window.open($(this).attr('data-link'), '_blank'); 525 } else { 526 location.href = $(this).attr('data-link'); 527 } 528 } else { 529 openHeaderStatus($(this)); 530 } 531 532 break; 533 534 case 'link': 535 var link = FUJI.data.$MQ == 'PORTRAIT' ? $(this).attr('data-sp-link') : $(this).attr('data-link'); 536 537 if ($(this).attr('data-link-target') == '_blank') { 538 window.open(link, '_blank'); 539 } else { 540 location.href = link; 541 } 542 543 break; 544 } 545 } 546 /* 547 * inviewã®ã¤ã³ã¹ã¿ã³ã¹çæ 548 * 549 * 550 */ 551 552 553 var initInView = function initInView() { 554 $('.js-inview').each(function (i) { 555 var inviewObj = new inview(i, $(this)); 556 inviewObj.init(); 557 }); 558 }; 559 /* 560 * ã¡ã¤ã³ãã¸ã¥ã¢ã«ã®é«ãèª¿æ´ 561 * 562 * 563 */ 564 565 566 function initMainvisual() { 567 FUJI.data.$window.on('load resize onBreakpointChange', setMainvisual); 568 } 569 570 function setMainvisual() { 571 if (FUJI.data.$MQ == 'LANDSCAPE') { 572 if (FUJI.data.$body.attr('data-current') == 'top') { 573 $('.js-mainvisual_img').css({ 574 'height': "".concat(FUJI.data.winW * 0.5, "px") 575 }); 576 } else { 577 $('.js-mainvisual_img').css({ 578 'height': "".concat(FUJI.data.winH, "px") 579 }); 580 } 581 } else { 582 $('.js-mainvisual_img').css({ 583 'height': '' 584 }); 585 } 586 } 587 /* 588 * ã©ã¤ã³ãããã®ã¹ã©ã¤ãã¼ 589 * 590 * 591 */ 592 593 594 var lineupMainSlide;
595 596 function initLineupMainSlide() { 597 setLineupMainSlideNumber(); 598 setLineupMainSlide(); 599 FUJI.data.$window.on('load', function () { 600 setLineupMainSlideDots(); 601 setLineupMainSlideInfoMinHeight(); 602 }); 603 FUJI.data.$window.on('resize onBreakpointChange', function () { 604 resetLineupMainSlide(); 605 }); 606 } 607 /*ãã¹ã©ã¤ãã¼ç·æ°ã®æ´æ° */ 608 609 610 function setLineupMainSlideNumber() { 611 var sliderTotalLength = $('.js-life_thumnail_node').length; 612 $('.js-slideTotal').text(sliderTotalLength); 613 } 614 615 function setLineupMainSlide() { 616 var lineupMainOption = setOptionLineupMainSlide(); 617 lineupMainSlide = $('.js-lineup_mainSlide').slick(lineupMainOption); 618 $('.js-life_thumnail_node').on('click', changeLineupMainSlide); 619 lineupMainSlide.on('beforeChange', changeSlideCurrentNumber); 620 lineupMainSlide.on('setPosition', function () { 621 setLineupMainSlideDots(); 622 setLineupMainSlideInfoMinHeight(); 623 }); 624 } 625 /* ãããã®é ç½®èª¿æ´ */ 626 627 628 var lineupMainSlideMinHeight = 0; 629 630 function setLineupMainSlideDots() { 631 setLineupMainSlideTextMinHeight(); 632 var textWrapWidth = $('.js-lineupInfo_textWrap').width(); 633 var dotsHeight = $('.js-slideDots').height(); 634 var dotsPositionBottom = (lineupMainSlideMinHeight - dotsHeight) / 2; 635 636 if (FUJI.data.$MQ == 'LANDSCAPE') { 637 $('.js-lineupController').css({ 638 'bottom': "".concat(dotsPositionBottom, "px") 639 }); 640 } else { 641 $('.js-lineupController').css({ 642 'bottom': '' 643 }); 644 } 645 } 646 647 function setLineupMainSlideInfoMinHeight() { 648 var slideImgHeight = $('.js-lineup_mainSlide_img').height(); 649 650 if (FUJI.data.$MQ == 'LANDSCAPE') { 651 $('.js-lineup_mainSlide_info').css({ 652 'min-height': "".concat(slideImgHeight, "px") 653 }); 654 } else { 655 $('.js-lineup_mainSlide_info').css({ 656 'min-height': "" 657 }); 658 } 659 } 660 661 function setOptionLineupMainSlide() { 662 var lineupMainSlideOption = { 663 lazyLoad: 'progressive', 664 slidesToShow: 1, 665 autoplay: true, 666 autoplaySpeed: 4000, 667 centerPadding: '0', 668 arrows: true, 669 speed: 600, 670 dots: true, 671 pauseOnFocus: false, 672 focusOnSelect: false, 673 pauseOnHover: false, 674 adaptiveHeight: true, 675 appendArrows: $('.js-slideArrow'), 676 appendDots: $('.js-slideDots') 677 }; 678 return lineupMainSlideOption; 679 } 680 681 function resetLineupMainSlide() { 682 var lineupMainOption = setOptionLineupMainSlide(); 683 lineupMainSlide.slick('slickSetOption', lineupMainOption); 684 } 685 686 function changeLineupMainSlide() { 687 var targetIndex = $(this).attr('data-slide-index'); 688 689 if (!$(this).hasClass('is-current')) { 690 $('.js-life_thumnail_node').removeClass('is-current'); 691 $(this).addClass('is-current'); 692 lineupMainSlide.slick('slickGoTo', targetIndex); 693 } 694 } 695 /*ãã¹ã©ã¤ãã¼ã«ã¬ã³ãæ°å¤ã®æ´æ° */ 696 697 698 function changeSlideCurrentNumber(event, slick, currentSlide, nextSlide) { 699 var nextSlideNumber = nextSlide + 1; 700 $('.js-slideCurrent').text(nextSlideNumber); 701 $('.js-life_thumnail_node').removeClass('is-current'); 702 $(".js-life_thumnail_node[data-slide-index=\"".concat(nextSlide, "\"]")).addClass('is-current'); 703 } 704 705 function setLineupMainSlideTextMinHeight() { 706 $('.js-lineupInfo_textWrap').each(function (index, target) { 707 var targetHeight = $(target).outerHeight(); 708 709 if (index == 0 || lineupMainSlideMinHeight > targetHeight) { 710 lineupMainSlideMinHeight = targetHeight; 711 } 712 }); 713 } 714 715 var lineupSlide = []; 716 717 function initLineupSlide() { 718 var lineupSlideOption = { 719 lazyLoad: 'progressive', 720 slidesToShow: 1, 721 autoplay: false, 722 centerPadding: '0', 723 arrows: true, 724 speed: 600, 725 dots: true, 726 pauseOnFocus: false, 727 focusOnSelect: false, 728 pauseOnHover: false 729 }; 730 $('.js-lineupSlide').each(function (i, element) { 731 lineupSlide[i] = $(element).slick(lineupSlideOption); 732 }); 733 } 734 /* 735 * FAQã¢ã³ã¼ãã£ãªã³ 736 * 737 * 738 */ 739 740 741 function initFaq() { 742 $('.js-faq').each(function () { 743 var faqObj = new Faq($(this)); 744 faqObj.init(); 745 }); 746 } 747 /* 748 * 749 * ã¹ã¯ãã¼ã«ãã¼ã®å®ç¾© 750 * 751 */ 752 753 754 var scrollObj = []; 755 756 function initScrollbar() { 757 $('.js-scrollTableParent').each(function (i) { 758 scrollObj[i] = new scrollbar($(this)); 759 scrollObj[i].init(); 760 }); 761 } 762 /*================================== 763 ã¹ã¯ãã¼ã«ãã¼ã®å®ç¾© 764 ==================================*/ 765 766 767 var scrollbar = /*#__PURE__*/function () { 768 function scrollbar(target) { 769 _classCallCheck(this, scrollbar); 770 771 this.target = target; 772 this.name = this.target.attr('data-target'); 773 this.scrollBox = this.target.find('.js-scrollOuter'); 774 this.scrollWrap = this.target.find('.js-scrollWrap'); 775 this.tableHead = this.target.find('.js-tableList_head'); 776 this.scrollBarWrap = this.target.find('.js-scrollBarWrap'); 777 this.scrollBar = this.target.find('.js-scrollBar'); 778 this.scrollBarTrack = this.target.find('.js-scrollbarThumb'); 779 this.touchEventOptions = { 780 passive: false 781 }; 782 this.startX = 0; 783 this.moveX = false;
784 this.touchFlag = false; 785 this.threshold = 20; 786 this.scrollingBoxWidth = 0; 787 this.scrollingWrapWidth = 0; 788 this.scrollingBoxInnerWidth = 0; 789 this.tabelHeadHeight = 0; 790 this.tabelHeadLabelHeight = 50; 791 this.tabelHeadWidth = 0; 792 this.scrollbarWidth = 0; 793 this.scrollbarTrack = 0; 794 this.scrollbarThumbWidth = 0; 795 this.basebarPosition = 0; 796 this.barScrollLeft = 0; 797 } 798 799 _createClass(scrollbar, [{ 800 key: "init", 801 value: function init() { 802 var _this = this; 803 804 _this.setScrollbarData(); 805 806 _this.scrollEventAction(); 807 808 this.baseEvent(); // this.touchEvent(); 809 } 810 }, { 811 key: "baseEvent", 812 value: function baseEvent() { 813 var _this = this; 814 815 FUJI.data.$window.on('load', function () { 816 _this.setScrollbarData(); 817 }); 818 FUJI.data.$window.on('resize', function () { 819 _this.setScrollbarData(); 820 }); 821 this.scrollBox.on('scroll', function () { 822 _this.scrollEventAction(); 823 }); 824 } 825 }, { 826 key: "setScrollbarData", 827 value: function setScrollbarData() { 828 // ãã¼ãã«ã®ãããã¼ã®é«ãããªã»ãã 829 this.tableHead.css({ 830 'padding-top': 0, 831 'padding-bottom': 0 832 }); 833 this.tabelHeadHeight = this.tableHead.outerHeight(); 834 var tabelHeadPadding = (this.tabelHeadHeight - this.tabelHeadLabelHeight) / 2; // ãã¼ãã«ã®ãããã¼ã®ã¿ã¤ãã«é¨åpaddingãã»ããï¼iOS対å¿ï¼ 835 836 this.tableHead.css({ 837 'padding-top': tabelHeadPadding, 838 'padding-bottom': tabelHeadPadding 839 }); 840 if (FUJI.data.$MQ == 'LANDSCAPE') return; // åç¨®å¤æ°ã®ä»£å ¥ 841 842 this.scrollingBoxWidth = this.scrollBox.width(); 843 this.scrollingWrapWidth = this.scrollWrap.width(); 844 this.scrollingBoxInnerWidth = this.scrollBox.get(0).scrollWidth; 845 this.scrollbarWidth = this.scrollBar.width(); 846 this.tabelHeadWidth = this.tableHead.width(); 847 this.scrollbarTrack = this.scrollingBoxInnerWidth - this.scrollingBoxWidth; 848 this.scrollbarThumbWidth = parseInt((this.scrollingBoxWidth - this.tabelHeadWidth) * this.scrollbarWidth / this.scrollingBoxInnerWidth); 849 this.scrollBarTrack.css('width', this.scrollbarThumbWidth); 850 851 if (this.scrollingBoxWidth < this.scrollingWrapWidth) { 852 if (this.scrollBarWrap.is(':visible')) return; 853 this.scrollBarWrap.show(); 854 } else { 855 if (this.scrollBarWrap.is(':hidden')) return; 856 this.scrollBarWrap.hide(); 857 } 858 } 859 }, { 860 key: "scrollEventAction", 861 value: function scrollEventAction() { 862 if (FUJI.data.$MQ == 'LANDSCAPE') return; 863 var scrollbarTrackWidth = this.scrollbarWidth - this.scrollbarThumbWidth; 864 this.barScrollLeft = this.scrollBox.scrollLeft() / (this.scrollingBoxInnerWidth - this.scrollingBoxWidth) * scrollbarTrackWidth; 865 this.changeScrollbar(); 866 } 867 }, { 868 key: "changeScrollbar", 869 value: function changeScrollbar() { 870 this.scrollBarTrack.css('transform', "translate(".concat(this.barScrollLeft, "px, 0)")); 871 } 872 }]); 873 874 return scrollbar; 875 }(); 876 /* 877 * 878 * ä½ãæ¹ã¹ã©ã¤ãã¼ 879 * 880 */ 881 882 883 function initStepSlider() { 884 var activeIndex = FUJI.data.$MQ == 'LANDSCAPE' ? 0 : 1; 885 $(".js-stepSliderWrap").not(":eq(".concat(activeIndex, ")")).hide(); 886 $('.js-stepSliderSwitchParent').attr('data-index', activeIndex); 887 $('.js-stepSliderSwitch').click(changeStepSlider); 888 $('.js-stepSliderWrap').each(function () { 889 var $sliderObj = new StepSlider($(this)); 890 $sliderObj.init(); 891 }); 892 } 893 894 function changeStepSlider() { 895 var $self = $(this); 896 var index = $self.index(); 897 var $target = $(".js-stepSliderWrap").eq(index); 898 $(".js-stepSliderWrap").hide(); 899 $target.stop(true, true).fadeIn(300); 900 $('.js-stepSliderSwitchParent').attr('data-index', index); 901 $('.js-stepSliderTop').slick('setPosition'); 902 $('.js-stepSliderDesc').slick('setPosition'); 903 } 904 905 var StepSlider = /*#__PURE__*/function () { 906 function StepSlider(target) { 907 _classCallCheck(this, StepSlider); 908 909 this.target = target; 910 this.mainSlider = this.target.find('.js-stepSliderTop'); 911 this.mainSliderNode = this.mainSlider.find('.js-stepSliderTopNode'); 912 this.descSlider = this.target.find('.js-stepSliderDesc'); 913 this.controlArrow = this.target.find('.js-stepSliderControlArrow'); 914 this.sliderIndex = this.target.find('.js-stepSliderIndex'); 915 this.sliderIndexNode = this.target.find('.js-stepSliderIndex > li'); 916 this.totalCount = this.target.find('.js-stepSliderTotal'); 917 this.currentCount = this.target.find('.js-stepSliderCurrent'); 918 this.mainSliderOpt = { 919 'lazyLoad': 'progressive', 920 'infinite': false, 921 'adaptiveHeight': true, 922 appendArrows: this.controlArrow, 923 asNavFor: this.descSlider 924 }; 925 this.descSliderOpt = { 926 'lazyLoad': 'progressive', 927 'infinite': false, 928 'fade': true, 929 'adaptiveHeight': true, 930 'arrow': false, 931 asNavFor: this.mainSlider 932 }; 933 } 934 935 _createClass(StepSlider, [{ 936 key: "init",
937 value: function init() { 938 var _this = this; 939 940 _this.totalCount.text(_this.mainSliderNode.length); 941 942 _this.mainSlider.slick(_this.mainSliderOpt).on('beforeChange', function (event, slick, currentSlide, nextSlide) { 943 _this.toggleCurrent(nextSlide); 944 }); 945 946 _this.descSlider.slick(_this.descSliderOpt); 947 948 _this.sliderIndexNode.on('click', function (e) { 949 var $self = $(e.currentTarget); 950 var index = $self.attr('data-start-index'); 951 952 _this.mainSlider.slick('slickGoTo', index); 953 954 _this.toggleCurrent(index); 955 }); 956 957 _this.mainSlider.slick('slickGoTo', 0); 958 } 959 }, { 960 key: "toggleCurrent", 961 value: function toggleCurrent(index) { 962 this.sliderIndexNode.css('--percentage', ''); 963 var $nextSlide = this.mainSliderNode.eq(index); 964 var title = $nextSlide.attr('data-title'); 965 var order = $nextSlide.attr('data-order'); 966 var stepPerTarget = $nextSlide.attr('data-stepPerTarget'); 967 var $target = this.sliderIndex.find("[data-title=\"".concat(title, "\"]")); 968 var navIndex = $target.index() + 1; 969 var stepTotal = $target.data('stepTotal'); 970 this.currentCount.text(order); 971 this.sliderIndex.attr('data-current', navIndex); 972 $target.css('--percentage', stepPerTarget / stepTotal); 973 } 974 }]); 975 976 return StepSlider; 977 }(); 978 /* 979 * 980 * Canvaã¹ã©ã¤ãã¼ 981 * 982 */ 983 984 985 function initCanvaSlide() { 986 $('.js-canvaSlider').slick({ 987 fade: true, 988 slidesToShow: 1, 989 slidesToScroll: 1, 990 autoplay: true, 991 autoplaySpeed: 3000, 992 speed: 1000, 993 arrows: false, 994 dots: false, 995 pauseOnHover: false, 996 pauseOnFocus: false, 997 draggable: false, 998 swipe: false 999 }); 1000 } 1001 /* 1002 * 1003 * ä½ãæ¹ ã¢ã³ã¼ãã£ãªã³ 1004 * 1005 */ 1006 1007 1008 function initHowToAccordion() { 1009 $('.js-howtoInfo_text_trigger').on('click', judgeAccordionVisible); 1010 } 1011 1012 function judgeAccordionVisible() { 1013 if ($('.js-howtoInfo').hasClass('is-open')) { 1014 $('.js-howtoInfo').removeClass('is-open'); 1015 $('.js-howtoInfo_note').hide(); 1016 } else { 1017 $('.js-howtoInfo').addClass('is-open'); 1018 $('.js-howtoInfo_note').show(); 1019 } 1020 } 1021 /* 1022 * 1023 * Zineãã¼ãã«ã®è¦åºãã®ã¹ã¿ã¤ã«èª¿æ´ï¼landscapeï¼ 1024 * 1025 */ 1026 1027 1028 var $zinTableHead = $('.js-priceZineTable_head'); 1029 1030 function initZineTableHeading() { 1031 FUJI.data.$window.on('load', setZineTableHeadingData); 1032 FUJI.data.$window.on('resize', setZineTableHeadingData); 1033 } 1034 1035 function setZineTableHeadingData() { 1036 // ãã¼ãã«ã®ãããã¼ã®é«ãããªã»ãã 1037 $zinTableHead.css({ 1038 'padding-top': 0, 1039 'padding-bottom': 0 1040 }); 1041 var zineTabelHeadHeight = $zinTableHead.outerHeight(); 1042 var zineTabelHeadPadding = (zineTabelHeadHeight - 50) / 2; // ãã¼ãã«ã®ãããã¼ã®ã¿ã¤ãã«é¨åpaddingãã»ããï¼iOS対å¿ï¼ 1043 1044 $zinTableHead.css({ 1045 'padding-top': zineTabelHeadPadding, 1046 'padding-bottom': zineTabelHeadPadding 1047 }); 1048 } 1049 1050 return { 1051 setSessionStrage: setSessionStrage, 1052 setLocalStrage: setLocalStrage, 1053 getSessionStrage: getSessionStrage, 1054 getLocalStrage: getLocalStrage, 1055 countImgLoaded: countImgLoaded, 1056 screenLock: screenLock, 1057 screenUnlock: screenUnlock, 1058 initMainvisual: initMainvisual, 1059 initInView: initInView, 1060 initLineupMainSlide: initLineupMainSlide, 1061 initLineupSlide: initLineupSlide, 1062 initFaq: initFaq, 1063 initStepSlider: initStepSlider, 1064 init: init 1065 }; 1066}(); 1067/*================================== 1068 1069Faqã®ã¯ã©ã¹å®ç¾© 1070 1071==================================*/ 1072 1073 1074var Faq = /*#__PURE__*/function () { 1075 function Faq(target) { 1076 _classCallCheck(this, Faq); 1077 1078 this.target = target; 1079 this.head = this.target.find('.js-faqHead'); 1080 this.body = this.target.find('.js-faqBody'); 1081 this.openClass = 'is-open'; 1082 } 1083 1084 _createClass(Faq, [{ 1085 key: "init", 1086 value: function init() { 1087 var _this2 = this; 1088 1089 this.head.on('click', function () { 1090 return _this2.toggleFaq(); 1091 }); 1092 } 1093 }, { 1094 key: "toggleFaq", 1095 value: function toggleFaq() { 1096 if (this.body.is(':animated')) return; 1097 this.head.toggleClass(this.openClass); 1098 this.body.slideToggle('fast'); 1099 } 1100 }]); 1101 1102 return Faq; 1103}(); 1104/*================================== 1105 1106ãinviewã®ã¯ã©ã¹å®ç¾© 1107 1108==================================*/ 1109 1110 1111var inview = /*#__PURE__*/function () { 1112 function inview(id, target) { 1113 _classCallCheck(this, inview); 1114 1115 this.id = id; 1116 this.target = target; 1117 this.inviewFlag = true; 1118 this.position = 0; 1119 } 1120 1121 _createClass(inview, [{ 1122 key: "init",
1123 value: function init() { 1124 var _this = this; 1125 1126 this.getPosition(); 1127 this.resizeEvent(); 1128 this.scrollEvent(); 1129 this.viewJudge(); 1130 } 1131 }, { 1132 key: "getPosition", 1133 value: function getPosition() { 1134 this.position = this.target.offset().top - FUJI.data.winH * 0.8; 1135 } 1136 }, { 1137 key: "resizeEvent", 1138 value: function resizeEvent() { 1139 var _this = this; 1140 1141 FUJI.data.$window.on('resize', function () { 1142 _this.getPosition(); 1143 }); 1144 } 1145 }, { 1146 key: "scrollEvent", 1147 value: function scrollEvent() { 1148 var _this = this; 1149 1150 FUJI.data.$window.on('scroll', function () { 1151 _this.viewJudge(); 1152 }); 1153 } 1154 }, { 1155 key: "viewJudge", 1156 value: function viewJudge() { 1157 if (this.position < FUJI.data.scrollTop) { 1158 this.fireAnimation(); 1159 } 1160 } 1161 }, { 1162 key: "fireAnimation", 1163 value: function fireAnimation() { 1164 if (!this.inviewFlag) return; 1165 this.target.addClass('is-show'); 1166 this.target.removeClass('is-hide'); 1167 this.inviewFlag = false; 1168 } 1169 }]); 1170 1171 return inview; 1172}();
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.