1'use strict'; 2 3var HW = {}; 4var hw; 5 6HW = function() { 7 this.init(); 8}; 9 10(function($, window, document, undefined) { 11 12 HW.prototype = { 13 /** 14 * åæè¨å® 15 */ 16 init: function() { 17 var base = this; 18 var $window = $(window); 19 20 // ãããã¸æ»ããã¿ã³ 21 base.fixedSwitch(); 22 23 base.mainvisualSlider(); 24 base.itemSlider01(); 25 base.detailSlider01(); 26 27 // ã¹ã ã¼ã¹ã¹ã¯ãã¼ã«å®è¡ 28 base.smoothScroll('.js-goto-pagetop', {forthTop: true}); 29 base.smoothScroll('a[href^="#"]'); 30 31 base.breakpointClassSwitch(); 32 33 // JS Menu 34 $('.js-menu').on('click', function(e) { 35 e.preventDefault(); 36 var $body = $('body'), 37 $menuButton = $('.spButton__link'); 38 if ($body.hasClass('is-open')) { // Close 39 $body.removeClass('is-open'); 40 $menuButton.removeClass('open'); 41 } else { // Open 42 base.scrollTop = $(window).scrollTop(); 43 $body.addClass('is-open'); 44 $menuButton.addClass('open'); 45 46 $('.global-nav-overlay').on('click', function(e) { 47 $body.removeClass('is-open'); 48 $menuButton.removeClass('open'); 49 }); 50 } 51 }); 52 53 // SPã°ãããã®ã¢ã³ã¼ãã£ãªã³ 54 $('.js-subnav-trigger').on('click', function(e) { 55 if ($('body').hasClass('isSP')) { 56 e.preventDefault(); 57 var $this = $(this), 58 $parent = $this.parent('.global-nav__item'), 59 $subNav = $this.siblings('.sub-nav'); 60 if($parent.hasClass('is-open')) { 61 $parent.removeClass('is-open'); 62 $subNav.slideUp('fast'); 63 } else { 64 $parent.addClass('is-open'); 65 $subNav.slideDown('fast'); 66 } 67 } 68 }); 69 70 // SPä¼ç¤¾æ¦è¦ç³»ãµã¤ãããã®ã¢ã³ã¼ãã£ãªã³ 71 $('.js-sidenav-trigger').on('click', function() { 72 if ($('body').hasClass('isSP')) { 73 var $this = $(this), 74 $parent = $this.parent('.side-local-nav__title'), 75 $target = $parent.siblings('.side-local-nav__body'); 76 if($this.hasClass('is-open')) { 77 $this.removeClass('is-open'); 78 $target.slideUp('fast'); 79 } else { 80 $this.addClass('is-open'); 81 $target.slideDown('fast'); 82 } 83 } 84 }); 85 86 // selectã§ãã¼ã¸é·ç§» 87 $('.js-select-link01').change(function() { 88 if ($(this).val() !== '') { 89 window.location.href = $(this).val(); 90 base.onLoadscrollToAnker(); 91 } 92 }); 93 94 // ã¢ã³ã¼ãã£ãªã³ 95 $('.js-accordion-trigger').on('click', function() { 96 var $this = $(this), 97 $target = $this.next('.js-accordion-target'); 98 if ($this.hasClass('is-open')) { 99 $this.removeClass('is-open'); 100 $target.slideUp(); 101 } else { 102 $this.addClass('is-open'); 103 $target.slideDown(); 104 } 105 }); 106 107 // ãµã¤ãããéé 108 $('.js-side-nav').on('click', function() { 109 var $this = $(this), 110 $parent = $this.parents('.side-nav'); 111 if ($parent.hasClass('is-open')) { 112 $parent.removeClass('is-open'); 113 } else { 114 $parent.addClass('is-open'); 115 } 116 }); 117 118 // ã¿ãåãæ¿ã 119 $('.js-tab-trigger').on('click', function() { 120 var $this = $(this); 121 var thisTabWrap = $this.parents('.js-tab-group'); 122 var thisTabBtn = thisTabWrap.find('.js-tab-trigger'); 123 var thisTabContents = thisTabWrap.find('.js-tab-target'); 124 125 //current class 126 var currentClass = 'is-active'; 127 128 //js-tab-trigger current åãæ¿ã 129 thisTabBtn.removeClass(currentClass); 130 $this.addClass(currentClass); 131 132 //ã¯ãªãã¯ããã tabãä½çªç®ãåå¾ 133 var thisElmIndex = thisTabBtn.index(this); 134 135 if ($('body').hasClass('ir')) { 136 base.tabLocationActiveCurrent(thisElmIndex); 137 } 138 139 140 //js-tab-target åãæ¿ã 141 thisTabContents.removeAttr('style').removeClass(currentClass); 142 thisTabContents.eq(thisElmIndex).fadeIn().addClass(currentClass); 143 }); 144 145 // SPã®ãã«ãã¦ã³ã¡ãã¥ã¼è¡¨ç¤º 146 $('.js-downmenu-trigger').on('click', function() { 147 var $this = $(this), 148 $parent = $this.parent('.js-downmenu-group'); 149 if ($parent.hasClass('is-open')) { 150 $parent.removeClass('is-open'); 151 } else { 152 $parent.addClass('is-open'); 153 } 154 }); 155 156 // ã¢ã¤ã³ã³èª¬æã¢ã¼ãã« 157 $('.js-modal-target').each(function() { 158 $('.js-modal-target').iziModal({ 159 appendTo: false,
160 appendToOverlay: false, 161 radius: 10 162 }); 163 }); 164 165 $('.js-modal-trigger').on('click', function (event) { 166 event.preventDefault(); 167 var $this = $(this), 168 modalColor = $this.attr('data-modal-type'), 169 modalTitle = $this.text(), 170 modalDescription = $this.attr('data-modal-description'); 171 $('.modal-block01__title').removeClass(function (index, css) { 172 return (css.match (/\bcategory\S+/g) || []).join(' '); // categoryã§å§ã¾ãclassãã« 173 }); 174 $('.modal-block01__title').text(modalTitle).addClass(modalColor); 175 $('.modal-block01__description').text(modalDescription); 176 $('.js-modal-target').iziModal('open'); 177 }); 178 179 180 // ãµãã¼ãæ å ±ã¢ã¼ãã«è¡¨ç¤º 181 $('.js-modal-support-target').each(function() { 182 $('.js-modal-support-target').iziModal({ 183 appendTo: false, 184 appendToOverlay: false, 185 width: 860, 186 radius: 10 187 }); 188 }); 189 190 $('.js-modal-support-trigger').on('click', function (event) { 191 $('.js-modal-support-target').iziModal('open'); 192 }); 193 194 // ãã©ã¡ã¼ã¿ã«?size=viewãå«ã¾ãã¦ããå ´åã¢ã¼ãã«è¡¨ç¤º 195 var param = location.search.substring(1); 196 if (param == "size=view"){ 197 $('.js-modal-support-target').iziModal('open'); 198 } 199 200 $('.js-modal-parts-target').each(function() { 201 $('.js-modal-parts-target').iziModal({ 202 appendTo: false, 203 appendToOverlay: false, 204 width: 860, 205 radius: 10 206 }); 207 }); 208 209 $('.js-modal-parts-trigger').on('click', function (event) { 210 $('.js-modal-parts-target').iziModal('open'); 211 }); 212 213 // SHOEIãµã¼ãã¹ã·ã§ãã 214 $('.js-shop-filter').on('click', function(e) { 215 var this_id = $(this).find('input[type="radio"]').attr('id'); 216 if (this_id == 'show_tech_only') { 217 $('.item-list15 .type-general').hide(); 218 $('.item-list15:not(:has(.type-tech))').each(function(){ 219 $(this).closest('section').hide(); 220 }); 221 } else { 222 $('.item-list15 .type-general').show(); 223 $('section:has(.item-list15)').show(); 224 } 225 }); 226 227 $('.js-rollover').each(function(){ 228 var rollover = $(this); 229 var src_off = rollover.find('.js-rollover-target').attr('src'); 230 var src_on = src_off.replace('.png', '_hover.png'); 231 rollover.hover(function(){ 232 rollover.find('.js-rollover-target').attr('src', src_on); 233 },function(){ 234 rollover.find('.js-rollover-target').attr('src', src_off); 235 }); 236 }); 237 238 239 // ãµã¤ãããããããã¼ã¸ã¯bodyã«classãã¤ãã 240 if ($('.side-nav').length > 0) { 241 $('body').addClass('has-sidenav'); 242 } 243 244 // ãã¼ãè³¼å ¥ç»é¢ã®åååãPCã¨SPã§è¡¨ç¤ºä½ç½®ãå¤ãã 245 if ($('.js-clone01').length > 0) { 246 $('.js-clone01').clone().addClass('sp-only').removeClass('js-clone01 pc-only').prependTo($('.detail-block02')); 247 } 248 249 // ã¹ã¯ãã¼ã«æã®ã¤ãã³ã 250 $window.on('scroll', $.throttle(250, function() { 251 base.fixedSwitch(); 252 base.headerSlideDown(); 253 })); 254 255 // ãªãµã¤ãºæã«åãã¤ãã³ã 256 $window.on('resize', $.throttle(250, function() { 257 base.breakpointClassSwitch(); 258 base.imgWidthFixed(); 259 base.sideFixed(); 260 })); 261 262 // window on load ã¤ãã³ã 263 $window.on('load', function() { 264 base.windowOnloadInit(); 265 }); 266 }, 267 268 /** 269 * Window on loadè¨å® 270 */ 271 windowOnloadInit: function() { 272 var base = this; 273 base.imgWidthFixed(); 274 base.sideFixed(); 275 base.tabLocationActive(); 276 base.onLoadscrollToAnker(); 277 }, 278 279 /** 280 * ã¹ã ã¼ã¹ã¹ã¯ãã¼ã« 281 */ 282 smoothScroll: function(selector, options) { 283 var base = this; 284 var c = $.extend({ 285 speed: 650, 286 easing: 'swing', 287 adjust: 0, 288 forthTop: false 289 }, options); 290 $(selector).on('click.smoothScroll', function(e) { 291 e.preventDefault(); 292 var elmHash = $(this).attr('href'); 293 var targetOffset; 294 295 //fixedãããã¼ã®é«ã 296 var fixHeaderHeight; 297 if (base.isSPSize()) { 298 // fixHeaderHeight = $('.header-wrap').height(); 299 fixHeaderHeight = 0; 300 } else { 301 fixHeaderHeight = $('.header-fixed-wrap').height(); 302 } 303 304 if (elmHash === '#' || (elmHash !== '' && $(elmHash).length === 0)) { return; } 305 targetOffset = (c.forthTop) ? 0 : $(elmHash).offset().top - c.adju
305st - fixHeaderHeight; 306 $('html,body').animate({scrollTop: targetOffset}, c.speed, c.easing); 307 }); 308 }, 309 310 onLoadscrollToAnker: function() { 311 // URLã«#ãå«ãã§ããããããã¼é«ãåãä¸ã«ããã 312 if (location.hash && location.hash.match(/^(#[a-zA-Z0-9\-_]+)/)){ 313 var elmHash = RegExp.$1; 314 var base = this; 315 var adjust = 20; 316 //fixedãããã¼ã®é«ã 317 var fixHeaderHeight; 318 if (base.isSPSize()) { 319 // fixHeaderHeight = $('.header-wrap').height(); 320 fixHeaderHeight = 0; 321 } else { 322 fixHeaderHeight = $('.header-fixed-wrap').height() + adjust; 323 } 324 var targetOffset; 325 targetOffset = $(elmHash).offset().top - fixHeaderHeight; 326 $('html,body').animate({scrollTop: targetOffset}, 300, 'swing'); 327 } 328 }, 329 330 breakpointClassSwitch: function() { 331 var base = this; 332 if (base.isSPSize()) { 333 $('body').removeClass('isPC').addClass('isSP'); 334 $('.js-media-size').removeAttr('style'); 335 } else { 336 $('body').removeClass('isSP is-open').addClass('isPC'); 337 $('.sub-nav').removeAttr('style'); 338 $('.side-local-nav__body').removeAttr('style'); 339 $('.js-sidenav-trigger').removeClass('is-open'); 340 $('.global-nav__item').removeClass('is-open'); 341 $('.js-media-size').removeAttr('style'); 342 } 343 }, 344 345 fixedSwitch: function() { 346 347 }, 348 349 // ã¿ãã®ãã©ã¡ã¼ã¿å¶å¾¡ 350 tabLocationParameter: function (selector, string_parameter) { 351 $(selector).each(function () { 352 var $this = $(this); 353 var link = $this.attr('value'); 354 $this.attr('value', link + string_parameter); 355 }); 356 }, 357 358 tabLocationActiveCurrent: function (id) { 359 var base = this; 360 if (id === 0) { 361 base.tabLocationParameter('.js-select-link01 option','?id=all'); 362 location.search = '?id=all'; 363 } else if (id === 1) { 364 base.tabLocationParameter('.js-select-link01 option','?id=disclosure'); 365 location.search = '?id=disclosure'; 366 } else if (id === 2) { 367 base.tabLocationParameter('.js-select-link01 option','?id=info'); 368 location.search = '?id=info'; 369 } 370 }, 371 372 // ã¿ãã®ã¢ã¯ãã£ãå¦ç 373 tabLocationActive: function () { 374 var base = this; 375 var url = $(location).attr('href'); 376 var active = 'is-active'; 377 var $targetTab = $('.js-tab-target'); 378 var $triggerTab = $('.js-tab-trigger'); 379 if(url.indexOf('?id=') !== -1){ 380 var id = url.split('?id='); 381 $triggerTab.removeClass(active); 382 $targetTab.removeClass(active); 383 if (id[1] === 'disclosure') { 384 base.tabLocationParameter('.js-select-link01 option','?id=disclosure'); 385 $('.side-local-nav__item').each(function () { 386 var $this = $(this); 387 var nav_text = $this.text(); 388 if (nav_text === '驿é示æ å ±') { 389 $this.addClass('is-current'); 390 $('.side-local-nav__item').not($this).removeClass('is-current'); 391 } 392 }); 393 $triggerTab.eq(1).addClass(active); 394 $targetTab.eq(1).addClass(active); 395 } else if (id[1] === 'info') { 396 base.tabLocationParameter('.js-select-link01 option','?id=info'); 397 $triggerTab.eq(2).addClass(active); 398 $targetTab.eq(2).addClass(active); 399 } else if (id[1] === 'all') { 400 base.tabLocationParameter('.js-select-link01 option','?id=all'); 401 $triggerTab.eq(0).addClass(active); 402 $targetTab.eq(0).addClass(active); 403 } 404 } 405 }, 406 407 // ã¡ã¤ã³ãã¸ã¥ã¢ã« ã¹ã©ã¤ãã¼ 408 mainvisualSlider: function() { 409 if ($('.js-visual-slider').length > 0) { 410 var $status = $('.js-slider-num'); 411 var $slickElement = $('.js-visual-slider'); 412 413 $slickElement.on('init reInit afterChange', function (event, slick, currentSlide, nextSlide) { 414 var i = (currentSlide ? currentSlide : 0) + 1; 415 416 $status.text(i + 'ï¼' + slick.slideCount); 417 }); 418 419 $slickElement.slick({ 420 autoplaySpeed: 5000, 421 dots: true, 422 arrows: true, 423 autoplay: true, 424 useTransform: true, 425 // easing: 'easeOutQuint', 426 cssEase: 'cubic-bezier(0.23, 1, 0.32, 1)', 427 appendArrows: $('.mainvisual__nav'), 428 appendDots: $('.mainvisual__nav') 429 }); 430 } 431 }, 432 433 // è£½åæ å ±TOPã¹ã©ã¤ãã¼ 434 itemSlider01: function() { 435 if ($('.js-item-slider01').length > 0) { 436 var $slickElement = $('.js-item-slider01'); 437 $slickElement.slick({ 438 slidesToShow: 2, 439 slidesToScroll: 1, 440 dots: true, 441 arrows: true, 442 autoplay: true,
443 appendArrows: $('.item-slider01__nav'), 444 appendDots: $('.item-slider01__nav'), 445 446 responsive: [ 447 { 448 breakpoint: 750, 449 settings: { 450 slidesToShow: 1, 451 slidesToScroll: 1 452 } 453 } 454 ] 455 }); 456 } 457 }, 458 459 // è£½åæ å ±è©³ç´° 460 _detailSlider01_slick: function(elm) { 461 if (elm.hasClass('slick-initialized')) { 462 elm.slick('slickGoTo', 0); 463 return; 464 } 465 elm.slick({ 466 slidesToShow: 1, 467 slidesToScroll: 1, 468 dots: true, 469 arrows: true, 470 autoplay: true, 471 appendArrows: elm.parent().find('.detail-slider01__nav'), 472 appendDots: elm.parent().find('.detail-slider01__nav') 473 }); 474 }, 475 detailSlider01: function() { 476 if ($('.js-detail-slider01').length > 0) { 477 var self = this; 478 $('.item-list06__item').on('click', function() { 479 var $this = $(this); 480 var data_type = $this.data('type'); 481 $this.addClass('is-current'); 482 $('.item-list06__item').not($this).removeClass('is-current'); 483 $('.detail-block01').hide(); 484 $('.js-'+ data_type).show(); 485 self._detailSlider01_slick($('.js-'+ data_type).find('.js-detail-slider01')); 486 }); 487 // which first item 488 var find = false; 489 var hash_name = location.hash; 490 if (hash_name) { 491 $('.item-list06__item a').each(function() { 492 var href = $(this).attr('href'); 493 if (href === hash_name) { 494 $(this).trigger('click'); 495 find = true; 496 } 497 }); 498 } 499 if (! find) { 500 $('.detail-block01:first').show(); 501 this._detailSlider01_slick($('.detail-block01:first').find('.js-detail-slider01')); 502 } 503 } 504 }, 505 506 imgWidthFixed: function() { 507 if ($('.js-media-size').length > 0) { 508 $('.js-media-size').each(function() { 509 var $mediaWidth = $(this).find('img').width(); 510 $(this).css({'width' : $mediaWidth }); 511 }); 512 } 513 }, 514 515 headerSlideDown:function (){ 516 var $window = $(window); 517 var headeH = $('.header-wrap').height(); 518 var buffer = 0; 519 if ($('body').hasClass('isPC')) { 520 buffer = 0; 521 }else{ 522 buffer = 100; 523 } 524 525 var fireTiming = headeH + buffer; 526 var winScroll = $window.scrollTop(); 527 if(winScroll > fireTiming){ 528 $('.header-fixed-wrap').addClass('is-fixed'); 529 $('body').addClass('is-fixed'); 530 }else{ 531 $('.header-fixed-wrap').removeClass('is-fixed'); 532 $('body').removeClass('is-fixed'); 533 } 534 }, 535 536 /** 537 * ãµã¤ããã¼åºå® 538 */ 539 sideFixed: function() { 540 var base = this; 541 var $body = $('body'); 542 var $sideNav = $('.side-nav'); 543 if ($('.side-nav').length > 0) { 544 if (!base.isSPSize()) { 545 $('.content').waypoint(function(direction) { 546 if(direction === 'up'){ 547 $sideNav.removeClass('is-fixed'); 548 } else { 549 $sideNav.addClass('is-fixed'); 550 } 551 }, { offset: 68 }); 552 } else { 553 $('.side-nav').waypoint(function(direction) { 554 if(direction === 'up'){ 555 $sideNav.removeClass('is-fixed'); 556 $body.removeClass('is-side-fixed'); 557 } else { 558 $sideNav.addClass('is-fixed'); 559 $body.addClass('is-side-fixed'); 560 } 561 }, { offset: 0 }); 562 } 563 } 564 }, 565 566 567 /** 568 * Is SP Size 569 */ 570 isSPSize: function() { 571 return (window.matchMedia('(max-width: 749px)' ).matches) ? true : false ; 572 // return ($(window).width() <= 750) ? true : false; // matchMediaã使ããªãç°å¢ã®å ´å 573 } 574 }; 575 576})(jQuery, window, document); 577 578hw = new HW();
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.