1/* ---------------------------------------------------------------------------------------- 2 3https://cdnjs.cloudflare.com/ajax/libs/protonet-jquery.inview/1.1.2/jquery.inview.min.jsï¼ã«ã¦ã³ã¿ã¼ãã¼ãã§ä½¿ç¨ï¼ 4 5---------------------------------------------------------------------------------------- */ 6!function(a){"function"==typeof define&&define.amd?define(["jquery"],a):"object"==typeof exports?module.exports=a(require("jquery")):a(jQuery)}(function(a){function i(){var b,c,d={height:f.innerHeight,width:f.innerWidth};return d.height||(b=e.compatMode,(b||!a.support.boxModel)&&(c="CSS1Compat"===b?g:e.body,d={height:c.clientHeight,width:c.clientWidth})),d}function j(){return{top:f.pageYOffset||g.scrollTop||e.body.scrollTop,left:f.pageXOffset||g.scrollLeft||e.body.scrollLeft}}function k(){if(b.length){var e=0,f=a.map(b,function(a){var b=a.data.selector,c=a.$element;return b?c.find(b):c});for(c=c||i(),d=d||j();e<b.length;e++)if(a.contains(g,f[e][0])){var h=a(f[e]),k={height:h[0].offsetHeight,width:h[0].offsetWidth},l=h.offset(),m=h.data("inview");if(!d||!c)return;l.top+k.height>d.top&&l.top<d.top+c.height&&l.left+k.width>d.left&&l.left<d.left+c.width?m||h.data("inview",!0).trigger("inview",[!0]):m&&h.data("inview",!1).trigger("inview",[!1])}}}var c,d,h,b=[],e=document,f=window,g=e.documentElement;a.event.special.inview={add:function(c){b.push({data:c,$element:a(this),element:this}),!h&&b.length&&(h=setInterval(k,250))},remove:function(a){for(var c=0;c<b.length;c++){var d=b[c];if(d.element===this&&d.data.guid===a.guid){b.splice(c,1);break}}b.length||(clearInterval(h),h=null)}},a(f).bind("scroll resize scrollstop",function(){c=d=null}),!g.addEventListener&&g.attachEvent&&g.attachEvent("onfocusin",function(){d=null})}); 7 8/* ---------------------------------------------------------------------------------------- 9 10 å ±é使ç¨å¯è½ã¢ãã¡ã¼ã·ã§ã³classï¼è¦ç´ ã«ä¸è¨ã®classããããã追å ããã¨ã¢ãã¡ã¼ã·ã§ã³ã¨ãã¦åãã¾ãï¼ 11 12---------------------------------------------------------------------------------------- */ 13 14(function($){ 15 16 // Iï½Lã®çä¼¼è¦ç´ ï¼::beforeï¼ã«è¨å®ãããè²ã伸ã³ã¦åºç¾ããã¢ãã¡ã¼ã·ã§ã³ãåããããã®åè¦ç´ ãJavascripã§è¿½å 17 $(function(){ 18 $( '.cparts-animation--bgextend' ).each(function(){ 19 $(this).wrapInner('<div class="cparts-animation--bgappearTrigger"></div>'); 20 }); 21 }); 22 23 // è¦ç´ ãåºç¾ãããããã®æ§ã ãªã¢ãã¡ã¼ã·ã§ã³ 24 function fadeAnime(){ 25 26 // Aï¼ãã®å ´ã§ãã§ã¼ãã¤ã³ 27 $('.cparts-animation--fadeInTrigger').each(function(){ //cparts-animation--fadeInTriggerã¨ããã¯ã©ã¹åãè¦ç´ ã«å ¥ã£ã¦ããå ´å 28 var elemPos = $(this).offset().top-50; 29 var scroll = $(window).scrollTop(); 30 var windowHeight = $(window).height(); 31 if (scroll >= elemPos - windowHeight){ 32 $(this).addClass('cparts-animation--fadeIn');// ç»é¢å ã«å ¥ã£ããcparts-animation--fadeInã¨ããã¯ã©ã¹åããã®è¦ç´ ã®è¿½è¨ãã¦åãã 33 } 34 }); 35 36 // Bï¼ä¸ãããã§ã¼ãã¤ã³ 37 $('.cparts-animation--fadeUpTrigger').each(function(){ //cparts-animation--fadeUpTriggerã¨ããã¯ã©ã¹åãè¦ç´ ã«å ¥ã£ã¦ããå ´å 38 var elemPos = $(this).offset().top-50; 39 var scroll = $(window).scrollTop(); 40 var windowHeight = $(window).height(); 41 if (scroll >= elemPos - windowHeight){ 42 $(this).addClass('cparts-animation--fadeUp');// ç»é¢å ã«å ¥ã£ããcparts-animation--fadeUpã¨ããã¯ã©ã¹åããã®è¦ç´ ã®è¿½è¨ãã¦åãã 43 } 44 }); 45 46 // Cï¼ä¸ãããã§ã¼ãã¤ã³ 47 $('.cparts-animation--fadeDownTrigger').each(function(){ //cparts-animation--fadeDownTriggerã¨ããã¯ã©ã¹åãè¦ç´ ã«å ¥ã£ã¦ããå ´å 48 var elemPos = $(this).offset().top-50; 49 var scroll = $(window).scrollTop(); 50 var windowHeight = $(window).height(); 51 if (scroll >= elemPos - windowHeight){ 52 $(this).addClass('cparts-animation--fadeDown');// ç»é¢å ã«å ¥ã£ããcparts-animation--fadeDownã¨ããã¯ã©ã¹åããã®è¦ç´ ã®è¿½è¨ãã¦åãã 53 } 54 }); 55
56 // Dï¼å·¦ãããã§ã¼ãã¤ã³ 57 $('.cparts-animation--fadeLeftTrigger').each(function(){ //cparts-animation--fadeLeftTriggerã¨ããã¯ã©ã¹åãè¦ç´ ã«å ¥ã£ã¦ããå ´å 58 var elemPos = $(this).offset().top-50; 59 var scroll = $(window).scrollTop(); 60 var windowHeight = $(window).height(); 61 if (scroll >= elemPos - windowHeight){ 62 $(this).addClass('cparts-animation--fadeLeft');// ç»é¢å ã«å ¥ã£ããcparts-animation--fadeLeftã¨ããã¯ã©ã¹åããã®è¦ç´ ã®è¿½è¨ãã¦åãã 63 } 64 }); 65 66 // Eï¼å³ãããã§ã¼ãã¤ã³ 67 $('.cparts-animation--fadeRightTrigger').each(function(){ //cparts-animation--fadeRightTriggerã¨ããã¯ã©ã¹åãè¦ç´ ã«å ¥ã£ã¦ããå ´å 68 var elemPos = $(this).offset().top-50; 69 var scroll = $(window).scrollTop(); 70 var windowHeight = $(window).height(); 71 if (scroll >= elemPos - windowHeight){ 72 $(this).addClass('cparts-animation--fadeRight');// ç»é¢å ã«å ¥ã£ããcparts-animation--fadeRightã¨ããã¯ã©ã¹åããã®è¦ç´ ã®è¿½è¨ãã¦åãã 73 } 74 }); 75 76 // Fï¼æ¡å¤§ããªãã表示 77 $('.cparts-animation--zoomInTrigger').each(function(){ //cparts-animation--zoomInTriggerã¨ããã¯ã©ã¹åãè¦ç´ ã«å ¥ã£ã¦ããå ´å 78 var elemPos = $(this).offset().top-50; 79 var scroll = $(window).scrollTop(); 80 var windowHeight = $(window).height(); 81 if (scroll >= elemPos - windowHeight){ 82 $(this).addClass('cparts-animation--zoomIn');// ç»é¢å ã«å ¥ã£ããcparts-animation--zoomInã¨ããã¯ã©ã¹åããã®è¦ç´ ã®è¿½è¨ãã¦åãã 83 } 84 }); 85 86 // Gï¼ç¸®å°ããªãã表示 87 $('.cparts-animation--zoomOutTrigger').each(function(){ //cparts-animation--zoomOutTriggerã¨ããã¯ã©ã¹åãè¦ç´ ã«å ¥ã£ã¦ããå ´å 88 var elemPos = $(this).offset().top-50; 89 var scroll = $(window).scrollTop(); 90 var windowHeight = $(window).height(); 91 if (scroll >= elemPos - windowHeight){ 92 $(this).addClass('cparts-animation--zoomOut');// ç»é¢å ã«å ¥ã£ããcparts-animation--zoomOutã¨ããã¯ã©ã¹åããã®è¦ç´ ã®è¿½è¨ãã¦åãã 93 } 94 }); 95 96 // Hï¼ã¼ããããå¾ã ã«è¡¨ç¤º 97 $('.cparts-animation--blurTrigger').each(function(){ //cparts-animation--blurTriggerã¨ããã¯ã©ã¹åããè¦ç´ ã«å ¥ã£ã¦ããå ´å 98 var elemPos = $(this).offset().top-50; 99 var scroll = $(window).scrollTop(); 100 var windowHeight = $(window).height(); 101 if (scroll >= elemPos - windowHeight){ 102 $(this).addClass('cparts-animation--blur');// ç»é¢å ã«å ¥ã£ããcparts-animation--blurã¨ããã¯ã©ã¹åãè¿½è¨ 103 } 104 }); 105 106 // Iï¼çä¼¼è¦ç´ ï¼::beforeï¼ã«è¨å®ãããè²ãå·¦ããå³ã«ä¼¸ã³ã¦åºç¾ 107 $( '.cparts-animation--bgLRextendTrigger' ).each(function() { //cparts-animation--bgLRextendTriggerã¨ããã¯ã©ã¹åããè¦ç´ ã«å ¥ã£ã¦ããå ´å 108 var elemPos = $(this).offset().top-50; 109 var scroll = $(window).scrollTop(); 110 var windowHeight = $(window).height(); 111 if (scroll >= elemPos - windowHeight) { 112 $(this).addClass( 'cparts-animation--bgLRextend' );// ç»é¢å ã«å ¥ã£ããcparts-animation--bgLRextendã¨ããã¯ã©ã¹åãè¿½è¨ 113 } 114 }); 115 116 // Jï¼çä¼¼è¦ç´ ï¼::beforeï¼ã«è¨å®ãããè²ãå³ããå·¦ã«ä¼¸ã³ã¦åºç¾ 117 $( '.cparts-animation--bgRLextendTrigger' ).each(function() { //cparts-animation--bgRLextendTriggerã¨ããã¯ã©ã¹åããè¦ç´ ã«å ¥ã£ã¦ããå ´å 118 var elemPos = $(this).offset().top-50; 119 var scroll = $(window).scrollTop(); 120 var windowHeight = $(window).height(); 121 if (scroll >= elemPos - windowHeight) { 122 $(this).addClass( 'cparts-animation--bgRLextend' );// ç»é¢å ã«å ¥ã£ããcparts-animation--bgRLextendã¨ããã¯ã©ã¹åãè¿½è¨ 123 } 124 }); 125 126 // Kï¼çä¼¼è¦ç´ ï¼::beforeï¼ã«è¨å®ãããè²ãä¸ããä¸ã«ä¼¸ã³ã¦åºç¾ 127 $( '.cparts-animation--bgDUextendTrigger' ).each(function() { //cparts-animation--bgDUextendTriggerã¨ããã¯ã©ã¹åããè¦ç´ ã«å ¥ã£ã¦ããå ´å
128 var elemPos = $(this).offset().top-50; 129 var scroll = $(window).scrollTop(); 130 var windowHeight = $(window).height(); 131 if (scroll >= elemPos - windowHeight) { 132 $(this).addClass( 'cparts-animation--bgDUextend' );// ç»é¢å ã«å ¥ã£ããcparts-animation--bgDUextendã¨ããã¯ã©ã¹åãè¿½è¨ 133 } 134 }); 135 136 // Lï¼çä¼¼è¦ç´ ï¼::beforeï¼ã«è¨å®ãããè²ãä¸ããä¸ã«ä¼¸ã³ã¦åºç¾ 137 $( '.cparts-animation--bgUDextendTrigger' ).each(function() { //cparts-animation--bgUDextendTriggerã¨ããã¯ã©ã¹åããè¦ç´ ã«å ¥ã£ã¦ããå ´å 138 var elemPos = $(this).offset().top-50; 139 var scroll = $(window).scrollTop(); 140 var windowHeight = $(window).height(); 141 if (scroll >= elemPos - windowHeight) { 142 $(this).addClass( 'cparts-animation--bgUDextend' );// ç»é¢å ã«å ¥ã£ããcparts-animation--bgUDextendã¨ããã¯ã©ã¹åãè¿½è¨ 143 } 144 }); 145 146 // Iï½Lã®ã¢ãã¡ã¼ã·ã§ã³ãåããããã®æååãå²ãåè¦ç´ ã®åã 147 $( '.cparts-animation--bgappearTrigger' ).each(function() { //cparts-animation--bgappearTriggerã¨ããã¯ã©ã¹åããè¦ç´ ã«å ¥ã£ã¦ããå ´å 148 var elemPos = $(this).offset().top-50; 149 var scroll = $(window).scrollTop(); 150 var windowHeight = $(window).height(); 151 if (scroll >= elemPos - windowHeight) { 152 $(this).addClass( 'cparts-animation--bgappear' );// ç»é¢å ã«å ¥ã£ããcparts-animation--bgappearã¨ããã¯ã©ã¹åãè¿½è¨ 153 } 154 }); 155 } 156 157 // ç»é¢ãã¹ã¯ãã¼ã«ããããåãã 158 $(window).scroll(function () { 159 fadeAnime(); 160 }); 161 162 // ç»é¢ãèªã¿è¾¼ã¾ãããããã«åãã 163 $(window).on('load', function() { 164 fadeAnime(); 165 }); 166 167 168 // ------------------------------------------------- 169 // æåã1æåã¥ã¤åºãã¢ãã¡ã¼ã·ã§ã³ 170 // ------------------------------------------------- 171 172 // æåã1æåã¥ã¤åºãã¢ãã¡ã¼ã·ã§ã³ãåããããã®åè¦ç´ ãJavascripã§è¿½å 173 $(window).on('load', function () { 174 $('.cparts-animation--appeartextchild').each(function () { 175 $(this).children().addClass('cparts-animation--appeartext'); 176 }); 177 }); 178 179 // eachTextAnimeã«cparts-animation--appeartextã¨ããã¯ã©ã¹åãä»ããå®ç¾© 180 function EachTextAnimeControl() { 181 $('.cparts-animation--appeartext').each(function () { 182 var elemPos = $(this).offset().top - 50; 183 var scroll = $(window).scrollTop(); 184 var windowHeight = $(window).height(); 185 if (scroll >= elemPos - windowHeight) { 186 $(this).addClass('cparts-animation--appeartext__text'); 187 188 } 189 }); 190 } 191 192 // ç»é¢ãã¹ã¯ãã¼ã«ããããåãã 193 $(window).on('scroll',function () { 194 EachTextAnimeControl(); 195 }); 196 197 // ç»é¢ãèªã¿è¾¼ã¾ãããããã«åãã 198 $(window).on('load', function () { 199 $('.cparts-animation--appeartextchild').each(function () { 200 $(this).addClass('cparts-animation--appeartext__text'); 201 }); 202 //spanã¿ã°ã追å ãã 203 var element = $('.cparts-animation--appeartext'); 204 element.each(function () { 205 var text = $(this).text(); 206 var textbox = ""; 207 text.split('').forEach(function (t, i) { 208 if (t !== " ") { 209 if (i < 10) { 210 textbox += '<span style="animation-delay:.' + i + 's;">' + t + '</span>'; 211 } else { 212 var n = i / 10; 213 textbox += '<span style="animation-delay:' + n + 's;">' + t + '</span>'; 214 } 215 216 } else { 217 textbox += t; 218 } 219 }); 220 $(this).html(textbox); 221 }); 222 223 EachTextAnimeControl(); 224 }); 225 226}(jQuery)); 227 228 229 230/* ---------------------------------------------------------------------------------------- 231 232 åå¥Japascript 233 234---------------------------------------------------------------------------------------- */ 235(function($) {$(function(){ 236 237 $(window).on('load', function() { 238 239 /* ------------------------------------------------------- 240 2017å¹´ãªãã¥ã¼ã¢ã« 241 -------------------------------------------------------- */ 242 // ç»åã¨ããã¹ãï¼ã¹ã¯ãã¼ã«ä»ãï¼ 243 var boxheight = $('.parts_img_type47_photo').height(); 244 $('.parts_img_type47_text_scrBox').css('height', boxheight - 72); 245 246 $(window).resize(function(){ 247 var w = $(window).width(); 248 var x = 767; 249 var boxheight = $('.parts_img_type47_photo').height(); 250 251 if (w <= x) { 252 $('.parts_img_type47_text_scrBox').css('height', ''); 253 } else { 254 $('.parts_img_type47_text_scrBox').css('height', boxheight - 72); 255 } 256 257 });
258 259 // ãããã質åï¼ã¯ãªãã¯ã§åçãè¡¨ç¤ºï¼ 260 $('.parts_text_type17 dd').css('display', 'none'); 261 $('.parts_text_type17 dt').on('click', function() { 262 $(this).next().slideToggle(); 263 }); 264 265 // Indeedåéä¸è¦§ 266 $(function(){ 267 $('.cms_col_3').eq(0); 268 $('.cms_col_3').eq($('.cms_col_3').length-1); 269 270 for(var i=0; i<$('.cms_col_3').length; i++){ 271 if(i%3===0){ 272 $('.cms_col_3').eq(i).addClass('rigth_ntn'); 273 }else if(i%3===2){ 274 $('.cms_col_3').eq(i).addClass('left_ntn'); 275 } 276 } 277 }); 278 279 /* ------------------------------------------------------- 280 2020年追å 281 -------------------------------------------------------- */ 282 // ãã¼ãã«ãããã¯è¿½å 283 $('.cparts-cell-block').not('.cparts-cell-block + .cparts-cell-block').each(function(){ 284 const $targets = $(this).nextUntil(':not(.cparts-cell-block)').addBack(); // 2025å¹´jQueryã®ãã¼ã¸ã§ã³ã¢ããã«ä¼´ãä¿®æ£ 285 if ($targets.length > 1) { 286 $targets.wrapAll('<div class="cparts-table-block"></div>'); // 2025å¹´jQueryã®ãã¼ã¸ã§ã³ã¢ããã«ä¼´ãä¿®æ£ 287 } 288 }); 289 $(".cparts-table-block:empty").remove(); 290 291 // ã¤ã³ã©ã¤ã³è¦ªãããã¯è¿½å 292 $('.cparts-inline-block').not('.cparts-inline-block + .cparts-inline-block').each(function(){ 293 const $targets = $(this).nextUntil(':not(.cparts-inline-block)').addBack(); // 2025å¹´jQueryã®ãã¼ã¸ã§ã³ã¢ããã«ä¼´ãä¿®æ£ 294 if ($targets.length > 1) { 295 $targets.wrapAll('<div class="cparts-col-block"></div>'); // 2025å¹´jQueryã®ãã¼ã¸ã§ã³ã¢ããã«ä¼´ãä¿®æ£ 296 } 297 }); 298 $(".cparts-col-block:empty").remove(); 299 300 // å ¬éãµã¤ãã®ã¿é©ç¨ 301 if($('#published').length>0){ 302 303 $('html').css('overflow-x','hidden'); 304 305 // ã¿ã¤ãã«ãã¯ãªãã¯ãã¦è©³ç´°ãéããã¼ã 306 $('.cparts-var03-type12a').each(function(){ 307 $(this).nextAll().each(function(){ 308 if($(this).hasClass('cparts-var03-type12c')) return false; 309 $(this).addClass('cparts-var03-type12b'); 310 $(this).hide(); 311 }); 312 }); 313 $('.cparts-var03-type12a').next('.cparts-var03-type12b').addClass('cparts-var03-type12b-first'); 314 $('.cparts-var03-type12c').prev('.cparts-var03-type12b').addClass('cparts-var03-type12b-last'); 315 $('.cparts-var03-type12c').hide(); 316 $('.cparts-var03-type12a').off().on('click', function() { 317 $(this).find('.cparts-icon-block').toggleClass('cparts-icon-block-open'); 318 $(this).nextAll().each(function(){ 319 if($(this).hasClass('cparts-var03-type12c')) return false; 320 $(this).slideToggle(500); 321 setTimeout(function() { 322 $('.cparts-var03-type12b').css('overflow','visible'); 323 }, 2000); 324 $('.cparts-var03-type12a').toggleClass('cparts-var03-type12a-open'); 325 }); 326 }); 327 328 329 // å1åã®ã³ã³ãã³ããã¼ã 330 var left = 0; 331 var maxHeight = 0; 332 $('.cparts-col2-block').each(function(i, box) { 333 if(i===0){ 334 left = $(this).offset().left; 335 start = 0; 336 } else { 337 if(left === $(this).offset().left || $('.cparts-col2-block').length == i+1) { 338 if( $('.cparts-col2-block').length == i+1 ){ 339 i++; 340 if(maxHeight < $(this).find('.col2-height').height()) maxHeight = $(this).find('.col2-height').height(); 341 } 342 var count = i - start; 343 for(ii=(i-1);ii>=start;ii--) { 344 $('.cparts-col2-block').eq(ii).find('.col2-height').height(maxHeight); 345 if (window.matchMedia( "(min-width: 992px)" ).matches) { 346 if(count === 1) $('.cparts-col2-block').eq(ii).addClass('cparts-left-ntn'); 347 if(count === 2) $('.cparts-col2-block').eq(ii).addClass('cparts-rigth-ntn'); 348 count--; 349 } 350 if (window.matchMedia( "(max-width: 991px) and (min-width: 768px)" ).matches) { 351 if(count === 1) $('.cparts-col2-block').eq(ii).addClass('cparts-left-ntn'); 352 if(count === 2) $('.cparts-col2-block').eq(ii).addClass('cparts-rigth-ntn'); 353 count--; 354 } 355 } 356 maxHeight=0; 357 start = i; 358 } 359 } 360 if(maxHeight < $(this).find('.col2-height').height()) maxHeight = $(this).find('.col2-height').height(); 361 }); 362 363 var left = 0; 364 var maxHeight = 0; 365 $('.cparts-col3-block').each(function(i, box) { 366 //æåã®1ã¤ç® 367 if(i===0){ 368 left = $(this).offset().left; 369 start = 0; 370 } else { 371 // 1ã¤ãã¨åãLefttå¤ãæå¾ã®ã¨ã¬ã¡ã³ããªã 372 if(left === $(this).offset().left || $('.cparts-col3-block').length == i+1) { 373 if (left === $(this).offset().left && $('.cparts-col3-block').length == i+1) $('.cparts-col3-block').eq(i).addClass('cparts-left-ntn'); 374 if( $('.cparts-col3-block').length == i+1 ){ 375 if(maxHeight < $(this).find('.cparts-col3-height').height()) maxHeight = $(this).find('.cparts-col3-height').height(); 376 i++; 377 } 378 var count = i - start; 379 for(ii=(i-1);ii>=start;ii--) { 380 $('.cparts-col3-block').eq(ii).find('.cparts-col3-height').height(maxHeight); 381 if (window.matchMedia( "(min-width: 992px)" ).matches) { 382 if(count === 1) $('.cparts-col3-block').eq(ii).addClass('cparts-left-ntn'); 383 if(count === 2) $('.cparts-col3-block').eq(ii).addClass('cparts-center-ntn'); 384 if(count === 3) $('.cparts-col3-block').eq(ii).addClass('cparts-rigth-ntn'); 385 count--; 386 } 387 if (window.matchMedia( "(max-width: 991px) and (min-width: 768px)" ).matches) { 388 if(count === 1) $('.cparts-col3-block').eq(ii).addClass('cparts-left-ntn'); 389 if(count === 2) $('.cparts-col3-block').eq(ii).addClass('cparts-rigth-ntn'); 390 count--; 391 } 392 } 393 maxHeight=0; 394 start = i; 395 } 396 } 397 if(maxHeight < $(this).find('.cparts-col3-height').height()) maxHeight = $(this).find('.cparts-col3-height').height(); 398 }); 399 400 var left = 0; 401 var maxHeight = 0; 402 $('.cparts-col4-block').each(function(i, box) { 403 if(i===0){ 404 left = $(this).offset().left; 405 start = 0; 406 } else { 407 if(left === $(this).offset().left || $('.cparts-col4-block').length == i+1) { 408 if( $('.cparts-col4-block').length == i+1 ){ 409 i++; 410 if(maxHeight < $(this).find('.col4-height').height()) maxHeight = $(this).find('.col4-height').height(); 411 } 412 var count = i - start; 413 for(ii=(i-1);ii>=start;ii--) { 414 $('.cparts-col4-block').eq(ii).find('.col4-height').height(maxHeight); 415 if (window.matchMedia( "(min-width: 992px)" ).matches) { 416 if(count === 1) $('.cparts-col4-block').eq(ii).addClass('cparts-left-ntn'); 417 if(count === 2) $('.cparts-col4-block').eq(ii).addClass('cparts-l-center-ntn'); 418 if(count === 3) $('.cparts-col4-block').eq(ii).addClass('cparts-r-center-ntn'); 419 if(count === 4) $('.cparts-col4-block').eq(ii).addClass('cparts-rigth-ntn'); 420 count--; 421 } 422 if (window.matchMedia( "(max-width: 991px) and (min-width: 768px)" ).matches) { 423 if(count === 1) $('.cparts-col4-block').eq(ii).addClass('cparts-left-ntn'); 424 if(count === 2) $('.cparts-col4-block').eq(ii).addClass('cparts-rigth-ntn'); 425 count--; 426 } 427 } 428 maxHeight=0; 429 start = i; 430 } 431 } 432 if(maxHeight < $(this).find('.col4-height').height()) maxHeight = $(this).find('.col4-height').height(); 433 }); 434 435 var left = 0; 436 var maxHeight = 0; 437 $('.cparts-col5-block').each(function(i, box) { 438 if(i===0){ 439 left = $(this).offset().left; 440 start = 0; 441 } else { 442 if(left === $(this).offset().left || $('.cparts-col5-block').length == i+1) { 443 if( $('.cparts-col5-block').length == i+1 ){ 444 i++; 445 if(maxHeight < $(this).find('.col5-height').height()) maxHeight = $(this).find('.col5-height').height(); 446 } 447 var count = i - start; 448 for(ii=(i-1);ii>=start;ii--) { 449 $('.cparts-col5-block').eq(ii).find('.col5-height').height(maxHeight); 450 if (window.matchMedia( "(min-width: 992px)" ).matches) { 451 if(count === 1) $('.cparts-col5-block').eq(ii).addClass('cparts-left-ntn'); 452 if(count === 2) $('.cparts-col5-block').eq(ii).addClass('cparts-l-center-ntn'); 453 if(count === 3) $('.cparts-col5-block').eq(ii).addClass('cparts-center-ntn'); 454 if(count === 4) $('.cparts-col5-block').eq(ii).addClass('cparts-r-center-ntn'); 455 if(count === 5) $('.cparts-col5-block').eq(ii).addClass('cparts-rigth-ntn'); 456 count--; 457 } 458 if (window.matchMedia( "(max-width: 991px) and (min-width: 768px)" ).matches) { 459 if(count === 1) $('.cparts-col5-block').eq(ii).addClass('cparts-left-ntn'); 460 if(count === 2) $('.cparts-col5-block').eq(ii).addClass('cparts-rigth-ntn'); 461 count--; 462 } 463 } 464 maxHeight=0; 465 start = i; 466 } 467 } 468 if(maxHeight < $(this).find('.col5-height').height()) maxHeight = $(this).find('.col5-height').height(); 469 }); 470 471 if (window.matchMedia( "(max-width: 991px)" ).matches) { 472 $('.cparts-img-type12a').each(function(i, box) { 473 var maxHeight = 0; 474 $(box).find('.cparts-txt-block').each(function() { 475 if ($(this).height() > maxHeight) maxHeight = $(this).height(); 476 }); 477 $(box).find('.cparts-txt-block').height(maxHeight); 478 }); 479 $('.cparts-img-type12b').each(function(i, box) { 480 var maxHeight = 0; 481 $(box).find('.cparts-txt-block').each(function() { 482 if ($(this).height() > maxHeight) maxHeight = $(this).height(); 483 }); 484 $(box).find('.cparts-txt-block').height(maxHeight); 485 }); 486 } 487 488 // ãã¦ã¹ãªã¼ãã¼ã§ããã¹ã表示 489 $('.cparts-var03-type19a').children('div').each(function(){ 490 var k = $(this).find('.cparts-img-block').height(); 491 $(this).find('.cparts-body-block').css('height',k+'px'); 492 }); 493 $('.cparts-var03-type19b').children('div').each(function(){ 494 var k = $(this).find('.cparts-img-block').height(); 495 $(this).find('.cparts-body-block').css('height',k+'px'); 496 }); 497 498 // ã¡ã¤ã³ãã¸ã¥ã¢ã« 499 $(".cparts-var03-type22").find(".cparts-body-block").each(function(){ 500 $(this).addClass('cparts-move'); 501 $(this).parents('.cparts-var03-type22').find('.cparts-img-block img').addClass('cparts-img-in'); 502 }); 503 $(".cparts-var03-type23 .cparts-body-block").each(function(){ 504 $(this).addClass('cparts-fade-in'); 505 }); 506 507 }// å ¬éãµã¤ãã®ã¿é©ç¨çµäº 508 509 // æµãï¼ã©ã¤ã³ï¼ãããã¯è¿½å 510 var connectorBlock = $('<div class="cparts-connector-block"></div>'); 511 $('.cparts-connector--curve').not('.cparts-connector--curve+.cparts-connector--curve').each(function(){ 512 $(this).nextUntil(':not(.cparts-connector--curve)').addBack() // 2025å¹´jQueryã®ãã¼ã¸ã§ã³ã¢ããã«ä¼´ãä¿®æ£.wrapAll(connectorBlock); 513 });
514 $(".cparts-connector-block:empty").remove(); 515 516 var $items = $('.cparts-var03-type24'); 517 var group = []; 518 519 $items.each(function(i, el) { 520 var $el = $(el); 521 522 // ç´åãåãã¯ã©ã¹ãã©ããã§ã°ã«ã¼ãå¤å® 523 if (i > 0 && $items.eq(i - 1).next()[0] === el) { 524 group.push($el); 525 } else { 526 // æ°ããã°ã«ã¼ãéå§ 527 if (group.length) { 528 processGroup(group); 529 } 530 group = [$el]; 531 } 532 }); 533 // æå¾ã®ã°ã«ã¼ãå¦ç 534 if (group.length) { 535 processGroup(group); 536 } 537 function processGroup(group) { 538 $.each(group, function(idx, $el) { 539 if ((idx + 1) % 2 === 0) { 540 $el.addClass('cparts-curve--even'); // 奿°çªç® 541 } 542 }); 543 group[group.length - 1].addClass('cparts-curve--last'); // æå¾ 544 } 545 546 // ã¿ãåãæ¿ã 547 // æåã¯å ¨é¨æ¶ã 548 $('.cparts-var03-type26b').hide(); 549 $('.cparts-var03-type26c').hide(); 550 $('.cparts-inner').hide(); 551 var edit_site = $('#cms_contents_area').length; 552 if(edit_site === 0) { 553 $('.cparts-var03-type26d').hide() 554 $('.cparts-var03-type26a .cparts-notes-block').hide() 555 }; 556 // è¦åºãã®å¦ç 557 $('.cparts-var03-type26a').each(function(){ 558 // èªèº«ã®liã«å¯¾ãã¦å¦çãè¡ã 559 $(this).find('ol li').each(function(i){ 560 // ã¯ã©ã¹åã追å ãã 561 $(this).addClass('cparts-select' + (i+1)); 562 var li = $(this).length; 563 $(this).css('width','calc(100% / '+li+')'); 564 // æåã®è¦ç´ ã«ã¯select-on 565 if(i === 0) $(this).addClass('cparts-select-on'); 566 // ã¯ãªãã¯ã¤ãã³ãã追å 567 $(this).off().on('click', function(event) { 568 // èªåã®ã°ã«ã¼ãã®select-onãåé¤ 569 $(this).parents('.cparts-var03-type26a').find('.cparts-select-on').removeClass('cparts-select-on'); 570 // èªåã«select-onã追å 571 $(this).addClass('cparts-select-on'); 572 var show_flag = 0; // 表示ãã©ã°ã1ã®éã¯è¡¨ç¤ºãã 573 var show_class = $(this).attr('class').replace(' cparts-select-on',''); // 表示ããã¯ã©ã¹å 574 $(this).parents('.cparts-var03-type26a').nextAll().each(function(index, el) { 575 if($(this).hasClass('cparts-var03-type26d')) return false; 576 $(this).hide(); 577 }); 578 $(this).parents('.cparts-var03-type26a').nextAll().each(function(index, el) { 579 if($(this).hasClass('cparts-var03-type26d')) return false; 580 if($(this).hasClass('cparts-var03-type26b') && $(this).hasClass(show_class) && show_flag === 0) { 581 show_flag = 1; 582 if(edit_site) 583 $(this).fadeIn(1000); 584 } else if($(this).hasClass('cparts-var03-type26c') && $(this).hasClass(show_class) && show_flag === 1) { 585 show_flag = 0; 586 if(edit_site) 587 $(this).fadeIn(1000); 588 } else if(show_flag === 1) { 589 $(this).fadeIn(1000); 590 } 591 }); 592 return false; 593 }); 594 }); 595 var index = 1; 596 $(this).nextAll().each(function() { 597 if($(this).hasClass('cparts-var03-type26d')) return false; 598 if($(this).hasClass('cparts-var03-type26b')) { 599 $(this).addClass('cparts-select'+index); 600 $(this).attr('data','cparts-select'+index); 601 if(index === 1 && edit_site) $(this).show(); 602 else $(this).hide(); 603 } else if($(this).hasClass('cparts-var03-type26c')) { 604 $(this).addClass('cparts-select'+index); 605 $(this).attr('data','cparts-select'+index); 606 if(index === 1 && edit_site) $(this).show(); 607 else $(this).hide(); 608 index++; 609 } else { 610 $(this).addClass('cparts-inner'); 611 if(index === 1) $(this).show(); 612 else $(this).hide(); 613 } 614 }); 615 }); 616 617 $('.cparts-var03-type26a .cparts-notes-block p').off().on('click', function() { 618 if($(this).hasClass('cparts-all-open')){ 619 $(this).html('ã¿ãå 容ãå±éããï¼å ¬éãµã¤ãã«ã¯è¡¨ç¤ºããã¾ããï¼'); 620 $(this).removeClass('cparts-all-open'); 621 $(this).parents('.cparts-var03-type26a').nextAll('.cparts-var03-type26b').hide(); 622 $(this).parents('.cparts-var03-type26a').nextAll('.cparts-var03-type26c').hide(); 623 $(this).parents('.cparts-var03-type26a').nextAll('.cparts-inner').hide(); 624 $(this).parents('.cparts-var03-type26a').next('.cparts-var03-type26b.cparts-select1').nextAll().each(function() { 625 if($(this).hasClass('cparts-var03-type26c')) return false; 626 $(this).show(); 627 }); 628 $(this).parents('.cparts-var03-type26a').nextAll('.cparts-var03-type26b.cparts-select1').show(); 629 $(this).parents('.cparts-var03-type26a').nextAll('.cparts-var03-type26c.cparts-select1').show(); 630 $('.cparts-var03-type26a ol li').removeClass('cparts-select-on'); 631 $('.cparts-select1').addClass('cparts-select-on'); 632 }else{ 633 $(this).html('ãã¬ãã¥ã¼ã表示ï¼å ¬éãµã¤ãã«ã¯è¡¨ç¤ºããã¾ããï¼'); 634 $(this).addClass('cparts-all-open'); 635 $(this).parents('.cparts-var03-type26a').nextAll('.cparts-var03-type26b').show(); 636 $(this).parents('.cparts-var03-type26a').nextAll('.cparts-var03-type26c').show(); 637 $(this).parents('.cparts-var03-type26a').nextAll('.cparts-inner').show(); 638 } 639 }); 640 641 /* ------------------------------------------------------- 642 2021年追å 643 -------------------------------------------------------- */ 644 // ç»åï¼è¦åºãã»èæ¯ä»ããã¹ã_ver.2ã»è¦åºãã»èæ¯ä»ããã¹ãï¼ç»å_ver.2ï¼ä¸ä½ç½èª¿æ´ 645 if (window.matchMedia( "(min-width: 768px)" ).matches) { 646 $(window)// .load() åé¤ï¼2025å¹´jQueryã®ãã¼ã¸ã§ã³ã¢ããã«ä¼´ãä¿®æ£ï¼ 647$(window).on('load', function () { 648 $('.parts_img_type37').each(function() { 649 var himg = $(this).find('img').height(); 650 var h = $(this).find('.parts_img_type37_text').height(); 651 var m = h - himg +24; 652 if (himg < h) { 653 $(this).find('img').css('margin-top', m+'px'); 654 } 655 }); 656 657 $('.parts_img_type36').each(function() { 658 var himgb = $(this).find('img').height(); 659 var hb = $(this).find('.parts_img_type36_text').height(); 660 var mb = hb - himgb +24; 661 if (himgb < hb) { 662 $(this).find('img').css('margin-top', mb+'px'); 663 } 664 }); 665 }); 666 } 667 668 // ãå ±éãã¹ã©ã¤ã 669 //ã¹ã©ã¤ãç¨ã¿ã°è¿½å 670 // ã¹ã©ã¤ãã¼æ§é ã追å ï¼æ¯åHTMLã§çæï¼ 671 $('.cparts-slide-block').not('.cparts-slide-block + .cparts-slide-block').each(function () { 672 const $targets = $(this).nextUntil(':not(.cparts-slide-block)').addBack(); // 2025å¹´jQueryã®ãã¼ã¸ã§ã³ã¢ããã«ä¼´ãä¿®æ£ 673 if ($targets.length > 1) { 674 $targets.wrapAll( 675 '<div class="cparts-slideview-block lay-margin-b--3">' + 676 '<div class="cparts-slider-block lay-row lay-flex-nowrap"></div>' + 677 '<span class="cparts-prevbtn-block dec-bg--primary"></span>' + 678 '<span class="cparts-nextbtn-block dec-bg--primary"></span>' + 679 '</div>' 680 ); // 2025å¹´jQueryã®ãã¼ã¸ã§ã³ã¢ããã«ä¼´ãä¿®æ£ 681 } 682 });
683 $('.cparts-slider-block:empty').remove(); 684 685 // PCã§ã®åæ°æå®ï¼ã©ããå¾ã«æ£ããåæåï¼ 686 $('.cparts-slider-block').each(function () { 687 const $first = $(this).children('.cparts-slide-block:first-child'); 688 689 if ($first.hasClass('cparts-pcrow--1')) { 690 $(this).children('.cparts-slide-block').addClass('lay-col12-md-12'); 691 $(this).addClass('cparts-sliderow-1'); 692 } else if ($first.hasClass('cparts-pcrow--2')) { 693 $(this).children('.cparts-slide-block').addClass('lay-col12-md-6'); 694 $(this).addClass('cparts-sliderow-2'); 695 } else if ($first.hasClass('cparts-pcrow--3')) { 696 $(this).children('.cparts-slide-block').addClass('lay-col12-md-4'); 697 $(this).addClass('cparts-sliderow-3'); 698 } else { 699 $(this).children('.cparts-slide-block').addClass('lay-col12-md-3'); 700 $(this).addClass('cparts-sliderow-4'); 701 } 702 }); 703 704 // ã¹ã©ã¤ãã¼ç§»å 705 let cancelFlag = 0; 706 707 $('.cparts-nextbtn-block').on('click', function () { 708 if (cancelFlag === 0) { 709 cancelFlag = 1; 710 const $slider = $(this).siblings('.cparts-slider-block'); 711 const slidePW = $(this).parent().width(); // 表示ç¯å² 712 const slideSW = $slider.get(0).scrollWidth - 30; // ã¹ã©ã¤ãã¼å ¨ä½ã®å¹ 713 const slideMW = slidePW - slideSW; // å·® 714 const $firstSlide = $slider.children('.cparts-slide-block:first-child'); 715 const slideW = $firstSlide.innerWidth(); 716 const slideM = parseInt($firstSlide.css('margin-left'), 10); 717 718 if (slideMW < 0 && slideMW < -slideM) { 719 $firstSlide.animate({ marginLeft: slideM - slideW }, 100, 'linear'); 720 } 721 722 setTimeout(() => { 723 cancelFlag = 0; 724 }, 500); 725 } 726 }); 727 728 $('.cparts-prevbtn-block').on('click', function () { 729 if (cancelFlag === 0) { 730 cancelFlag = 1; 731 const $slider = $(this).siblings('.cparts-slider-block'); 732 const $firstSlide = $slider.children('.cparts-slide-block:first-child'); 733 const slideW = $firstSlide.innerWidth(); 734 const slideM = parseInt($firstSlide.css('margin-left'), 10); 735 736 if (slideM < 0) { 737 $firstSlide.animate({ marginLeft: slideM + slideW }, 100, 'linear'); 738 } 739 740 setTimeout(() => { 741 cancelFlag = 0; 742 }, 500); 743 } 744 }); 745 746 // ãªãµã¤ãºæã«ãã¼ã¸ã³ããªã»ããï¼PCã ãï¼ 747 $(window).on('resize', function () { 748 if ($(window).width() >= 768) { 749 $('.cparts-slider-block').children('.cparts-slide-block:first-child').css({ marginLeft: 0 }); 750 } 751 }); 752 //iPadã®æ¨ªæºã鲿¢ 753 if($('body > div#cms_contents_area').length){ 754 $('body').css('overflow-x',''); 755 } else if($('.cparts-slide-block').length) { 756 $('body').css('overflow-x','hidden'); 757 } 758 759 // ãå ±éããªã¹ãã¸ã®class追å 760 $('.cparts-list-block > ul').addClass('cparts-list-ul--01'); 761 $('.cparts-list-block > * > li > ul').addClass('cparts-list-ul--02'); 762 $('.cparts-list-block > * > li > * > li > ul').addClass('cparts-list-ul--03'); 763 $('.cparts-list-block > * > li > * > li > * > li > ul').addClass('cparts-list-ul--04'); 764 $('.cparts-list-block > * > li > * > li > * > li > * > li > ul').addClass('cparts-list-ul--05'); 765 $('.cparts-list-block > * > li > * > li > * > li > * > li > * > li > ul').addClass('cparts-list-ul--06'); 766 $('.cparts-list-block > ol').addClass('cparts-list-ol--01'); 767 $('.cparts-list-block > * > li > ol').addClass('cparts-list-ol--02'); 768 $('.cparts-list-block > * > li > * > li > ol').addClass('cparts-list-ol--03'); 769 $('.cparts-list-block > * > li > * > li > * > li > ol').addClass('cparts-list-ol--04'); 770 $('.cparts-list-block > * > li > * > li > * > li > * > li > ol').addClass('cparts-list-ol--05'); 771 $('.cparts-list-block > * > li > * > li > * > li > * > li > * > li > ol').addClass('cparts-list-ol--06'); 772 $('.cparts-list-block > * > li').addClass('cparts-list-li--01'); 773 $('.cparts-list-block > * > li > * > li').addClass('cparts-list-li--02'); 774 $('.cparts-list-block > * > li > * > li > * > li').addClass('cparts-list-li--03'); 775 $('.cparts-list-block > * > li > * > li > * > li > * > li').addClass('cparts-list-li--04'); 776 $('.cparts-list-block > * > li > * > li > * > li > * > li > * > li').addClass('cparts-list-li--05'); 777 $('.cparts-list-block > * > li > * > li > * > li > * > li > * > li > * > li').addClass('cparts-list-li--06'); 778 779 // ãç®æ¬¡ãè£ é£¾ç¨class追å 780 $('.cparts-id282--02 .cparts-list-li--01, .cparts-id282--03 .cparts-list-li--01').addClass('dec-bg-pe--primary dec-line--grey'); 781 $('.cparts-id282--02 ol > .cparts-list-li--02, .cparts-id282--02 ol > .cparts-list-li--03, .cparts-id282--03 ol > .cparts-list-li--02, .cparts-id282--03 ol > .cparts-list-li--03').addClass('dec-txt-pe--dark'); 782 $('.cparts-id282--02 ul > .cparts-list-li--02, .cparts-id282--02 ul > .cparts-list-li--03, .cparts-id282--03 ul > .cparts-list-li--02, .cparts-id282--03 ul > .cparts-list-li--03').addClass('dec-line-pe--dark'); 783 784 // ããã¹ã縦æ¸ã 785 $('div[class*="cparts-id294"]').each(function() { 786 var w = $(this).parent('div').width(); 787 $(this).find('.cparts-txt-block').css('width', w+'px'); 788 });
789 window.addEventListener( 'resize', function() { 790 $('div[class*="cparts-id294"]').each(function() { 791 var w = $(this).parent('div').width(); 792 $(this).find('.cparts-txt-block').css('width', w+'px'); 793 }); 794 }, false ); 795 796 // ã¹ããããªã¹ã 797 $('div[class*="cparts-id297"]').each(function() { 798 $(this).append('<div class="cparts--id295-border dec-bg--light"></div>'); 799 }); 800 801 // ã¿ã¤ãã«ä»ãæ ç· 802 if ($('[class*="cparts-id299"]').length) { 803 $('div[class*="cparts-id299"]').each(function() { 804 var height = $(this).find('.cparts-head-block').height(); 805 var t = height/2; 806 var m = height/2 + 30; 807 $(this).find('.cparts-body-block').css('padding-top', t + 20 + 'px'); 808 $(this).find('.cparts-head-block').css('top', '-'+t+'px'); 809 $(this).css('margin-top', m+'px'); 810 if ($(this).find('h3').css('color') == 'rgb(255, 255, 255)') { 811 $(this).find('h3').addClass('dec-txt--primary'); 812 } 813 }); 814 } 815 816 // ããã¼01 817 $('div[class*="cparts-id311"]').each(function() { 818 if ($(this).find('.cparts-body-block').outerWidth() < 200) { 819 $(this).addClass('cparts-id311-column'); 820 } 821 var height = $(this).find('.cparts-body-block').outerHeight(); 822 if(height > 210){ 823 $(this).find('.cparts-img-block').find('img').css('height', height+'px'); 824 $(this).find('.cparts-img-block').css('height', height+'px'); 825 } 826 var color = $(this).find('.dec-bg--primary').css('color'); 827 $(this).find('h4').css('color', color); 828 }); 829 830 // ããã¼02 831 $('.cparts-id315--02').each(function() { 832 var col = $(this).find('.dec-bg--dark').css('background-color'); 833 var c = String(col).slice(0,-1); 834 var color = String(c).slice(3); 835 $(this).find('.cparts-body-block').css({'cssText': 'background-color: rgba'+color+',.75) !important'}); 836 }); 837 $('.cparts-id315--01').each(function() { 838 var color = $(this).find('.dec-bg--primary').css('color'); 839 $(this).find('h4').css('color', color); 840 }); 841 $('div[class*="cparts-id315"]').each(function() { 842 if ($(this).find('.cparts-img-block').outerWidth() < 300) { 843 $(this).addClass('cparts-id315-column'); 844 } 845 var height = $(this).find('.cparts-body-block').outerHeight() +30; 846 $(this).find('.cparts-img-block').find('img').css('height', height+'px'); 847 $(this).find('.cparts-img-block').css('height', height+'px'); 848 if ($(this).find('h4').css('color') == $(this).find('.dec-bg--primary').css('background-color')) { 849 $(this).find('h4').css('color','#fff'); 850 } 851 }); 852 853 // ããã¼03 854 $('div[class*="cparts-id317"]').each(function() { 855 if ($(this).find('.cparts-txt-block').outerWidth() < 150) { 856 $(this).addClass('cparts-id317-column'); 857 } 858 var height = $(this).find('.cparts-txt-block').outerHeight(); 859 // if(height > 250){ 860 $(this).find('.cparts-img-block').find('img').css('height', height+'px'); 861 $(this).find('.cparts-img-block').css('height', height+'px'); 862 // } 863 var color = $(this).find('.dec-bg--primary').css('color'); 864 $(this).find('h4').css('color', color); 865 }); 866 867 // ããã¼04 868 $('div[class*="cparts-id318"]').each(function() { 869 if ($(this).children('div').outerWidth() < 250) { 870 $(this).addClass('cparts-id318-column'); 871 } 872 }); 873 $('.cparts-id318--01').each(function() { 874 $(this).find('.cparts-body-block').attr('style', ''); 875 }); 876 877 /* ------------------------------------------------------- 878 2022年追å 879 -------------------------------------------------------- */ 880 // ã¡ã¤ã³ç»å_ver.19 881 var partscol1 = $('.cparts-id402').find('.dec-bg--primary').css('background-color'); 882 (function () { 883 var unit = 100, 884 canvasList, 885 drawInfo = {}, 886 colorList = [], 887 innerFontColorList = [], 888 innerBgColorList = []; 889 890 /** 891 * Init function. 892 * 893 * Initialize variables and begin the animation. 894 */
895 function init() { 896 drawInfo.seconds = 0; 897 drawInfo.t = 0; 898 899 // Get all canvas elements 900 canvasList = document.querySelectorAll('.cparts-dec--wavebar'); 901 902 // Initialize each canvas 903 Array.prototype.forEach.call(canvasList, 904 function(canvas, index){ 905 var canvasDataSet = canvas.dataset, 906 inner = canvas.nextElementSibling, 907 innerDataSet; 908 canvas.style.height = String(canvas.height / devicePixelRatio) + "px"; 909 910 if ($(canvas).hasClass('dec-wavebar__01')) { 911 canvas.width = document.documentElement.clientWidth; 912 canvas.width *= devicePixelRatio; 913 canvas.height = canvas.width * .04; 914 canvas.height *= devicePixelRatio; 915 916 } else if ($(canvas).hasClass('dec-wavebar__02')){ 917 canvas.width = document.documentElement.clientWidth; 918 canvas.width *= devicePixelRatio; 919 canvas.height = canvas.width * .04; 920 canvas.height = canvas.height * devicePixelRatio +75; 921 } else if ($(canvas).hasClass('dec-wavebar__03')){ 922 canvas.width = document.documentElement.clientWidth; 923 canvas.width = canvas.width * devicePixelRatio / 2; 924 canvas.height = canvas.width * .04 + 20; 925 canvas.height = canvas.height * devicePixelRatio +150; 926 } 927 canvas.contextCache = canvas.getContext("2d"); 928 929 // Add color 930 if ($(canvas).hasClass('cparts-dec--wavebar')) { 931 colorList.push([partscol1]); 932 } 933 } 934 ); 935 update(); 936 } 937 var timer = null; 938 function update() { 939 // Each canvas 940 Array.prototype.forEach.call(canvasList, 941 function(canvas, index){ 942 draw(canvas, colorList[index]); 943 } 944 ); 945 // å ±éã®æç»æ å ±ã®æ´æ° 946 drawInfo.seconds = drawInfo.seconds + .014; 947 drawInfo.t = drawInfo.seconds*Math.PI; 948 // Re-call 949 if ($('.siteblock-header').find('.sitedesign-canvas-animetion').hasClass('sitedesign-canvas-animetion-on')){ 950 timer = setTimeout(update, 50); 951 } 952 } 953 clearTimeout(timer); 954 /** 955 * Draw animation function. 956 * 957 * This function draws one frame of the animation, waits 20ms, and then calls 958 * itself again. 959 */ 960 function draw(canvas, color) { 961 // 対象ã®canvasã®ã³ã³ããã¹ããåå¾ 962 var context = canvas.contextCache; 963 // ãã£ã³ãã¹ã®æç»ãã¯ãªã¢ 964 context.clearRect(0, 0, canvas.width, canvas.height); 965 966 //æ³¢ãæç» 967 if ($(canvas).hasClass('cparts-dec--wavebar')) { 968 if ($(canvas).hasClass('dec-wavebar__01')) { 969 drawWave(canvas, color[0], 1, 1, 800); 970 } else if ($(canvas).hasClass('dec-wavebar__02')){ 971 drawWave(canvas, color[0], 0.3, 1.2, 300); 972 drawWave(canvas, color[2], 0.4, 1.4, 100); 973 } else if ($(canvas).hasClass('dec-wavebar__03')){ 974 drawWave(canvas, color[0], 0.6, 0.9, 100); 975 } 976 } 977 } 978 /** 979 * æ³¢ãæç» 980 * drawWave(ãã£ã³ãã¹, è², ä¸éæåº¦, æ³¢ã®å¹ ã®zoom, æ³¢ã®éå§ä½ç½®ã®é ã) 981 */ 982 function drawWave(canvas, color, alpha, zoom, delay) { 983 var context = canvas.contextCache; 984 context.fillStyle = color; 985 context.globalAlpha = alpha; 986 987 context.beginPath(); //ãã¹ã®éå§ 988 drawSine(canvas, drawInfo.t / 0.5, zoom, delay); 989 context.lineTo(canvas.width + 10, canvas.height + 10); //ãã¹ãCanvasã®å³ä¸ã¸ 990 context.lineTo(0, canvas.height); //ãã¹ãCanvasã®å·¦ä¸ã¸ 991 context.closePath() //ãã¹ãéãã 992 context.fill(); //å¡ãã¤ã¶ã 993 } 994 /** 995 * Function to draw sine 996 * 997 * The sine curve is drawn in 10px segments starting at the origin. 998 * drawSine(ãã£ã³ãã¹, æé, æ³¢ã®å¹ ã®zoom, æ³¢ã®éå§ä½ç½®ã®é ã) 999 */ 1000 function drawSine(canvas, t, zoom, delay) { 1001 var xAxis = Math.floor(canvas.height/2); 1002 var yAxis = 0; 1003 var context = canvas.contextCache; 1004 // Set the initial x and y, starting at 0,0 and translating to the origin on 1005 // the canvas. 1006 var x = t; //æéãæ¨ªã®ä½ç½®ã¨ãã 1007 var y = Math.sin(x)/zoom; 1008 context.moveTo(yAxis, unit*y+xAxis); //ã¹ã¿ã¼ãä½ç½®ã«ãã¹ãç½®ã 1009 1010 // Loop to draw segments (æ¨ªå¹ ã®åãæ³¢ãæç») 1011 for (i = yAxis; i <= canvas.width + 10; i += 10) { 1012 if ($(canvas).hasClass('dec-wavebar__01')) { 1013 x = t+(-yAxis+i)/unit/zoom+40; 1014 y = Math.sin(x - delay)/4; 1015 } else if ($(canvas).hasClass('dec-wavebar__02')){ 1016 x = t+(-yAxis+i)/unit/zoom+10; 1017 y = Math.sin(x - delay)/2; 1018 } else if ($(canvas).hasClass('dec-wavebar__03')){ 1019 x = t+(-yAxis+i)/unit/zoom+1000; 1020 y = Math.sin(x - delay)/1; 1021 } 1022 context.lineTo(i, unit*y+xAxis); 1023 1024 } 1025 } 1026 init(); 1027 // }); 1028 })(); 1029 1030 /* ------------------------------------------------------- 1031 2023年追å 1032 -------------------------------------------------------- */ 1033 // id457ã®æç·æã®è²å¤æ´ 1034 $('.cparts-id457.cparts-h2decoration--linediagonal').each(function(index) { 1035 var uniqueid457Class = 'id457-addclass-' + index; 1036 $(this).addClass(uniqueid457Class); 1037 1038 var col = $(this).css('border-color'); 1039 var styleHtml = '<style>.' + uniqueid457Class + '::before {background-image: repeating-linear-gradient(45deg, ' + col + ' 0, ' + col + ' 1px, transparent 0, transparent 50%);}</style>'; 1040 $('head').append(styleHtml); 1041 });
1042 1043 /* â¼ ã»ã¬ã¯ã¿ã« .cparts-h2decoration--dot ã追å ï¼ã«ã³ãåºåãï¼ */ 1044$('.cparts-id457.cparts-h2decoration--lineanimation, .cparts-id457.cparts-h2decoration--dot').each(function(index) { 1045 const $el = $(this); 1046 1047 /* =============================== 1048 â¼ ã¯ã©ã¹æ¸ãæãå¦çï¼å ±éï¼ 1049 =============================== */ 1050 1051 // dec-line--grey â dec-bg--primary 1052 if ($el.hasClass('dec-line--grey')) { 1053 $el.removeClass('dec-line--grey'); 1054 } 1055 1056 // dec-line-pe--grey â dec-bg-pe--primary 1057 if ($el.hasClass('dec-line-pe--grey')) { 1058 $el.removeClass('dec-line-pe--grey').addClass('dec-bg-pe--primary'); 1059 } 1060 1061 /* =============================== 1062 â¼ å ã®ã©ã¤ã³ã«ã©ã¼å¦çï¼å ±éï¼ 1063 =============================== */ 1064 1065 // spanå ã®colorãåå¾ï¼ãªããã°h2èªèº«ã®colorï¼ 1066 const $span = $el.find('span[style*="color"]'); 1067 const color = $span.length ? $span.css('color') : $el.css('color'); 1068 1069 // CSS夿°ãè¨å®ï¼currentColorã«å¯¾å¿
1069ï¼ 1070 this.style.setProperty('--line-color', color); 1071 1072 /* =============================== 1073 â¼ text-align ã«å¿ãã margin èªåä»ä¸ï¼å ±éï¼ 1074 =============================== */ 1075 const textAlign = $el.css('text-align'); 1076 1077 if (textAlign === 'right') { 1078 this.style.setProperty('margin-left', 'auto', 'important'); 1079 } else if (textAlign === 'left') { 1080 this.style.setProperty('margin-right', 'auto', 'important'); 1081 } else if (textAlign === 'center') { 1082 this.style.setProperty('margin-left', 'auto', 'important'); 1083 this.style.setProperty('margin-right', 'auto', 'important'); 1084 } 1085 1086 /* =============================== 1087 â¼ IntersectionObserver ã§ã¢ãã¡ä»ä¸ 1088 â» lineanimation ã¯ã©ã¹ãæã£ã¦ããå ´åã®ã¿å®è¡ 1089 =============================== */ 1090 if ($el.hasClass('cparts-h2decoration--lineanimation')) { 1091 1092 const observer = new IntersectionObserver(function(entries) { 1093 entries.forEach(function(entry) { 1094 if (entry.isIntersecting) { 1095 if (!$el.hasClass('cparts-h2decoration--lineanimation-active')) { 1096 setTimeout(function() { 1097 $el.addClass('cparts-h2decoration--lineanimation-active'); 1098 }, 800); 1099 } 1100 observer.unobserve(entry.target); 1101 } 1102 }); 1103 }, { threshold: 0.1 }); 1104 1105 observer.observe(this); 1106 1107 } // if end 1108}); 1109 1110 // $('.cparts-id457.cparts-h2decoration--lineanimation').each(function(index) { 1111 // const $el = $(this); 1112 1113 // /* =============================== 1114 // â¼ ã¯ã©ã¹æ¸ãæãå¦çã追å 1115 // =============================== */ 1116 1117 // // dec-line--grey â dec-bg--primary 1118 // if ($el.hasClass('dec-line--grey')) { 1119 // $el.removeClass('dec-line--grey'); 1120 // } 1121 1122 // // dec-line-pe--grey â dec-bg-pe--primary 1123 // if ($el.hasClass('dec-line-pe--grey')) { 1124 // $el.removeClass('dec-line-pe--grey').addClass('dec-bg-pe--primary'); 1125 // } 1126 1127 // /* =============================== 1128 // â¼ ããããå ã®ã©ã¤ã³ã«ã©ã¼å¦ç 1129 // =============================== */ 1130 1131 // // spanå ã®colorãåå¾ï¼ãªããã°h2èªèº«ã®colorï¼ 1132 // const $span = $el.find('span[style*="color"]'); 1133 // const color = $span.length ? $span.css('color') : $el.css('color'); 1134
1135 // // CSS夿°ãè¨å®ï¼currentColorã«å¯¾å¿ï¼ 1136 // this.style.setProperty('--line-color', color); 1137 1138 // /* =============================== 1139 // â¼ text-align ã«å¿ãã margin èªåä»ä¸ 1140 // =============================== */ 1141 // const textAlign = $el.css('text-align'); 1142 1143 // if (textAlign === 'right') { 1144 // this.style.setProperty('margin-left', 'auto', 'important'); 1145 // } else if (textAlign === 'left') { 1146 // this.style.setProperty('margin-right', 'auto', 'important'); 1147 // } else if (textAlign === 'center') { 1148 // this.style.setProperty('margin-left', 'auto', 'important'); 1149 // this.style.setProperty('margin-right', 'auto', 'important'); 1150 // } 1151 1152 // /* =============================== 1153 // â¼ IntersectionObserver ã§ã¢ãã¡ä»ä¸ 1154 // =============================== */ 1155 // const observer = new IntersectionObserver(function(entries) { 1156 // entries.forEach(function(entry) { 1157 // if (entry.isIntersecting) { 1158 // if (!$el.hasClass('cparts-h2decoration--lineanimation-active')) { 1159 // setTimeout(function() { 1160 // $el.addClass('cparts-h2decoration--lineanimation-active'); 1161 // }, 800); 1162 // } 1163 // observer.unobserve(entry.target); 1164 // } 1165 // }); 1166 // }, { threshold: 0.1 }); 1167 1168 // observer.observe(this); 1169 // }); 1170 1171 1172 1173 1174 //æ°è¦ãããã¼ç¨ã³ã³ãã³ããã¼ã 1175 // ç¹å®ã®ã³ã³ãã³ããã¼ãï¼ãã´ã®ã¿ãªã©ï¼ä»¥å¤ã®ãããã¼ç¨ã³ã³ãã³ããã¼ãã®å¹ 1176 $('.cparts-header-block:not(.cparts-id468--01)').each(function() { 1177 $(this).parents('[class*="free_parts"]').addClass('sitedesign-headerparts__full'); 1178 $(this).parents('.freeParts').not('[class*="free_parts"] .freeParts').addClass('sitedesign-headerparts__full'); 1179 }); 1180 $('.cparts-header-block.cparts-id468--01').each(function() { 1181 $(this).parents('[class*="free_parts"]').addClass('sitedesign-headerparts__nofull'); 1182 $(this).parents('.freeParts').not('[class*="free_parts"] .freeParts').addClass('sitedesign-headerparts__nofull'); 1183 }); 1184 1185 // htmlã®ãã©ã³ããµã¤ãºãæãåºã 1186 var baseSize = $('html').css('font-size') 1187 baseSize = parseInt(baseSize); 1188 1189 // ãã©ã³ããµã¤ãºå¤æ´ãã¿ã³ãæ¼ãããæ 1190 $('.cparts-header-block__fontsize').find('button').on('click', function() { 1191 1192 // æ¨æº 1193 if ($(this).hasClass('cparts-btn-fontsize__sm')) { 1194 $('html').css('font-size', baseSize); 1195 $(this).addClass('cparts-btn-fontsize__active') 1196 $(this).siblings('button').removeClass('cparts-btn-fontsize__active') 1197 1198 // 大 1199 } else if ($(this).hasClass('cparts-btn-fontsize__md')) { 1200 $('html').css('font-size', baseSize * 1.2 + 'px'); 1201 $(this).addClass('cparts-btn-fontsize__active') 1202 $(this).siblings('button').removeClass('cparts-btn-fontsize__active') 1203 1204 // ç¹å¤§ 1205 } else if ($(this).hasClass('cparts-btn-fontsize__xl')) { 1206 $('html').css('font-size', baseSize * 1.4 + 'px'); 1207 $(this).addClass('cparts-btn-fontsize__active') 1208 $(this).siblings('button').removeClass('cparts-btn-fontsize__active') 1209 } 1210 }); 1211 1212 // ã®ããã¯ç³»ä¸è¦§ãã¼ã 1213 if($('#published').length > 0){ //å ¬éãµã¤ãã®ã¿ 1214 //ãªã³ã¯çæ 1215 $('.cparts-overlink-block').each(function() { 1216 if ($(this).find('.cparts-img-block').find('a').length > 0) { 1217 var url = $(this).find('.cparts-img-block').find('a').attr('href'); 1218 $(this).append('<a href="'+url+'" class="cparts-overlink-block-url">ã</a>'); 1219 } 1220 }); 1221 // ãã¦ã¹ãªã¼ãã¼æã®ã¢ãã¡ã¼ã·ã§ã³ 1222 $('[class*="cparts-id472--"]').find('.cparts-overlink-block-url').on('mouseover', function() { 1223 let back = $(this).parents('.cparts-hover--full').find('.dec-bg--primary').css('background-color'); 1224 if ($(this).parents('[class*="cparts-id472--"]').hasClass('cparts-hover--resize') || $(this).parents('[class*="cparts-id472--"]').hasClass('cparts-hover--full')) { 1225 if (window.matchMedia( "(min-width: 768px)" ).matches) { 1226 $(this).parents('.lay-row').children('div').removeClass('cparts-hover--resize-hover'); 1227 $(this).parents('.lay-row').children('div').addClass('cparts-hover--resize-hover-off'); 1228 $(this).parent('.cparts-body-block').parent('div').addClass('cparts-hover--resize-hover'); 1229 $(this).parent('.cparts-body-block').parent('div').removeClass('cparts-hover--resize-hover-off'); 1230 $(this).parents('.lay-row').children('div').find('.cparts-txt-block').hide(); 1231 let th = $(this); 1232 $(function(){ setTimeout(function(){ // 0.5ç§å¾ã«æ¦è¦è¡¨ç¤º 1233 th.parents('.lay-row').children('div').find('.cparts-txt-block').fadeIn(500); 1234 }, 500 ); }); 1235 // ãã¦ã¹ãªã¼ãã¼ã§å ¨ç»é¢ãµã¤ãº 1236 if ($(this).parents('[class*="cparts-id472--"]').hasClass('cparts-hover--full')) { 1237 let img = $(this).parent('.cparts-body-block').find('.cparts-img-block').find('a').html(); 1238 $(this).parents('.lay-row').css('background-color', back); 1239 $(this).parents('.lay-row').append(img); 1240 } 1241 } 1242 } 1243 });
1244 // ã«ã¼ã½ã«ãè¦ç´ ããå¤ããæã®ã¢ãã¡ã¼ã·ã§ã³ 1245 $('[class*="cparts-id472--"]').find('.cparts-overlink-block-url').on('mouseleave', function() { 1246 if ($(this).parents('[class*="cparts-id472--"]').hasClass('cparts-hover--resize') || $(this).parents('[class*="cparts-id472--"]').hasClass('cparts-hover--full')) { 1247 if (window.matchMedia( "(min-width: 768px)" ).matches) { 1248 $(this).parents('.lay-row').children('div').removeClass('cparts-hover--resize-hover'); 1249 $(this).parents('.lay-row').children('div').removeClass('cparts-hover--resize-hover-off'); 1250 // ãã¦ã¹ãªã¼ãã¼ã§å ¨ç»é¢ãµã¤ãº 1251 if ($(this).parents('[class*="cparts-id472--"]').hasClass('cparts-hover--full')) { 1252 $(this).parents('.lay-row').css('background-color', 'transparent'); 1253 $(this).parents('.lay-row').children('img').remove(); 1254 } 1255 } 1256 } 1257 }); 1258 } else { //ç·¨éãµã¤ãã®ã¿ 1259 // ãã¦ã¹ãªã¼ãã¼æã®ã¢ãã¡ã¼ã·ã§ã³ 1260 $('[class*="cparts-id472--"]').find('.cparts-img-block').find('img').on('mouseover', function() { 1261 let back = $(this).parents('.cparts-hover--full').find('.dec-bg--primary').css('background-color'); 1262 if ($(this).parents('[class*="cparts-id472--"]').hasClass('cparts-hover--resize') || $(this).parents('[class*="cparts-id472--"]').hasClass('cparts-hover--full')) { 1263 if (window.matchMedia( "(min-width: 768px)" ).matches) { 1264 $(this).parents('.lay-row').children('div').removeClass('cparts-hover--resize-hover'); 1265 $(this).parents('.lay-row').children('div').addClass('cparts-hover--resize-hover-off'); 1266 $(this).parents('.cparts-body-block').parent('div').addClass('cparts-hover--resize-hover'); 1267 $(this).parents('.cparts-body-block').parent('div').removeClass('cparts-hover--resize-hover-off'); 1268 $(this).parents('.lay-row').children('div').find('.cparts-txt-block').hide(); 1269 let th = $(this); 1270 $(function(){ setTimeout(function(){ // 0.5ç§å¾ã«æ¦è¦è¡¨ç¤º 1271 th.parents('.lay-row').children('div').find('.cparts-txt-block').fadeIn(500); 1272 }, 500 ); }); 1273 // ãã¦ã¹ãªã¼ãã¼ã§å ¨ç»é¢ãµã¤ãº 1274 if ($(this).parents('[class*="cparts-id472--"]').hasClass('cparts-hover--full')) { 1275 let img = $(this).parents('.cparts-body-block').find('.cparts-img-block').find('a').html(); 1276 $(this).parents('.lay-row').css('background-color', back); 1277 $(this).parents('.lay-row').append(img); 1278 } 1279 } 1280 } 1281 }); 1282 // ã«ã¼ã½ã«ãè¦ç´ ããå¤ããæã®ã¢ãã¡ã¼ã·ã§ã³ 1283 $('[class*="cparts-id472--"]').find('.cparts-img-block').find('img').on('mouseleave', function() { 1284 if ($(this).parents('[class*="cparts-id472--"]').hasClass('cparts-hover--resize') || $(this).parents('[class*="cparts-id472--"]').hasClass('cparts-hover--full')) { 1285 if (window.matchMedia( "(min-width: 768px)" ).matches) { 1286 $(this).parents('.lay-row').children('div').removeClass('cparts-hover--resize-hover'); 1287 $(this).parents('.lay-row').children('div').removeClass('cparts-hover--resize-hover-off'); 1288 if ($(this).parents('[class*="cparts-id472--"]').hasClass('cparts-hover--full')) { 1289 $(this).parents('.lay-row').css('background-color', 'transparent'); 1290 $(this).parents('.lay-row').children('img').remove(); 1291 } 1292 } 1293 } 1294 }); 1295 } 1296 1297 if (window.matchMedia( '(min-width: 768px)' ).matches) { 1298 $('[class*="cparts-id472--"].cparts-hover--resize').each(function() { 1299 var bodyHight01 = $(this).find('.cparts-txt-block').outerHeight(true); 1300 $(this).find('.lay-padding-x--0').css('height', bodyHight01); 1301 }); 1302 $('[class*="cparts-id472--"].cparts-hover--full').each(function() { 1303 var bodyHight02 = $(this).find('.lay-row').outerHeight(true); 1304 $(this).find('.lay-row').css({'height':bodyHight02, 'overflow':'hidden'}); 1305 $(this).find('.lay-padding-x--0').css('height', bodyHight02); 1306 var bodyWidth = $(this).find('.lay-row').outerWidth(); 1307 $(this).find('.cparts-img-block img').css('width', bodyWidth); 1308 }); 1309 } 1310 1311 // æµããã©ã¤ã³ç³»ç»åãããã¹ã 1312 $('.cparts-decoslider-block.cparts-current--rightleft,.cparts-decoslider-block.cparts-current--leftright').each(function(){ 1313 var loopslider = $(this).find('ul').clone(true); 1314 var loopsliderW = $(this).find('ul').width(); 1315 var loopsliderH = $(this).find('ul').height(); 1316 var self = $(this); 1317 $(this).find('.cparts-txt-block').append(loopslider).css({display: 'flex', height: loopsliderH+'px'}); 1318 $(this).find('ul').wrapAll('<div class="cparts-loopslider--wrap"></div>'); 1319 $(this).find('.cparts-loopslider--wrap').css({width: (loopsliderW*2)+'px'}); 1320 1321 1322 if ($(this).hasClass('cparts-current--rightleft')) { // å³ãã左㸠1323 function loopMove(){ // ã«ã¼ã 1324 self.find('.cparts-loopslider--wrap').animate({left: '-'+loopsliderW+'px'},25000,'linear',function(){
1325 self.find('.cparts-loopslider--wrap').css({left:'0'}); 1326 loopMove(); 1327 }); 1328 }; 1329 loopMove(); 1330 } else if ($(this).hasClass('cparts-current--leftright')) { // å·¦ããå³ã¸ 1331 function loopMove(){ // ã«ã¼ã 1332 self.find('.cparts-loopslider--wrap').animate({right: '-'+loopsliderW+'px'},25000,'linear',function(){ 1333 self.find('.cparts-loopslider--wrap').css({right:'0'}); 1334 loopMove(); 1335 }); 1336 }; 1337 loopMove(); 1338 } 1339 }); 1340 1341 if ($('.cparts-decoslider-block').length) { 1342 var timer = false; 1343 var prewidth = $(window).width(); 1344 $(window).resize(function() { 1345 if (timer !== false) { 1346 clearTimeout(timer); 1347 } 1348 timer = setTimeout(function() { 1349 var nowWidth = $(window).width(); 1350 if(prewidth !== nowWidth){ 1351 // ãªãã¼ã 1352 location.reload(); 1353 } 1354 prewidth = nowWidth; 1355 }, 10); 1356 }); 1357 } 1358 1359 // ã¡ã¤ã³ç»å_ver.21 1360 $('.cparts-id504').each(function() { 1361 var p = $(this).css('padding-top'); 1362 $(this).find('.cparts-head-block').css('height','calc( '+p+' + 150px)'); 1363 }); 1364 $(window).on('load', function(){ 1365 1366 // HEADERãããã¯ã«ã¡ã¤ã³ç»åç³»ã®ã³ã³ãã³ããã¼ããé ç½®ãããããªã¼ãã¼ããããå ´å 1367 if (window.matchMedia( '(min-width: 768px)' ).matches) { 1368 $('.siteblock-header .freeParts,.siteblock-header [id*="EDIT-free_parts"]').has('.cparts-id504').css('width','100%'); 1369 } 1370 1371 $('.cparts-id504').each(function() { 1372 // ããã¹ãéã«åããã¦ç»åã®é«ãèª¿æ´ 1373 if ($(this).find('.cparts-txt-block').find('.cparts-id504__ttl').outerHeight() > $(this).find('.cparts-img-block').height()) { 1374 var d = $(this).find('.cparts-txt-block').find('.cparts-id504__ttl').outerHeight(); 1375 $(this).find('.cparts-img-block').height(d); 1376 $(this).find('.cparts-id504__ttl-span').height(d - 150); 1377 } 1378 $(this).find('.cparts-id504__ttl').parent('.h1-canvas').find('canvas').hide(); 1379 $(this).find('.cparts-id504__ttl').parent('.h1-canvas').removeClass(); 1380 // HEADERã»UPPERã¡ã¤ã³ãã¸ã¥ã¢ã«ã®ã¿ 1381 if ( 1382 $(this).parents('#upper').length > 0 || 1383 $(this).parents('.siteblock-upper').length > 0 || 1384 $(this).parents('.upper').length > 0 || 1385 $(this).parents('#header').length > 0 || 1386 $(this).parents('.siteblock-header').length > 0 || 1387 $(this).parents('.header').length > 0 || 1388 $(this).parents('.cms-contentsparts-parts-preview').length > 0 1389 ) { 1390 // H1æ¨ªå¹ 1391 if ($(this).outerWidth() == $(window).width() || $(this).outerWidth() > $(window).width()) { 1392 $(this).find('.cparts-txt-block').find('.cparts-id504__ttl').attr('style', 'width:70vw !important;'); 1393 } else { 1394 $(this).find('.cparts-id504__ttl').addClass('dec-txt--primary'); 1395 } 1396 } 1397 }); 1398 1399 }); 1400 1401 // ã¹ã¯ãã¼ã«ãã¦ã³ 1402 $('.cparts-id504').each(function() { 1403 const before = $(this).find('.cparts-notes-block > div.dec-txt--primary'); 1404 const text = before.text(); 1405 const textArray = text.split(''); 1406 let after = ''; 1407 $.each(textArray,function(index,val){ 1408 after += "<span>" + val + "</span>"; 1409 }); 1410 before.html(after); 1411 const textcnt = textArray.length; 1412 const circleR = ($(this).find('.cparts-notes-block').height()) / 2; 1413 const fontH = ($(this).find('.cparts-notes-block > div.dec-txt--primary').height()); 1414 const dist = circleR - fontH; 1415 $(this).find('.cparts-notes-block > div span').each(function(index) { 1416 const num = index + 1; 1417 const radX = Math.sin(360 / textcnt * num * (Math.PI / 180)); 1418 const radY = Math.sin((90 - (360 / textcnt * num)) * (Math.PI / 180)); 1419 $(this).css('transform', 'translate(' + dist * radX + 'px, ' + -(dist * radY) + 'px) rotate(' + 360 / textcnt * num + 'deg)'); 1420 }); 1421 });
1422 1423 // 䏿ãæå 1424 if($('div[class*="cparts-id527"]').length){ 1425 function rgbtohex(orig){ 1426 var rgb = orig.replace(/\s/g,'').match(/^rgba?\((\d+),(\d+),(\d+)/i); 1427 return (rgb && rgb.length === 4) ? "#" + 1428 ("0" + parseInt(rgb[1],10).toString(16)).slice(-2) + 1429 ("0" + parseInt(rgb[2],10).toString(16)).slice(-2) + 1430 ("0" + parseInt(rgb[3],10).toString(16)).slice(-2) : orig; 1431 } 1432 1433 $('div[class*="cparts-id527"]').each(function(){ 1434 var colorTxt = $(this).parents().css('color'); 1435 let hexColor = rgbtohex(colorTxt); 1436 if (window.matchMedia( '(min-width: 768px)' ).matches) { 1437 $(this).find('.cparts-id527-01__ttl,.cparts-id527-02__ttl').css({'-webkitTextStroke':'2px ' + hexColor,'textStroke':'2px ' + hexColor}); 1438 } else { 1439 $(this).find('.cparts-id527-01__ttl,.cparts-id527-02__ttl').css({'-webkitTextStroke':'1px ' + hexColor,'textStroke':'1px ' + hexColor}); 1440 } 1441 }); 1442 } 1443 1444 // ã¡ã¤ã³ç»å_ver.23 1445 if($('.cparts-id539').length){ 1446 $('.cparts-id539').each(function(){ 1447 var primaryC539 = $(this).find('.cparts-body-block > .dec-bg--primary').css('background-color'); 1448 console.log(primaryC539); 1449 var contentsC539 = primaryC539.replace('rgb(', 'rgba(').replace(')', ','); 1450 console.log(contentsC539); 1451 $(this).find('.cparts-body-block > .dec-bg--primary').css({'cssText':'background: linear-gradient(to bottom, ' + contentsC539 + '1) 0%,' + contentsC539 + '0) 80%) !important;'}); 1452 }); 1453 } 1454 $('body:not(.column1) #contents #upper .cparts-id539,.column2 #contents #upper .cparts-id539,.column2 .row .upper .cparts-id539,#main .cparts-id539 ,#bottom .cparts-id539 ,#side .cparts-id539 ,#right .cparts-id539 ,#opt1 .cparts-id539 ,#opt2 .cparts-id539 ,#opt3 .cparts-id539 ,#footer .cparts-id539 ,.main .cparts-id539 ,.bottom .cparts-id539 ,.side .cparts-id539 ,.right .cparts-id539 ,.opt1 .cparts-id539 ,.opt2 .cparts-id539 ,.opt3 .cparts-id539 ,.footer .cparts-id539 ,.siteblock-main .cparts-id539 ,.siteblock-bottom .cparts-id539 ,.siteblock-side .cparts-id539 ,.siteblock-right .cparts-id539 ,.siteblock-opt1 .cparts-id539 ,.siteblock-opt2 .cparts-id539 ,.siteblock-opt3 .cparts-id539 ,.siteblock-footer .cparts-id539').each(function() { 1455 $(this).find('.cparts-caption-block').remove(); 1456 }); 1457 1458 // æ°ã»ã¯ãªãã¯ã§éã 1459 if ($('[class*="cparts-id170"]').length) { 1460 $('.cparts-id170__head-block').each(function(){ 1461 $(this).nextUntil('.cparts-id170__foot-block').wrapAll('<div class="cparts-id170__body-block cparts-id170__body-block-first cparts-id170__body-block-last"></div>'); 1462 $(this).nextAll().each(function(){ 1463 if($(this).hasClass('cparts-id170__foot-block')) return false; 1464 $(this).hide(); 1465 $('.cparts-id170__foot-block p').remove(); 1466 }); 1467 }); 1468 $('.cparts-id170__head-block').off().on('click', function() { 1469 $(this).find('.cparts-icon-block').toggleClass('cparts-icon-block-open'); 1470 $(this).nextUntil('.cparts-id170__foot-block', '.cparts-id170__body-block').slideToggle(500); 1471 setTimeout(function() { 1472 $('.cparts-id170__body-block').css({'overflow':'visible'}); 1473 }, 2000); 1474 }); 1475 } 1476 1477 // æ°ã»ã¹ããããªã¹ã 1478 $('[class*="cparts-id289"]').each(function(){ 1479 $(this).find('ul li:nth-child(2n+1)').addClass('dec-bg--light dec-bg-pe--primary'); 1480 $(this).find('ul li:nth-child(2n+1)').append('<span class="dec-bg--light"></span>'); 1481 $(this).find('ul li:nth-child(2n)').addClass('dec-line-pe--primary'); 1482 }); 1483 1484 // æ°ã»ããããã質åï¼ã¯ãªãã¯ã§åçãè¡¨ç¤ºï¼ 1485 $('.cparts-id045--02').each(function(){ 1486 $(this).find('.cparts-click-block').on('click',function(){ 1487 $($(this).next('dd')).slideToggle(500); 1488 }); 1489 }); 1490 1491 // ã«ã¦ã³ã¿ã¼ãã¼ã 1492 $('[class*="cparts-id544--"].box .cparts-count-block, [class*="cparts-id546--"].box .cparts-count-block').one('inview', function(event, isInView){ 1493 if (isInView) { 1494 //è¦ç´ ãè¦ããã¨ãã«å®è¡ããå¦ç 1495 $(this).find('.cparts-no-block').each(function(){ 1496 $(this).prop('Counter',0).animate({//0ããã«ã¦ã³ãã¢ãã 1497 Counter: $(this).text() 1498 }, { 1499 // ã¹ãã¼ããã¢ãã¡ã¼ã·ã§ã³ã®è¨å® 1500 duration: 2000,//æ°åã大ããã»ã©å¤åã®ã¹ãã¼ããé ããªãã2000=2ç§ 1501 easing: 'swing',//åãã®ç¨®é¡ãä»ã«ãlinearãªã©è¨å®å¯è½ 1502 step: function (now) { 1503 $(this).text(Math.ceil(now)); 1504 } 1505 }); 1506 }); 1507 } 1508 });
1509 1510 // æ°ï¼ã¿ãåãæ¿ã 1511 // ã¿ã°åé¤ã»é表示 1512 $('.cparts-id177__tabstart-block p,.cparts-id177__tablast-block p,.cparts-id177__foot-block p').remove(); 1513 $('.cparts-id177__body-block,.cparts-id177__inner-block,.cparts-id177__note-block').hide(); 1514 1515 // 追å ããã³ã³ãã³ããã¼ããå²ã 1516 $('.cparts-id177__tabstart-block').each(function() { 1517 $(this).nextUntil('.cparts-id177__tablast-block').wrapAll('<div class="cparts-id177__body-block"></div>'); 1518 }); 1519 1520 // å ¬éãµã¤ãã®å¦ç 1521 var edit_site = $('#cms_contents_area').length; 1522 if(edit_site === 0) { 1523 $('.cparts-id177__tabstart-block, .cparts-id177__tablast-block, .cparts-id177__foot-block').hide() 1524 }; 1525 1526 $('.cparts-id177__head-block').each(function(){ 1527 // èªèº«ã®liã«å¯¾ãã¦å¦çãè¡ã 1528 $(this).find('li > span').each(function(i){ 1529 // ã¯ã©ã¹åã追å ãã 1530 $(this).addClass('cparts-tab-block__0' + (i+1)); 1531 var li = $(this).length; 1532 // æåã®è¦ç´ ã«ã¯select-on 1533 if(i === 0) $(this).addClass('cparts-select-on'); 1534 1535 // ã¯ãªãã¯ã¤ãã³ãã追å 1536 $(this).off().on('click', function(event) { 1537 1538 // èªåã®ã°ã«ã¼ãã®select-onãåé¤ 1539 $(this).parents('.cparts-id177__head-block').find('.cparts-select-on').removeClass('cparts-select-on'); 1540 $(this).parent('li').siblings('li').find('span > span').addClass('dec-bg--light').removeClass('dec-bg--primary dec-line-pe--primary'); 1541 1542 // èªåã«select-onã追å 1543 $(this).addClass('cparts-select-on'); 1544 $(this).find('span').removeClass('dec-bg--light').addClass('dec-bg--primary dec-line-pe--primary'); 1545 var show_flag = 0; // 表示ãã©ã°ã1ã®éã¯è¡¨ç¤ºãã 1546 var show_class = $(this).attr('class').replace(' cparts-select-on',''); // 表示ããã¯ã©ã¹å 1547 $(this).parents('.cparts-id177__head-block').nextAll().each(function(index, el) { 1548 if($(this).hasClass('cparts-id177__foot-block')) return false; 1549 $(this).hide(); 1550 }); 1551 $(this).parents('.cparts-id177__head-block').nextAll().each(function(index, el) { 1552 if($(this).hasClass('cparts-id177__foot-block')) return false; 1553 if($(this).hasClass('cparts-id177__tabstart-block') && $(this).hasClass(show_class) && show_flag === 0) { 1554 show_flag = 1; 1555 if(edit_site) 1556 $(this).fadeIn(1000); 1557 } else if($(this).hasClass('cparts-id177__tablast-block') && $(this).hasClass(show_class) && show_flag === 1) { 1558 show_flag = 0; 1559 if(edit_site) 1560 $(this).fadeIn(1000); 1561 } else if(show_flag === 1) { 1562 $(this).fadeIn(1000); 1563 } 1564 }); 1565 return false; 1566 }); 1567 }); 1568 var index = 1; 1569 $(this).nextAll().each(function() { 1570 if($(this).hasClass('cparts-id177__foot-block')) return false; 1571 if($(this).hasClass('cparts-id177__tabstart-block')) { 1572 $(this).addClass('cparts-tab-block__0'+index); 1573 $(this).attr('data','cparts-tab-block__0'+index); 1574 if(index === 1) $(this).show(); 1575 else $(this).hide(); 1576 } else if($(this).hasClass('cparts-id177__tablast-block')) { 1577 $(this).addClass('cparts-tab-block__0'+index); 1578 $(this).attr('data','cparts-tab-block__0'+index); 1579 if(index === 1) $(this).show(); 1580 else $(this).hide(); 1581 index++; 1582 } else { 1583 $(this).addClass('cparts-tab-block__0'+index); 1584 $(this).attr('data','cparts-tab-block__0'+index); 1585 if(index === 1) $(this).show(); 1586 else $(this).hide(); 1587 } 1588 }); 1589 }); 1590 1591 // ãã¬ãã¯ã¹è¦ªãããã¯è¿½å 1592 $('.cparts-flexinline-block').not('.cparts-flexinline-block+.cparts-flexinline-block').each(function(){ 1593 $(this).nextUntil(':not(.cparts-flexinline-block)').addBack().wrapAll('<div class="cparts-flex-block"><div class="lay-row"></div></div>'); 1594 }).parent('.cparts-flex-block:empty').remove(); 1595 1596 // æ°ã»ãã©ã³å¥ä¾¡æ ¼è¡¨ï¼æ¨ªä¸¦ã³ï¼ 1597 $('.cparts-id113 .cparts-caption-block h4').addClass('dec-bg-pe--primary'); 1598 1599 /* ------------------------------------------------------- 1600 2024年追å 1601 -------------------------------------------------------- */ 1602 // æ°ã»ä¸è¦§ãã¼ã_ver.1 1603 $('.cparts-id35').each(function() { 1604 $(this).find('.cparts-notes-block li').addClass('dec-bg--primary'); 1605 });
1606 1607 // ã¡ã¤ã³ç»å_ver.26 1608 $('.cparts-id568').each(function() { 1609 var h1text = $(this).find('.cparts-id568__ttl').text(); 1610 var bgColor = $(this).css('background-color'); 1611 var rgbValues = bgColor.match(/\d+/g); // RGBã®å¤ãæ½åº 1612 var rgbString = rgbValues.join(','); // ã«ã³ãåºåãã®æååã«å¤æ 1613 var h1fontFamily = $(this).find('h1').css('font-family'); 1614 // ããã«ã¯ã©ã¼ããã¨ã¹ã±ã¼ããã 1615 h1fontFamily = h1fontFamily.replace(/"/g, ''); 1616 $(this).find('h1').after('<p class="cparts-notes-block cparts-animation--blurTrigger cparts-animation__duration-time08 cparts-animation__delay-time06 dec-txt--primary"><span style="font-family: ' + h1fontFamily + ';">' + h1text + '</span><span style="background: linear-gradient(to bottom, rgba(' + rgbString + ',0) 0%,rgba(' + rgbString + ',1) 75%);"></span></p>'); 1617 $(this).css('background-color', 'transparent'); 1618 }); 1619 1620 // ã¡ã¤ã³ç»å_ver.29 1621 if ($('.cparts-id576').length) { 1622 $('.cparts-id576').each(function() { 1623 var primaryC579 = $(this).find('.cparts-body-block').css('background-color'); // å®éã®è¦ç´ ã®èæ¯è²ãåå¾ 1624 if (primaryC579) { 1625 // RGBå½¢å¼ãRGBAå½¢å¼ã«å¤æ 1626 var contentsC579 = primaryC579.replace('rgb(', 'rgba(').replace(')', ','); 1627 // ã¹ã¿ã¤ã«ã追å 1628 $('<style>') 1629 .prop('type', 'text/css') 1630 .html('.cparts-id576 .cparts-body-block.dec-bg--primary.dec-bg-pe--primary::before { background: linear-gradient(65deg,' + contentsC579 + '1) 0%,' + contentsC579 + ' 0) 60%) !important; }') 1631 .appendTo('head'); // headã«è¿½å 1632 } 1633 }); 1634 } 1635 1636 // ã¡ã¤ã³ç»å_ver.31 1637 if ($('.cparts-id580').length) { 1638 $('.cparts-id580').each(function() { 1639 var backgroundImage = $(this).css('background-image'); // 親è¦ç´ ã®èæ¯ç»å 1640 var backgroundSize = $(this).css('background-size'); // 親è¦ç´ ã®background-size 1641 1642 // èæ¯ç»åãè¨å®ããã¦ããå ´å 1643 if (backgroundImage !== 'none') { 1644 // åå¨ããstyle屿§ãåé¤ 1645 $(this).removeAttr('style'); 1646 1647 // å«è¦ç´ ã®cparts-body-blockã«cparts-add-afterã¯ã©ã¹ã追å 1648 $(this).find('.cparts-body-block').each(function() { 1649 $(this).addClass('cparts-add-after'); // cparts-add-afterã¯ã©ã¹ã追å 1650 1651 var style = 'background-image: ' + backgroundImage + '; background-size: ' + backgroundSize + ';'; 1652 1653 // çä¼¼è¦ç´ ã«ã¹ã¿ã¤ã«ãé©ç¨ 1654 $(this).append('<style>.cparts-id580 .cparts-body-block.cparts-add-after::after { background-color: transparent !important; content: ""; position: absolute; top: 0; left: 0; right: 0; bottom: 0; ' + style + ' }</style>'); 1655 }); 1656 } 1657 }); 1658 } 1659 1660 1661 // ããã¼ãã£ã³ã°ããã¼ãåå¨ããå ´åããã¼ã¸ããããã¿ã³ã®z-indexã夿´ 1662 if ($('.cparts-id582, .cparts-id583, .cparts-id584').length) { 1663 $('.sitedesign-pagetopbtn').each(function () { 1664 this.style.setProperty('z-index', '999', 'important'); 1665 }); 1666 } 1667 1668 // ããã¼ãã£ã³ã°ããã¼_ver.1&2 1669 if ($('.cparts-id582, .cparts-id583').length) { 1670 var $floatingBanner = $('.cparts-id582, .cparts-id583'); 1671 var $footerBlock = $('body'); 1672 var $pageTopBtn = $('.sitedesign-pagetopbtn, .pageTop a'); 1673 1674 // ã¡ãã£ã¢ã¯ã¨ãªããã§ã㯠1675 var mediaQuery = window.matchMedia('(max-width: 767px)'); 1676 1677 function adjustPageTopBtnPosition() { 1678 if (!mediaQuery.matches) return; 1679 var bannerHeight = $floatingBanner.outerHeight(); 1680 1681 if ($floatingBanner.is(':visible')) { 1682 $pageTopBtn.css({ 1683 bottom: (bannerHeight + 10) + 'px', // é«ãå + 10px ã追å 1684 zIndex: 999 // z-indexã101ã«è¨å® 1685 }); 1686 } else { 1687 $pageTopBtn.css({ 1688 bottom: '', // é«ãå + 10px ã追å 1689 zIndex: 2 // z-indexã101ã«è¨å® 1690 }); 1691 } 1692 } 1693 1694 function handleResize() { 1695 if (!mediaQuery.matches) return; 1696 1697 var windowHeight = window.innerHeight; 1698 var scrollBottom = window.scrollY + windowHeight; 1699 var footerOffsetTop = $footerBlock.offset().top; 1700 var bannerHeight = $floatingBanner.outerHeight(); 1701 1702 if (scrollBottom >= footerOffsetTop) { 1703 if ($footerBlock.css('padding-bottom') !== bannerHeight + 'px') { 1704 $footerBlock.css('padding-bottom', bannerHeight + 'px'); 1705 } 1706 } else { 1707 if ($footerBlock.css('padding-bottom') !== '') { 1708 $footerBlock.css('padding-bottom', ''); 1709 } 1710 } 1711 } 1712 1713 // åæè¨å®ã¨ã¦ã£ã³ãã¦ãµã¤ãºå¤æ´æã®ã¤ãã³ããªã¹ãã¼ 1714 adjustPageTopBtnPosition(); 1715 handleResize(); 1716 mediaQuery.addListener(handleResize); 1717 1718 $(document).ready(function() { 1719 // .cparts-id583 ãåè¦ç´ ã¨ãã¦å«ã親è¦ç´ ãç¹å® 1720 $('.siteblock-header, .siteblock-bottom, .siteblock-opt1').has('.cparts-id583').
1720css({ 1721 position: 'relative', 1722 zIndex: 100 1723 }); 1724 }); 1725 1726 } 1727 1728 // ããã¼ãã£ã³ã°ããã¼_ver.3 1729 if ($('.cparts-id584').length) { 1730 $(document).ready(function () { 1731 $('.cparts-icon-block').on('click', function () { 1732 var $parent = $(this).closest('.cparts-id584'); 1733 if ($parent.length) { 1734 $parent.css({ 1735 'transition': 'opacity 0.5s ease', 1736 'opacity': '0' 1737 }); 1738 setTimeout(function () { 1739 $parent.css('display', 'none'); 1740 }, 500); // 0.5ç§å¾ã«å®å ¨ã«é表示㫠1741 } 1742 }); 1743 }); 1744 } 1745 1746 // ããã¼ãã£ã³ã°ããã¼_ver.1&2&3 1747 if ($('.cparts-id582, .cparts-id583, .cparts-id584').length) { 1748 $(document).ready(function() { 1749 // 対象ã¨ãªã親è¦ç´ ã®ã»ã¬ã¯ã¿ã¼ãå®ç¾© 1750 const parentSelectors = [ 1751 '#header', '#upper', '#main', '#bottom', '#side', '#right', '#opt1', '#opt2', '#opt3', '#footer', 1752 '.header', '.upper', '.main', '.bottom', '.side', '.right', '.opt1', '.opt2', '.opt3', '.footer', 1753 '.siteblock-header','.siteblock-upper', '.siteblock-main', '.siteblock-bottom', '.siteblock-side', '.siteblock-right', 1754 '.siteblock-opt1', '.siteblock-opt2', '.siteblock-opt3', '.siteblock-footer' 1755 ]; 1756 1757 // ãã§ãã¯å¯¾è±¡ã®åè¦ç´ ã»ã¬ã¯ã¿ã¼ãå®ç¾© 1758 const childSelectors = '.cparts-id582, .cparts-id583, .cparts-id584'; 1759 1760 // æå®ããã親è¦ç´ ã®ä¸ã«åè¦ç´ ãåå¨ããå ´åã«ã¹ã¿ã¤ã«ãé©ç¨ 1761 $(parentSelectors.join(',')).has(childSelectors).css({ 1762 position: 'relative', 1763 zIndex: 200 1764 }); 1765 }); 1766 }; 1767 1768 }); 1769 1770 $(window).on('load resize' , function() { 1771 1772 // å ¬éãµã¤ãã§å·¦å³ã¹ã©ã¤ãããªã¨ã¼ã·ã§ã³æã®bodyã®æ¨ªæºãã鲿¢ãã 1773 if($('body:not(#header,#upper,#bottom,#main,#side,#right,#opt1,#opt2,#opt3,#footer) > div#cms_contents_area').length){ 1774 $('body').css('overflow-x',''); 1775 } else if($('.cparts-animate--slideInLeft,cparts-animate--slideInRIght').length) { 1776 $('body').css('overflow-x','hidden'); 1777 } 1778 1779 // ã¡ã¤ã³ç»å_ver.21 1780 $('.cparts-id504 .cparts-notes-block').on('click',function(){ 1781 // ã¹ã¯ãã¼ã«ãã¦ã³ã¯ãªãã¯ã¢ãã¡ã¼ã·ã§ã³ 1782 if ($(this).parents('#upper').length > 0 || $(this).parents('.siteblock-upper').length > 0 || $(this).parents('.upper').length > 0) { 1783 if ($('body').find('.siteblock-header').length > 0) { 1784 var targetY = $('.siteblock-header').height() + $('.cparts-id504').outerHeight(); 1785 }else if ($('body').find('#header').length > 0) { 1786 var targetY = $('#header').height() + $('.cparts-id504').outerHeight(); 1787 }else if ($('body').find('.header').length > 0) { 1788 if ($('body').hasClass('column2')) { 1789 var targetY = $('.cparts-id504').outerHeight(); 1790 }else if ($('body').hasClass('column1')) { 1791 var targetY = $('.header').height() + $('.cparts-id504').outerHeight(); 1792 } 1793 } 1794 }else if ($(this).parents('#header').length > 0 || $(this).parents('.siteblock-header').length > 0 || $(this).parents('.header').length > 0) { 1795 if ($('body').find('.siteblock-header').length > 0) { 1796 var targetY = $('.siteblock-header').height(); 1797 }else if ($('body').find('#header').length > 0) { 1798 var targetY = $('#header').height(); 1799 }else if ($('body').find('.header').length > 0){ 1800 var targetY = $('.header').height(); 1801 } 1802 } 1803 if (window.matchMedia( "(min-width: 768px)" ).matches) { 1804 $("html, body").stop().animate({scrollTop: targetY}, 500, 'swing'); 1805 return false; 1806 } 1807 }); 1808 1809 /* ------------------------------------------------------- 1810 2021年追å 1811 -------------------------------------------------------- */ 1812 // ãã¡ã¤ã³ç»å_ver.8ãã¢ãã¡ã¼ã·ã§ã³ç¨class追å 1813 $('.cparts-id285 .cparts-txt-block').each(function(){ 1814 var imgPos = $(this).offset().top; 1815 var scroll = $(window).scrollTop(); 1816 var windowHeight = $(window).height(); 1817 if (scroll > imgPos - windowHeight + windowHeight/5){ 1818 $(this).addClass('cparts-fadeIn--id285'); 1819 } 1820 });
1821 1822 // ãããã¼ã¯ã³ã°ãªããã¬ã¤ã¢ã¦ããã¢ãã¡ã¼ã·ã§ã³ç¨class追å 1823 $('.cparts-id286--01 .cparts-js-block,.cparts-id286--02 .cparts-js-block').each(function(){ 1824 var imgPos = $(this).offset().top; 1825 var scroll = $(window).scrollTop(); 1826 var windowHeight = $(window).height(); 1827 if (scroll > imgPos - windowHeight + windowHeight/5){ 1828 $(this).addClass('cparts-fadeIn--id286'); 1829 } 1830 }); 1831 1832 //ç®æ¬¡ãã¼ããé«ãåããã 1833 if (window.matchMedia( "(min-width: 768px)" ).matches) { 1834 $('.cparts-var03-type18').each(function() { 1835 var maxHeight = 0; 1836 $(this).find('.cparts-body-block').each(function() { 1837 if ($(this).height() > maxHeight) maxHeight = $(this).height(); 1838 }); 1839 $(this).find('.cparts-body-block').height(maxHeight); 1840 }); 1841 } 1842 1843 // ãå ±éãã¹ã©ã¤ã 1844 //å ¨ã¦ã®ã¹ã©ã¤ããPCé表示ãã¢ãã¤ã«é表示è¨å®ã®å ´åç¢å°ãé表示ã«ãã 1845 $('.cparts-slideview-block').each(function() { 1846 if($('#published').length>0){ 1847 if (window.matchMedia( "(min-width: 768px)" ).matches) { 1848 if ($(this).find('.cparts-slider-block').children('div').length == $(this).find('.cparts-slider-block').children('.cparts-hide-pc').length) { 1849 $(this).find('.cparts-prevbtn-block').hide(); 1850 $(this).find('.cparts-nextbtn-block').hide(); 1851 }else{ 1852 $(this).find('.cparts-prevbtn-block').show(); 1853 $(this).find('.cparts-nextbtn-block').show(); 1854 } 1855 } 1856 } 1857 if (window.matchMedia( "(max-width: 767px)" ).matches) { 1858 if ($(this).find('.cparts-slider-block').children('div').length == $(this).find('.cparts-slider-block').children('.cparts-hide-mb').length) { 1859 $(this).find('.cparts-prevbtn-block').hide(); 1860 $(this).find('.cparts-nextbtn-block').hide(); 1861 }else{ 1862 $(this).find('.cparts-prevbtn-block').show(); 1863 $(this).find('.cparts-nextbtn-block').show(); 1864 } 1865 } 1866 }); 1867 1868 // ã¹ããããªã¹ã 1869 if (window.matchMedia('(max-width: 768px)').matches) { 1870 $('div[class*="cparts-id297"]').each(function() { 1871 var hi = $(this).find('.lay-col12-xs-9').find('img').outerHeight(); 1872 var h = hi / 2; 1873 if ($(this).next('div').hasClass('cparts-id297--01') || $(this).next('div').hasClass('cparts-id297--02')) { 1874 if (!$(this).prev('div').hasClass('cparts-id297--01') || !$(this).prev('div').hasClass('cparts-id297--02')){ 1875 $(this).find('.cparts--id295-border').css('height','calc(100% - '+h+'px)'); 1876 } 1877 } 1878 if (!$(this).next('div').hasClass('cparts-id297--01') || !$(this).next('div').hasClass('cparts-id297--02')) { 1879 if ($(this).prev('div').hasClass('cparts-id297--01') || $(this).prev('div').hasClass('cparts-id297--02')){ 1880 var hei = h + 40; 1881 $(this).find('.cparts--id295-border').css('height',hei+'px'); 1882 } 1883 } 1884 }); 1885 } 1886 $('div[class*="cparts-id297"]').each(function() { 1887 if ($(this).next('div').hasClass('cparts-id297--01') || $(this).next('div').hasClass('cparts-id297--02')) { 1888 if ($(this).prev('div').hasClass('cparts-id297--01') || $(this).prev('div').hasClass('cparts-id297--02')) { 1889 $(this).find('.cparts--id295-border').css('height', 'calc(100% + 80px)'); 1890 } 1891 }else if ($(this).prev('div').hasClass('cparts-id297--01') || $(this).prev('div').hasClass('cparts-id297--02')) { 1892 } 1893 }); 1894 1895 // ã¡ã¤ã³ç»å_ver.15 1896 if($('.cparts-id326').length){ 1897 if (window.matchMedia( '(min-width: 992px)' ).matches) { 1898 $('.cparts-id326:not([class*="cparts-mainvisual--"])').each(function(){ 1899 var windowH = $(window).height(); 1900 var headH = $(this).offset().top; 1901 var txtH = $(this).find('.cparts-txt-block').outerHeight(); 1902 if(windowH - headH > txtH){ 1903 $(this).children('.cparts-img-block').css('height',windowH - headH); 1904 } 1905 }); 1906 } 1907 } 1908 1909 // ã¡ã¤ã³ç»å_ver.16 1910 if($('.cparts-id327').length){ 1911 $('.cparts-id327').each(function(){ 1912 //ã¿ã¤ãã«. 1913 var imgH = $(this).find('.cparts-img-block').height(); 1914 var footerH = $(this).find('.cparts-foot-block').height(); 1915 $(this).find('.cparts-body-block').css('height',imgH - footerH); 1916 $(this).find('.cparts-img-block').css('marginTop',-(imgH - footerH)); 1917 $(this).find('.cparts-img-block img').css('opacity','1'); 1918 1919 var primaryC = $('.dec-bg--primary').css('background-color'); 1920 1921 if (window.matchMedia( '(max-width: 767px)' ).matches) { 1922 var mobileC = primaryC.replace(')', ', 0.85)').replace('rgb', 'rgba'); 1923 $('.cparts-id327 .dec-bg--primary').each(function(){ 1924 $(this).css({'cssText':'background-color: ' + mobileC + ' !important;'}); 1925 }); 1926 } else { 1927 if(primaryC != 'rgba(0, 0, 0, 0)') 1928 { 1929 var pcC = primaryC.replace('rgb(', 'rgba(').replace(')', ','); 1930 $('.cparts-id327 .dec-bg--primary').each(function(){ 1931 $(this).css({'cssText':'background: linear-gradient(to right, ' + pcC + '0) 0%,' + pcC + '1) 80%,' + pcC + '1) 100%) !important;','display':'block'});
1932 }); 1933 } 1934 } 1935 //èæ¯. 1936 var contentsBGC = $(this).find('.dec-bg--contents').css('background-color'); 1937 var contentsBGC01 = contentsBGC.replace('rgb(', 'rgba(').replace(')', ','); 1938 $(this).find('.dec-bg--contents').append('<span class="cparts-foot-block" style="background: linear-gradient(to bottom, ' + contentsBGC01 + '0) 0%,' + contentsBGC01 + '1) 75%,' + contentsBGC01 + '1) 100%) !important;"> </span>'); 1939 1940 var imgH = $(this).find('.cparts-img-block').height(); 1941 var footerH = $(this).find('.cparts-foot-block').height(); 1942 $(this).find('.cparts-body-block').css('height',imgH - footerH); 1943 $(this).find('.cparts-img-block').css('marginTop',-(imgH - footerH)); 1944 $(this).find('.cparts-img-block img').css('opacity','1'); 1945 1946 //ã¿ã¤ãã«. 1947 var primaryC = $('.dec-bg--primary').css('background-color'); 1948 if (window.matchMedia( '(max-width: 767px)' ).matches) { 1949 var mobileC = primaryC.replace(')', ', 0.85)').replace('rgb', 'rgba'); 1950 $('.cparts-id327 .dec-bg--primary').each(function(){ 1951 $(this).css({'cssText':'background-color: ' + mobileC + ' !important;'}); 1952 }); 1953 } else { 1954 var pcC = primaryC.replace('rgb(', 'rgba(').replace(')', ','); 1955 $('.cparts-id327 .dec-bg--primary').each(function(){ 1956 $(this).css({'cssText':'background: linear-gradient(to right, ' + pcC + '0) 0%,' + pcC + '1) 80%,' + pcC + '1) 100%) !important;','display':'block'}); 1957 }); 1958 } 1959 }); 1960 } 1961 1962 // ã¡ã¤ã³ç»å_ver.17 1963 // if($('.cparts-id328').length){ 1964 // $('#header .cparts-id328,#upper .cparts-id328,.header .cparts-id328,.upper .cparts-id328,.siteblock-header .cparts-id328,.siteblock-upper .cparts-id328').each(function(){ 1965 // var windowW = $(window).width(); 1966 // var windowHW = windowW / 2; 1967 // var contentsW = $(this).width(); 1968 // var contentsHW = contentsW / 2; 1969 // if (window.matchMedia( '(min-width: 768px)' ).matches) { 1970 // $(this).css({'width':windowW,'marginLeft':contentsHW - windowHW,'marginRight':contentsHW - windowHW}); 1971 // } else { 1972 // $(this).css({'marginLeft':contentsHW - windowHW,'marginRight':contentsHW - windowHW}); 1973 // } 1974 1975 // window.addEventListener('resize',function(){ 1976 // //æ ¼ç´ãã¦ãããæ¨ªå¹ ã¨ç¾å¨ã®æ¨ªå¹ ãç°ãªãæã ãçºç«ããã 1977 // if(windowW != $(window).width()){ 1978 // windowW = $(window).width(); 1979 1980 // if (window.matchMedia( '(min-width: 768px)' ).matches) { 1981 // $(this).css({'width':windowW,'marginLeft':contentsHW - windowHW,'marginRight':contentsHW - windowHW}); 1982 // } else { 1983 // $(this).css({'marginLeft':contentsHW - windowHW,'marginRight':contentsHW - windowHW}); 1984 // } 1985 // } 1986 // }); 1987 // }); 1988 // } 1989 1990 if ($('.cparts-id328').length) { 1991 $('#header .cparts-id328, #upper .cparts-id328, .header .cparts-id328, .upper .cparts-id328, .siteblock-header .cparts-id328, .siteblock-upper .cparts-id328').each(function () { 1992 var $this = $(this); 1993 var windowW = $(window).width(); 1994 var windowHW = windowW / 2; 1995 var contentsW = $this.width(); 1996 var contentsHW = contentsW / 2; 1997 1998 function setDesktopStyles() { 1999 $this.css({ 2000 'width': windowW, 2001 'marginLeft': contentsHW - windowHW, 2002 'marginRight': contentsHW - windowHW 2003 }); 2004 } 2005 2006 function setMobileStyles() { 2007 this.style.setProperty('width', '100vw', 'important'); 2008 this.style.setProperty('margin-left', 'calc(50% - 50vw)', 'important'); 2009 this.style.setProperty('margin-right', 'calc(50% - 50vw)', 'important'); 2010 } 2011 2012 // åæè¨å® 2013 if (window.matchMedia('(min-width: 768px)').matches) { 2014 setDesktopStyles(); 2015 } else if (window.matchMedia('(max-width: 767px)').matches) { 2016 setMobileStyles.call(this); 2017 } 2018 2019 // ãªãµã¤ãºæ 2020 $(window).on('resize', function () { 2021 if (windowW != $(window).width()) { 2022 windowW = $(window).width(); 2023 windowHW = windowW / 2; 2024 contentsW = $this.width(); 2025 contentsHW = contentsW / 2; 2026 2027 if (window.matchMedia('(min-width: 768px)').matches) { 2028 setDesktopStyles(); 2029 } else if (window.matchMedia('(max-width: 767px)').matches) { 2030 setMobileStyles.call($this[0]); 2031 } 2032 } 2033 }); 2034 }); 2035 } 2036 2037 2038 2039 2040 // ã¡ã¤ã³ç»å_ver.18 2041 if($('.cparts-id329').length){ 2042 if (window.matchMedia( '(min-width: 768px)' ).matches) { 2043 $('#header .cparts-id329,.header .cparts-id329,.siteblock-header .cparts-id329').each(function(){ 2044 var headH = $(this).offset().top; 2045 $(this).parents('.freeParts').prevAll().css({zIndex:'200',position:'relative'}); 2046 $(this).parents('.freeParts').prevAll('.freeParts').css({backgroundColor:'transparent'}); 2047 $(this).parents('.CMS_BLOCK_NAME_HEADER .freeParts').parents().prevAll().css({zIndex:'200',position:'relative'}); 2048 $(this).parents('.CMS_BLOCK_NAME_HEADER .freeParts').parents().prevAll().find('.freeParts').css({backgroundColor:'transparent'}); 2049 $(this).css({marginTop:-(headH),paddingTop:headH}); 2050 2051 // ãã¬ãã£ããã¼ã¸ã³å¯¾ç(type12) 2052 if ($('.CMS_BLOCK_NAME_HEADER').length) { 2053 var nMB01 = $(this).parents('.CMS_BLOCK_NAME_HEADER .freeParts').parents().prevAll().children().css('marginBottom').replace(/[^-\d\.]/g, ''); 2054 if (nMB01 < 0){
2055 $('#header .cparts-id329').css({marginTop:'+=' + nMB01 +'px'}); 2056 } 2057 } else { 2058 var nMB02 = $(this).parents('.freeParts').prevAll().css('marginBottom').replace(/[^-\d\.]/g, ''); 2059 if (nMB02 < 0){ 2060 $('#header .cparts-id329').css({marginTop:'+=' + nMB01 +'px'}); 2061 } 2062 } 2063 2064 // float対ç(type02) 2065 if ($(this).parents('.freeParts').children('.box').css('clear')=='both'){ 2066 $(this).parents('.freeParts').children('.box').css('clear','none'); 2067 $(this).parents('.freeParts').prepend('<span style="clear: both; display: block; height: 0; overflow: hidden;"></span>'); 2068 } 2069 2070 //type14対ç 2071 if (window.matchMedia( '(max-width: 991px)' ).matches) { 2072 var headRH = $('.top #headerWrapper').innerHeight(); 2073 var upperH = $('.top #headerWrapper #upper').innerHeight(); 2074 $(this).css({height:headRH}); 2075 $(this).parents('#headerWrapper').find('#upper').css({marginTop:-(upperH),position:'relative'}); 2076 } 2077 2078 if (window.matchMedia( '(min-width: 992px)' ).matches) { 2079 var windowH = $(window).height(); 2080 2081 if ($('.top #headerWrapper').length) { 2082 $(this).children('.cparts-img-block').css({height:windowH - headH - upperH}); 2083 } else { 2084 $(this).children('.cparts-img-block').css({height:windowH - headH}); 2085 } 2086 } 2087 }); 2088 } 2089 } 2090 2091 // ããã¼01 2092 $('.cparts-id311--01').each(function() { 2093 var col = $(this).find('.dec-bg--primary').css('background-color'); 2094 $(this).append('<style>.cparts-id311--01 .cparts-img-block:before{background: linear-gradient(to right,rgba(255,255,255,0) 0,'+col+' 80%);}div.cparts-id311--01.cparts-id311-column .cparts-img-block:before{background: linear-gradient(rgba(255,255,255,0) 0, '+col+' 80%);}</style>'); 2095 }); 2096 $('.cparts-id311--02').each(function() { 2097 var col = $(this).find('.dec-bg--primary').css('background-color'); 2098 $(this).append('<style>.cparts-id311--02 .cparts-img-block:before{background: linear-gradient(to left,rgba(255,255,255,0) 0,'+col+' 80%);}div.cparts-id311--02.cparts-id311-column .cparts-img-block:before{background: linear-gradient(to top,rgba(255,255,255,0) 0, '+col+' 80%);}</style>'); 2099 }); 2100 $('.cparts-id311--03').each(function() { 2101 var col = $(this).find('.dec-bg--primary').css('background-color'); 2102 $(this).append('<style>.cparts-id311--03 .cparts-img-block:before{background: linear-gradient(to bottom left,rgba(255,255,255,0) 50%,'+col+' 51%)}.cparts-id311--03 .cparts-img-block:after{background:linear-gradient(to top right,rgba(255,255,255,0) 50%,'+col+' 51%);}div.cparts-id311--03.cparts-id311-column .cparts-img-block:before{background:linear-gradient(to bottom left,'+col+' 51%,rgba(255,255,255,0) 50%);}div.cparts-id311--03.cparts-id311-column .cparts-img-block:after{background:linear-gradient(to bottom left,rgba(255,255,255,0) 50%,'+col+' 51%);}</style>'); 2103 if ($(this).find('.cparts-img-block').outerWidth() < 410) { 2104 $(this).find('.cparts-notes-block').css('right', '-70px'); 2105 } 2106 }); 2107 $('.cparts-id311--04').each(function() { 2108 var col = $(this).find('.dec-bg--primary').css('background-color'); 2109 $(this).append('<style>.cparts-id311--04 .cparts-img-block:before{background: linear-gradient(to bottom right,rgba(255,255,255,0) 50%,'+col+' 51%)}.cparts-id311--04 .cparts-img-block:after{background:linear-gradient(to top left,rgba(255,255,255,0) 50%,'+col+' 51%);}div.cparts-id311--04.cparts-id311-column .cparts-img-block:before{background:linear-gradient(to top left,'+col+' 51%,rgba(255,255,255,0) 50%);}div.cparts-id311--04.cparts-id311-column .cparts-img-block:after{background:linear-gradient(to top left,rgba(255,255,255,0) 50%,'+col+' 51%);}</style>'); 2110 if ($(this).find('.cparts-img-block').outerWidth() < 410) { 2111 $(this).find('.cparts-notes-block').css('left', '-70px'); 2112 } 2113 });
2114 2115 // ããã¼04 2116 $('.cparts-id318--01').each(function() { 2117 var col = $(this).find('.dec-bg--dark').css('background-color'); 2118 var c = String(col).slice(0,-1); 2119 var color = String(c).slice(3); 2120 $(this).find('.cparts-body-block').css({'cssText': 'background-color: rgba'+color+',.75) !important'}); 2121 2122 var maxHeight = 0; 2123 $(this).find('.cparts-body-block').each(function() { 2124 var bodyHeight = $(this).outerHeight(); 2125 // ã¹ãã以å¤ã®å ´åã¯æå¤§ã®é«ããåå¾ 2126 if ($(window).width() > 768) { 2127 if (bodyHeight > maxHeight) maxHeight = bodyHeight; 2128 } else { 2129 // ã¹ããã®å ´åã¯ããããã®é«ããè¨å® 2130 $(this).siblings('.cparts-img-block').css('height', bodyHeight + 60 + 'px'); 2131 } 2132 }); 2133 2134 // ã¹ãã以å¤ã®å ´åãæå¤§ã®é«ããç»åãããã¯ã«è¨å® 2135 if ($(window).width() > 768) { 2136 $(this).find('.cparts-body-block').css('height', maxHeight + 'px'); 2137 $(this).find('.cparts-img-block').css('height', maxHeight + 60 + 'px'); 2138 } 2139 }); 2140 setTimeout(function(){ 2141 $('.cparts-id318--02').each(function() { 2142 if ($(this).find('h3').css('color') == 'rgb(255, 255, 255)') { 2143 $(this).find('h3').addClass('dec-txt--primary'); 2144 } 2145 var height = $(this).find('.cparts-head-block').outerHeight() + 60; 2146 if(height > 200){ 2147 $(this).find('.cparts-img-block').find('img').css('height', height+'px'); 2148 $(this).find('.cparts-img-block').css('height', height+'px'); 2149 } 2150 }); 2151 },500); 2152 2153 /* ------------------------------------------------------- 2154 2023年追å 2155 -------------------------------------------------------- */ 2156 // id467ã®çä¼¼è¦ç´ ï¼::beforeï¼ã®èæ¯è²å¤æ´ 2157 $('.cparts-animation--bgUDextend').each(function() { 2158 var col = $(this).siblings('.dec-bg--primary').css('background-color'); 2159 $(this).append('<style>.cparts-animation--bgUDextend::before {background-color: '+col+'}</style>'); 2160 }); 2161 2162 // ã¡ã¤ã³ç»å_ver.22 2163 $('.cparts-id533.cparts-mainvisual--sm,body:not(.column1) #contents #upper .cparts-id533,.column2 #contents #upper .cparts-id533,.column2 .row .upper .cparts-id533,#main .cparts-id533 ,#bottom .cparts-id533 ,#side .cparts-id533 ,#right .cparts-id533 ,#opt1 .cparts-id533 ,#opt2 .cparts-id533 ,#opt3 .cparts-id533 ,#footer .cparts-id533 ,.main .cparts-id533 ,.bottom .cparts-id533 ,.side .cparts-id533 ,.right .cparts-id533 ,.opt1 .cparts-id533 ,.opt2 .cparts-id533 ,.opt3 .cparts-id533 ,.footer .cparts-id533 ,.siteblock-main .cparts-id533 ,.siteblock-bottom .cparts-id533 ,.siteblock-side .cparts-id533 ,.siteblock-right .cparts-id533 ,.siteblock-opt1 .cparts-id533 ,.siteblock-opt2 .cparts-id533 ,.siteblock-opt3 .cparts-id533 ,.siteblock-footer .cparts-id533').each(function() { 2164 $(this).find('.cparts-caption-block').remove(); 2165 }); 2166 2167 2168 2169 // æ°ã»ç»åï¼ã¹ã¯ãã¼ã«ããã¹ã 2170 $('.cparts-id88').each(function() { 2171 const $container = $(this); 2172 const $img = $container.find('.cparts-img-block img'); 2173 2174 // ç»åãèªã¿è¾¼ã¾ãã¦ãããç¢ºèª 2175 if ($img[0].complete) { 2176 const h = $img.height(); 2177 $container.find('.cparts-txt-block').css('height', h); 2178 } else { 2179 $img.on('load', function () { 2180 const h = $img.height(); 2181 $container.find('.cparts-txt-block').css('height', h); 2182 }); 2183 } 2184 }); 2185 2186 /* ------------------------------------------------------- 2187 2024年追å 2188 -------------------------------------------------------- */ 2189 // ã¡ã¤ã³ç»å_ver.27 2190 if ($('.cparts-id570').length && $(window).width() >= 768) { // ã¿ãã¬ãã以ä¸ã®ãµã¤ãºã§ãã§ã㯠2191 $('.cparts-id570').each(function() { 2192 var id570_imgBlockHeight = $(this).find('.cparts-img-block:nth-child(1)').outerHeight(); // .cparts-img-block:nth-child(1)ã®é«ãï¼marginãå«ãï¼ 2193 var id570_headBlockHeight = $(this).find('.cparts-head-block').outerHeight(); // .cparts-head-blockã®é«ãï¼marginãå«ãï¼ 2194 var id570_bodyBlockHeight = $(this).find('.cparts-body-block').outerHeight(); 2195 2196 // .cparts-head-blockã®é«ãã.imgBlockããã大ããå ´åã親è¦ç´ ã®é«ããè¨å® 2197 if (id570_bodyBlockHeight > id570_imgBlockHeight + id570_headBlockHeight + 40) { 2198 $(this).css('height', id570_bodyBlockHeight + 'px'); 2199 } else { 2200 $(this).css('height', ''); 2201 } 2202 }); 2203 } 2204 2205 // ã¡ã¤ã³ç»å_ver.28 2206 if ($('.cparts-id575').length) { 2207 $('.cparts-id575').each(function() { 2208 var txtBlock = $(this).find('.cparts-txt-block'); 2209 var txtBlockHeight = txtBlock.outerHeight(); 2210 var imgBlock = $(this).find('.cparts-img-block'); 2211 var imgBlockHeight = imgBlock.outerHeight(); 2212 2213 // '.cparts-img-block' è¦ç´ ã '.cparts-txt-block' ãããå°ããå ´å 2214 if (imgBlockHeight < txtBlockHeight + 180) { 2215 imgBlock.css('height', (txtBlockHeight + 180) + 'px'); // height ãè¨å® 2216 } 2217 }); 2218 } 2219 2220 /* ------------------------------------------------------- 2221 2025年追å 2222 -------------------------------------------------------- */ 2223 // ãã¼ãã£ã³ã°ã¢ãã¡ã¼ã·ã§ã³ 2224 if ($('.cparts-id592').length) { 2225 const targetSelectors = [ 2226 '#header', '#upper', '#main', '#bottom', '#side', '#right', '#opt1', '#opt2', '#opt3', '#footer', 2227 '.header', '.upper', '.main', '.bottom', '.side', '.right', '.opt1', '.opt2', '.opt3', '.footer', 2228 '.siteblock-header', '.siteblock-upper', '.siteblock-main', '.siteblock-bottom', '.siteblock-side', '.siteblock-right', 2229 '.siteblock-opt1', '.siteblock-opt2', '.siteblock-opt3', '.siteblock-footer' 2230 ]; 2231 2232 // ã¹ã¯ãã¼ã«å¶å¾¡é¢æ° 2233 function disableScroll() { 2234 $('html, body').css({ 2235 overflow: 'hidden', 2236 height: '100%', 2237 'touch-action': 'none',
2238 '-webkit-overflow-scrolling': 'auto' 2239 }); 2240 } 2241 2242 function enableScroll() { 2243 $('html, body').css({ 2244 overflow: '', 2245 height: '', 2246 'touch-action': '', 2247 '-webkit-overflow-scrolling': '' 2248 }); 2249 setTimeout(() => { 2250 window.scrollTo(window.scrollX, window.scrollY); // iOS対ç 2251 }, 50); 2252 } 2253 2254 let $loadingParts = null; 2255 let $parentBlock = null; 2256 2257 targetSelectors.some(selector => { 2258 const $rows = $(selector).find('.cparts-body-block').filter(function () { 2259 return $(this).closest('.cparts-id592').length > 0; 2260 }); 2261 2262 if ($rows.length) { 2263 $loadingParts = $rows.first(); 2264 $parentBlock = $loadingParts.closest(targetSelectors.join(',')); 2265 return true; 2266 } 2267 return false; 2268 }); 2269 2270 if ($loadingParts) { 2271 const $parent = $loadingParts.closest('.cparts-id592'); 2272 2273 if ($parent.hasClass('cparts-loading--fadein')) { 2274 handleFadeAnimation($loadingParts, $parentBlock); 2275 } else if ($parent.hasClass('cparts-loading--slideup')) { 2276 handleSlideUpAnimation($parent, $parentBlock); 2277 } else if ($parent.hasClass('cparts-loading--reveal')) { 2278 handleRevealAnimation($parent, $parentBlock); 2279 } else { 2280 handleFadeAnimation($loadingParts, $parentBlock); 2281 } 2282 } 2283 2284 // ========================= 2285 // åãã¼ãã£ã³ã°å¦ç 2286 // ========================= 2287 2288 function handleFadeAnimation($loadingParts, $zTarget, callback) { 2289 const $blocks = $loadingParts.find('.cparts-txt-block'); 2290 const $parent = $loadingParts.closest('.cparts-id592'); 2291 2292 if ($('#cms_contents_area').length) { 2293 $blocks.css({ display: 'block', opacity: 1 }); 2294 if (typeof callback === 'function') callback(); 2295 return; 2296 } 2297 2298 disableScroll(); 2299 2300 // åºå®ã¬ã¤ã¢ã¦ãå 2301 $parent.css({ 2302 position: 'fixed', 2303 top: 0, 2304 left: 0, 2305 width: '100%', 2306 height: '100%', 2307 zIndex: 9999 2308 }); 2309 2310 // å¼·å¶çã«è¡¨ç¤ºï¼opacityã¢ãã¡ã¼ã·ã§ã³ 2311 $blocks.css({ display: 'block', opacity: 0 }).animate({ opacity: 1 }, 1500, function () { 2312 setTimeout(() => { 2313 $parent.fadeOut(1500, function () { 2314 $parent.remove(); // display:none ã§ã¯ãªã remove() 2315 if ($zTarget) $zTarget.css({ 2316 'z-index': '', 2317 'position': '' 2318 }); 2319 enableScroll(); 2320 if (typeof callback === 'function') callback(); 2321 }); 2322 }, 1000); 2323 }); 2324 } 2325 2326 2327 function handleSlideUpAnimation($parent, $zTarget, callback) { 2328 if ($('#cms_contents_area').length) { 2329 $parent.show(); 2330 if (typeof callback === 'function') callback(); 2331 return; 2332 } 2333 2334 disableScroll(); 2335 2336 const $content = $parent.find('.cparts-body-block > div'); 2337 2338 $content.css({ display: 'block' }).animate({ opacity: 1 }, 1000, function () { 2339 setTimeout(() => { 2340 $parent.css({ 2341 transition: 'transform 1.1s ease-in-out', 2342 transform: 'translateY(-100%)' 2343 }); 2344 2345 setTimeout(() => { 2346 $parent.remove(); 2347 if ($zTarget) $zTarget.css({ 2348 'z-index': '', 2349 'position': '' 2350 }); 2351 enableScroll(); 2352 if (typeof callback === 'function') callback(); 2353 }, 1000); 2354 }, 1000); 2355 }); 2356 } 2357 2358 function handleRevealAnimation($parent, $zTarget, callback) { 2359 if ($('#cms_contents_area').length) { 2360 if (typeof callback === 'function') callback(); 2361 return; 2362 } 2363 2364 disableScroll(); 2365 2366 const $content = $parent.find('.cparts-body-block > div'); 2367 2368 $parent.css({ 2369 'clip-path': 'circle(150% at 50% 50%)',
2370 '-webkit-clip-path': 'circle(150% at 50% 50%)', 2371 'transition': 'clip-path 1.5s ease-in-out, -webkit-clip-path 1.5s ease-in-out', 2372 'overflow': 'hidden', 2373 'z-index': 9999, 2374 'position': 'fixed', 2375 'top': 0, 2376 'left': 0, 2377 'width': '100%', 2378 'height': '100%' 2379 }); 2380 2381 void $parent[0].offsetWidth; 2382 2383 $content.css({ display: 'block' }).animate({ opacity: 1 }, 1000, function () { 2384 setTimeout(() => { 2385 $parent.css({ 2386 'clip-path': 'circle(0% at 50% 50%)', 2387 '-webkit-clip-path': 'circle(0% at 50% 50%)' 2388 }); 2389 }, 100); 2390 2391 setTimeout(() => { 2392 $parent.remove(); 2393 if ($zTarget) $zTarget.css({ 2394 'z-index': '', 2395 'position': '' 2396 }); 2397 enableScroll(); 2398 if (typeof callback === 'function') callback(); 2399 }, 1700); 2400 }); 2401 } 2402 2403 // ========================= 2404 // åæ z-index ã»ãã 2405 // ========================= 2406 $(document).ready(function () { 2407 if (!$('#cms_contents_area').length) { 2408 $(targetSelectors.join(',')).has('.cparts-id592').css({ 2409 position: 'relative', 2410 zIndex: 999 2411 }); 2412 } 2413 }); 2414 2415 // ========================= 2416 // ä¿éºï¼window load æã«ãå®è¡ 2417 // ========================= 2418 $(window).on('load', function () { 2419 const $slideup = $('.cparts-id592.cparts-loading--slideup'); 2420 if ($slideup.length) { 2421 handleSlideUpAnimation($slideup, $slideup.closest(targetSelectors.join(','))); 2422 } 2423 2424 const $reveal = $('.cparts-id592.cparts-loading--reveal'); 2425 if ($reveal.length) { 2426 handleRevealAnimation($reveal, $reveal.closest(targetSelectors.join(','))); 2427 } 2428 }); 2429 } 2430 }); 2431 2432 // ããã¹ãï¼æµããç»å_ver.1 2433 $(window).on('load', function () { 2434 const $targets = $('.cparts-id599--01, .cparts-id599--02'); 2435 2436 if (!$targets.length) return; 2437 2438 $targets.each(function () { 2439 const $target = $(this); 2440 2441 // èªèº«ã¾ãã¯å é¨ã«å¯¾è±¡ã¯ã©ã¹ãåå¨ãããå¤å® 2442 const hasAnimationClass = 2443 $target.is('.cparts-animate--slideUpDown, .cparts-animate--slideDownUp, .cparts-animate--slideBothDown') || 2444 $target.find('.cparts-animate--slideUpDown, .cparts-animate--slideDownUp, .cparts-animate--slideBothDown').length > 0; 2445 2446 if (!hasAnimationClass && $('#cms_contents_area').length) { 2447 $target.find('.cparts-img-block').css('position', 'static'); 2448 $target.find('.cparts-body-block .cparts-body-block').css('display', 'flex'); 2449 return; 2450 } 2451 2452 // é常å¦ç 2453 const blocks = $target.find('.cparts-img-block'); 2454 let globalIndex = 0; // â ã°ãã¼ãã«ãªã¤ã³ããã¯ã¹ã§å¤å® 2455 2456 blocks.each(function () { 2457 const $block = $(this); 2458 const $images = $block.find('img'); 2459 const wrapper = $('<div class="scroll-wrapper"></div>'); 2460 2461 // ç»åã2åã«ã¼ããã¦è¿½å 2462 $images.each(function () { 2463 wrapper.append($(this).clone()); 2464 }); 2465 $images.each(function () { 2466 wrapper.append($(this).clone()); 2467 }); 2468 2469 $block.empty().append(wrapper); 2470 2471 // æåã®ãããã¯ã ãã¹ã¯ãã¼ã«æ¹åãå¤ãã 2472 const direction = globalIndex === 0 ? 'scroll-up' : 'scroll-down'; 2473 wrapper.addClass(direction); 2474 2475 globalIndex++; 2476 }); 2477 }); 2478 }); 2479 2480 2481 2482 2483 2484// æµããã©ã¤ã³ç³»ç»åãããã¹ã 2485$('.cparts-id594.cparts-decoslider-block02.cparts-current--rightleft').each(function(){ 2486 var loopslider = $(this).find('ul').clone(true); 2487 var loopsliderW = $(this).find('ul').width(); 2488 var loopsliderH = $(this).find('ul').height(); 2489 var self = $(this); 2490 2491 $(this).find('.cparts-copy-block') 2492 .append(loopslider) 2493 .css({ display: 'flex', height: loopsliderH + 'px' }); 2494 2495 $(this).find('ul').wrapAll('<div class="cparts-loopslider--wrap02"></div>'); 2496 $(this).find('.cparts-loopslider--wrap02').css({ width: (loopsliderW * 2) + 'px' }); 2497 2498 if ($(this).hasClass('cparts-current--rightleft')) { 2499 const self = $(this); 2500 const isSp = window.matchMedia('(max-width: 767px)').matches; 2501 const duration = isSp ? 25000 : 45000; 2502 2503 function loopMove() { 2504 self.find('.cparts-loopslider--wrap02').animate(
2505 { left: '-' + loopsliderW + 'px' }, 2506 duration, 2507 'linear', 2508 function () { 2509 self.find('.cparts-loopslider--wrap02').css({ left: '0' }); 2510 loopMove(); 2511 } 2512 ); 2513 } 2514 2515 loopMove(); 2516 } 2517}); 2518 2519if ($('.cparts-id594').length) { 2520 $('.cparts-id594 .cparts-img-block > div a').on('click', function (e) { 2521 e.preventDefault(); 2522 2523 // ã¯ãªãã¯ãããaè¦ç´ ããæãè¿ã親ã®.cparts-id594ãåå¾ 2524 var $parent = $(this).closest('.cparts-id594'); 2525 2526 // 親è¦ç´ ã®ä¸ç«¯ã¾ã§ã®ä½ç½®ãåå¾ 2527 var targetOffset = $parent.offset().top + $parent.outerHeight(); 2528 2529 $('html, body').animate({ 2530 scrollTop: targetOffset 2531 }, 800); 2532 }); 2533} 2534if ($('.cparts-decoslider-block02').length) { 2535 var timer = false; 2536 var prewidth = $(window).width(); 2537 $(window).resize(function() { 2538 if (timer !== false) { 2539 clearTimeout(timer); 2540 } 2541 timer = setTimeout(function() { 2542 var nowWidth = $(window).width(); 2543 if(prewidth !== nowWidth){ 2544 // ãªãã¼ã 2545 location.reload(); 2546 } 2547 prewidth = nowWidth; 2548 }, 10); 2549 }); 2550} 2551 2552// ä¸è¦§ãã¼ã_ver.12 2553if ($('.cparts-id291--03').length) { 2554 $(function () { 2555 if ($('#cms_contents_area').length === 0) { 2556 $('.cparts-id291--03').each(function () { 2557 const $container = $(this); 2558 const $icon = $container.find('.cparts-footer-block .cparts-icon-block'); 2559 const $txtBlock = $container.find('.cparts-body-block > .cparts-txt-block').first(); 2560 2561 // æ¢ã«ç§»åæ¸ã¿ã§ãªããã¨ãç¢ºèª 2562 if ($icon.length && $txtBlock.length && !$txtBlock.find('.cparts-icon-block').length) { 2563 $icon.appendTo($txtBlock); 2564 } 2565 }); 2566 } 2567 }); 2568} 2569 2570// ç»å横ã¹ã©ã¤ãï¼ç»å3æï¼ 2571// ç»å横ã¹ã©ã¤ãï¼ç»å4æï¼ 2572// ç»å横ã¹ã©ã¤ãï¼ç»å5æï¼ 2573$(function () { 2574 const isEditor = $('#cms_contents_area').length > 0; 2575 const $blocks = $('.cparts-id605--01, .cparts-id605--02, .cparts-id605--03'); 2576 2577 // 対象ã¯ã©ã¹ãåå¨ããå ´åã®ã¿å¦çãå®è¡ 2578 if ($blocks.length) { 2579 $(window).on('load', function () { 2580 $blocks.each(function () { 2581 const $section = $(this); 2582 const $imgBlock = $section.find('.cparts-img-block'); 2583 const $imgs = $imgBlock.find('img'); 2584 const imgCount = $imgs.length; 2585 2586 if (isEditor) { 2587 $imgBlock 2588 .addClass('editor-mode') 2589 .css({ display: 'flex', transform: 'none', width: '100%' }); 2590 2591 if (imgCount === 3) $imgBlock.addClass('imgcount--3'); 2592 if (imgCount === 4) $imgBlock.addClass('imgcount--4'); 2593 return; 2594 } 2595 2596 // ã¯ãã¼ã³å¦ç 2597 const clones = []; 2598 if (imgCount === 3) { 2599 for (let i = 0; i < 12; i++) { 2600 clones.push($imgs.eq(i % imgCount).clone()[0]); 2601 } 2602 } else if (imgCount === 4) { 2603 for (let i = 0; i < 16; i++) { 2604 clones.push($imgs.eq(i % imgCount).clone()[0]); 2605 } 2606 } else if (imgCount === 5) { 2607 let totalWidth = $imgBlock[0].scrollWidth; 2608 let cloneIndex = 0; 2609 while (totalWidth < $imgBlock.outerWidth() * 3 && cloneIndex < 30) { 2610 const clone = $imgs.eq(cloneIndex % imgCount).clone(); 2611 $imgBlock.append(clone); 2612 totalWidth = $imgBlock[0].scrollWidth; 2613 cloneIndex++; 2614 } 2615 } 2616 2617 if (clones.length) { 2618 $imgBlock.append(clones); 2619 } 2620 2621 // ã¹ã©ã¤ãã¢ãã¡ã¼ã·ã§ã³ï¼ãããã¯ãã¨ï¼ 2622 if (!isEditor) { 2623 const slideState = { 2624 currentX: null, 2625 lastDirection: null 2626 }; 2627 2628 function animateBlock() { 2629 const rect = $section[0].getBoundingClientRect(); 2630 const windowHeight = window.innerHeight; 2631 2632 if (rect.top < windowHeight && rect.bottom > 0) { 2633 const scrollRatio = (windowHeight - rect.top) / (windowHeight + rect.height); 2634 2635 // ã¹ã©ã¤ãæ¹åãå¤å® 2636 let direction; 2637 if ($section.hasClass('cparts-slide--rightLeft')) { 2638 direction = 'rightLeft'; 2639 } else { 2640 // leftRight or ã¯ã©ã¹ãªã 2641 direction = 'leftRight'; 2642 } 2643 2644 const maxSlide = 140; 2645 const signedRatio = direction === 'rightLeft' 2646 ? scrollRatio * -maxSlide // å³ â å·¦ = è² ã®æ¹å 2647 : scrollRatio * maxSlide; // å·¦ â å³ = æ£ã®æ¹å 2648 2649 // æ¹åãåãæ¿ãã£ããåæå 2650 if (slideState.lastDirection !== direction || slideState.currentX === null) { 2651 slideState.currentX = signedRatio; 2652 slideState.lastDirection = direction; 2653 } else { 2654 slideState.currentX += (signedRatio - slideState.currentX) * 0.2; 2655 } 2656 2657 $imgBlock.css('transform', `translateX(${slideState.currentX}%)`); 2658 } 2659 2660 requestAnimationFrame(animateBlock); 2661 } 2662 2663 requestAnimationFrame(animateBlock); 2664 } 2665 }); 2666 });
2667 } 2668}); 2669 2670 2671/* ãã©ã©ãã¯ã¹ãã¼ãï¼ç»åï¼è¦åºãã»ããã¹ãï¼/ ãã©ã©ãã¯ã¹ãã¼ãï¼è¦åºãã»ããã¹ãï¼ç»åï¼*/ 2672jQuery(function($){ 2673 var $win = $(window); 2674 2675 function updateParallax(){ 2676 var scrollTop = $win.scrollTop(); 2677 var winHeight = $win.height(); 2678 2679 // ===== ã¹ãã¼ãã»ã¹ã¿ã¼ãä½ç½®ãç»é¢å¹ ã§èª¿æ´ ===== 2680 var baseBgSpeed, baseImgSpeed, baseStartY, baseStopY; 2681 var isMobile = window.matchMedia("(max-width: 991px)").matches; 2682 2683 if (isMobile) { 2684 // ã¹ããç¨ 2685 baseBgSpeed = 0.1; 2686 baseImgSpeed = 0.25; 2687 baseStartY = 100; 2688 baseStopY = 0; 2689 } else { 2690 // PC/ã¿ãã¬ããç¨ 2691 baseBgSpeed = 0.15; 2692 baseImgSpeed = 0.5; 2693 baseStartY = 200; 2694 baseStopY = 0; 2695 } 2696 2697 // ===== 対象ããã㯠===== 2698 $('.cparts-id612--01, .cparts-id612--02').each(function(){ 2699 2700 var $container = $(this); 2701 var containerTop = $container.offset().top; 2702 var containerH = $container.outerHeight(); 2703 var $img = $container.find('.cparts-img-block img'); 2704 2705 // --- åæå¤ï¼ãã¼ã¹å¤ããè¤è£½ï¼ --- 2706 var bgSpeed = baseBgSpeed; 2707 var imgSpeed = baseImgSpeed; 2708 var startY = baseStartY; 2709 var stopY = baseStopY; 2710 2711 // --- slow / fast ã®èª¿æ´ï¼ã¹ããï¼ --- 2712 if (isMobile) { 2713 if ($container.hasClass('cparts-slow')) { 2714 bgSpeed = baseBgSpeed - 0.05; 2715 imgSpeed = baseImgSpeed - 0.05; 2716 startY = 100; 2717 } else if ($container.hasClass('cparts-fast')) { 2718 bgSpeed = baseBgSpeed; 2719 imgSpeed = baseImgSpeed + 3; 2720 startY = 200; 2721 } 2722 } 2723 2724 // --- slow / fastï¼PCï¼ --- 2725 if (!isMobile) { 2726 if ($container.hasClass('cparts-slow')) { 2727 bgSpeed = baseBgSpeed - 0.05; 2728 imgSpeed = baseImgSpeed - 0.15; 2729 startY = 200; 2730 } else if ($container.hasClass('cparts-fast')) { 2731 bgSpeed = baseBgSpeed + 0.2; 2732 imgSpeed = baseImgSpeed + 2; 2733 startY = 200; 2734 stopY = 0; 2735 } 2736 } 2737 2738 /* ============================================================ 2739 â ç»é¢å å¤ã«é¢ä¿ãªããäºåã« startY 㨠stopY ã䏿¸ããã 2740 ============================================================ */ 2741 var forceStartStop = 2742 $img.closest('#type2column02 #wrapper #opt').length || 2743 $img.closest('#type2column02 #side').length || 2744 $img.closest('#bootstrap_template #side').length || 2745 $img.closest('#type2column02 #wrapper #contents #opt2').length || 2746 $img.closest('.pagetemp-column2 .container .row .siteblock-side').length || 2747 $img.closest('.pagetemp-column2 .lay-container-xl .lay-row .siteblock-side').length; 2748 2749 if (forceStartStop) { 2750 startY = 40; // åæä½ç½® 2751 stopY = 0; // åºå®ä½ç½® 2752 } 2753 2754 /* ============================================================ 2755 ãã©ã©ãã¯ã¹å¦çï¼èæ¯ + ç»åï¼ 2756 ============================================================ */ 2757 2758 if (scrollTop + winHeight > containerTop && scrollTop < containerTop + containerH) { 2759 2760 /* ===== èæ¯ç»å ===== */ 2761 var diff = (scrollTop + winHeight) - containerTop; 2762 var bgY = -(diff * bgSpeed); 2763 $container.css('background-position', 'center ' + bgY + 'px'); 2764 2765 /* ===== ç»å ===== */ 2766 var diffImg = (scrollTop + winHeight) - containerTop; 2767 var moveY = startY - (diffImg * imgSpeed); 2768 2769 if (moveY <= stopY) moveY = stopY; 2770 2771 $img.css('transform','translateY(' + moveY + 'px)'); 2772 2773 } else if (scrollTop + winHeight <= containerTop) { 2774 // ===== ç»é¢å¤ã®å ´åï¼åæä½ç½®ã¸æ»ãï¼ ===== 2775 $container.css('background-position', 'center 0'); 2776 $img.css('transform','translateY(' + startY + 'px)'); 2777 } 2778 2779 }); 2780 } 2781 2782 $win.on('scroll resize', updateParallax); 2783 updateParallax();
2784 2785}); 2786 2787 2788 2789 window.addEventListener('resize', function(){ 2790 2791 // ããã¼01 2792 $('div[class*="cparts-id311"]').each(function() { 2793 if ($(this).outerWidth() <= 480) { 2794 $(this).addClass('cparts-id311-column'); 2795 }else{ 2796 $(this).removeClass('cparts-id311-column'); 2797 } 2798 var height = $(this).find('.cparts-txt-block').outerHeight() + 60; 2799 $(this).find('.cparts-img-block').find('img').css('height', height+'px'); 2800 $(this).find('.cparts-img-block').css('height', height+'px'); 2801 }); 2802 2803 // ããã¼02 2804 $('div[class*="cparts-id315"]').each(function() { 2805 if ($(this).find('.cparts-img-block').outerWidth() < 300) { 2806 $(this).addClass('cparts-id315-column'); 2807 }else { 2808 $(this).removeClass('cparts-id315-column'); 2809 } 2810 var height = $(this).find('.cparts-body-block').outerHeight() +30; 2811 $(this).find('.cparts-img-block').find('img').css('height', height+'px'); 2812 $(this).find('.cparts-img-block').css('height', height+'px'); 2813 if ($(this).find('h4').css('color') == $(this).find('.dec-bg--primary').css('background-color')) { 2814 $(this).find('h4').css('color','#fff'); 2815 } 2816 }); 2817 2818 // ããã¼03 2819 $('div[class*="cparts-id317"]').each(function() { 2820 if ($(this).outerWidth() <= 480) { 2821 $(this).addClass('cparts-id317-column'); 2822 }else { 2823 $(this).removeClass('cparts-id317-column'); 2824 } 2825 var height = $(this).find('.cparts-txt-block').children('div').outerHeight() + 60; 2826 $(this).find('.cparts-img-block').find('img').css('height', height+'px'); 2827 $(this).find('.cparts-img-block').css('height', height+'px'); 2828 }); 2829 2830 // ããã¼04 2831 $('div[class*="cparts-id318"]').each(function() { 2832 if ($(this).children('div').outerWidth() < 250) { 2833 $(this).addClass('cparts-id318-column'); 2834 }else { 2835 $(this).removeClass('cparts-id318-column'); 2836 } 2837 }); 2838 setTimeout(function(){ 2839 $('.cparts-id318--01').each(function() { 2840 var height = $(this).find('.cparts-body-block').outerHeight() + 60; 2841 $(this).find('.cparts-img-block').find('img').css('height', height+'px'); 2842 $(this).find('.cparts-img-block').css('height', height+'px'); 2843 }); 2844 $('.cparts-id318--02').each(function() { 2845 if ($(this).find('h3').css('color') == 'rgb(255, 255, 255)') { 2846 $(this).find('h3').addClass('dec-txt--primary'); 2847 } 2848 var height = $(this).find('.cparts-head-block').outerHeight() + 60; 2849 $(this).find('.cparts-img-block').find('img').css('height', height+'px'); 2850 $(this).find('.cparts-img-block').css('height', height+'px'); 2851 }); 2852 },500); 2853 2854 }); 2855 2856 $(window).scroll(function () { 2857 2858 /* ------------------------------------------------------- 2859 2021年追å 2860 -------------------------------------------------------- */ 2861 // ãããã¼ã¯ã³ã°ãªããã¬ã¤ã¢ã¦ããã¢ãã¡ã¼ã·ã§ã³ç¨class追å 2862 $('.cparts-id286--01 .cparts-js-block,.cparts-id286--02 .cparts-js-block').each(function(){ 2863 var imgPos = $(this).offset().top; 2864 var scroll = $(window).scrollTop(); 2865 var windowHeight = $(window).height(); 2866 if (scroll > imgPos - windowHeight + windowHeight/5){ 2867 $(this).addClass('cparts-fadeIn--id286'); 2868 } 2869 }); 2870 2871 }); 2872 2873 $(document).ready(function() { 2874 2875 /* ------------------------------------------------------- 2876 2024年追å 2877 -------------------------------------------------------- */ 2878 // ããã¼ãã£ã³ã°ããã¼ 2879 function setParentWidth() { 2880 // ã¦ã£ã³ãã¦å¹ ã768px以ä¸ã®å ´åã®ã¿å¦çãå®è¡ 2881 if ($(window).width() >= 768) { 2882 const childWidth = $('.cparts-link-block').width(); 2883 $('.cparts-id582').width(childWidth); // åè¦ç´ ã®å¹ ã«åããã 2884 } else { 2885 // 768pxæªæºã®å ´åã親è¦ç´ ã®å¹ ããªã»ãããããå ´åã¯ä»¥ä¸ãä½¿ç¨ 2886 $('.cparts-id582').css('width', ''); // å¹ ãªã»ãã 2887 } 2888 } 2889 2890 // ååè¨å® 2891 setParentWidth(); 2892 2893 // ã¦ã£ã³ãã¦ãªãµã¤ãºæã«ãå¹ ãåè¨å® 2894 $(window).resize(setParentWidth);
2895 }); 2896 2897});})(jQuery); 2898 2899// jQuery 3.7.1 ã§ã $(window).on('load', fn) ãâ確å®ã«âåããæå°ã·ã 2900(function ($) { 2901 if (!$.fn || !$.fn.on) return; 2902 var _on = $.fn.on; 2903 2904 $.fn.on = function (types, selector, data, handler) { 2905 try { 2906 // $(window).on('load', fn) ãã¿ã¼ã³ãææ 2907 if (this.length === 1 && this[0] === window && typeof types === 'string' && types.indexOf('load') !== -1) { 2908 // 渡ããã弿°ãããã³ãã©ãç¹å® 2909 var fn = (typeof selector === 'function') ? selector 2910 : (typeof data === 'function') ? data 2911 : (typeof handler === 'function') ? handler 2912 : null; 2913 2914 // ãã§ã« load æ¸ã¿ãªãå³å®è¡ï¼ï¼åãéãææ¸ï¼ 2915 if (fn && document.readyState === 'complete') { 2916 try { fn.call(window); } catch (e) {} 2917 // æ¢åã® .on èªä½ã¯é常ã©ããå¼ãã§ããï¼å°æ¥ã® pageshow çã«åããï¼ 2918 } 2919 } 2920 } catch (e) {} 2921 return _on.apply(this, arguments); 2922 }; 2923})(jQuery); 2924 2925 2926/* ------------------------------------------------------- 2927 2026年追å 2928-------------------------------------------------------- */ 2929(function () { 2930 function initCurtain() { 2931 var rows = document.querySelectorAll('.cparts-id615 .lay-row'); 2932 2933 if (!('IntersectionObserver' in window)) { 2934 rows.forEach(function (row) { 2935 row.classList.add('cparts-curtain--open'); 2936 }); 2937 return; 2938 } 2939 2940 var observer = new IntersectionObserver(function (entries, obs) { 2941 entries.forEach(function (entry) { 2942 if (entry.isIntersecting) { 2943 2944 setTimeout(function () { 2945 entry.target.classList.add('cparts-curtain--open'); 2946 obs.unobserve(entry.target); 2947 }, 300); 2948 2949 } 2950 }); 2951 }, { threshold: 0.3 }); 2952 2953 rows.forEach(function (row) { 2954 observer.observe(row); 2955 }); 2956 } 2957 2958 if (document.readyState === 'loading') { 2959 document.addEventListener('DOMContentLoaded', initCurtain); 2960 } else { 2961 initCurtain(); 2962 } 2963})(); 2964 2965document.addEventListener('DOMContentLoaded', function () { 2966 2967 document.querySelectorAll('.cparts-id616').forEach(function (parts) { 2968 var ttl = parts.querySelector('.cparts-id616__ttl'); 2969 if (!ttl) return; 2970 2971 // ãã£ããå ¨ã¦å¤ãï¼åå®è¡ã»data-reload 対çï¼ 2972 ttl.classList.remove( 2973 'dec-line--primary', 'dec-txt--primary', 2974 'dec-line--secondary', 'dec-txt--secondary', 2975 'dec-line--dark', 'dec-txt--dark' 2976 ); 2977 2978 if (parts.classList.contains('cparts-hColor--mainColor')) { 2979 ttl.classList.add('dec-line--primary', 'dec-txt--primary'); 2980 2981 } else if (parts.classList.contains('cparts-hColor--subColor')) { 2982 ttl.classList.add('dec-line--secondary', 'dec-txt--secondary'); 2983 2984 } else if (parts.classList.contains('cparts-hColor--accentColor')) { 2985 ttl.classList.add('dec-line--dark', 'dec-txt--dark'); 2986 2987 } else { 2988 // â ä½ãæå®ããªãå ´åã®ããã©ã«ã 2989 ttl.classList.add('dec-line--primary', 'dec-txt--primary'); 2990 } 2991 }); 2992 2993}); 2994 2995document.addEventListener('DOMContentLoaded', function () { 2996 // 1. 対象è¦ç´ ã®åå¾ï¼ã¢ã³ãã¼ã©ã¤ã³ã¢ãã¡ã¼ã·ã§ã³å¯¾è±¡ï¼ 2997 var targets = document.querySelectorAll( 2998 'h3.cparts-id619, h4.cparts-id620, h5.cparts-id621, h6.cparts-id622' 2999 ); 3000 3001 if (!targets.length) return; 3002 3003 // --- A. Marginèªå調æ´å¦ç --- 3004 // åè¦ç´ ã® text-align ãè¦ã¦ãmargin: auto ãä»ä¸ãã 3005 Array.prototype.forEach.call(targets, function (el) { 3006 // è¨ç®æ¸ã¿ã®ã¹ã¿ã¤ã«ãåå¾ 3007 const textAlign = window.getComputedStyle(el).getPropertyValue('text-align'); 3008 3009 if (textAlign === 'right') { 3010 el.style.setProperty('margin-left', 'auto', 'important'); 3011 } else if (textAlign === 'left') { 3012 el.style.setProperty('margin-right', 'auto', 'important'); 3013 } else if (textAlign === 'center') { 3014 el.style.setProperty('margin-left', 'auto', 'important'); 3015 el.style.setProperty('margin-right', 'auto', 'important'); 3016 } 3017 }); 3018 3019 // --- B. ã¹ã¯ãã¼ã«ç£è¦å¦ç (IntersectionObserver) --- 3020 // å¤ãç°å¢åãã®ãã©ã¼ã«ãã㯠3021 if (!('IntersectionObserver' in window)) { 3022 Array.prototype.forEach.call(targets, function (el) { 3023 el.classList.add('cparts-underLineAnimation-active'); 3024 });
3025 return; 3026 } 3027 3028 var observer = new IntersectionObserver(function (entries) { 3029 entries.forEach(function (entry) { 3030 if (entry.isIntersecting) { 3031 // ç»é¢ã«å ¥ã£ããã¢ãã¡ã¼ã·ã§ã³ç¨ã¯ã©ã¹ãä»ä¸ 3032 entry.target.classList.add('cparts-underLineAnimation-active'); 3033 // 1åå®è¡ãããç£è¦ãè§£é¤ 3034 observer.unobserve(entry.target); 3035 } 3036 }); 3037 }, { 3038 root: null, 3039 threshold: 0.1 // 10%è¦ãããçºç« 3040 }); 3041 3042 // åè¦ç´ ã®ç£è¦ãéå§ 3043 Array.prototype.forEach.call(targets, function (el) { 3044 observer.observe(el); 3045 }); 3046}); 3047// document.addEventListener('DOMContentLoaded', function () { 3048// // 対象ï¼å¿ è¦ã«å¿ãã¦ã»ã¬ã¯ã¿è¿½å OKï¼ 3049// var targets = document.querySelectorAll( 3050// 'h3.cparts-id619, h4.cparts-id620, h5.cparts-id621, h6.cparts-id622' 3051// ); 3052 3053// if (!targets.length) return; 3054 3055// // IntersectionObserver ã使ããªãå¤ãç°å¢åããã©ã¼ã«ãã㯠3056// if (!('IntersectionObserver' in window)) { 3057// Array.prototype.forEach.call(targets, function (el) { 3058// el.classList.add('cparts-underLineAnimation-active'); 3059// }); 3060// return; 3061// } 3062 3063// var observer = new IntersectionObserver(function (entries) {
3064// entries.forEach(function (entry) { 3065// if (entry.isIntersecting) { 3066// entry.target.classList.add('cparts-underLineAnimation-active'); 3067// // 1åä»ä¸ãããç£è¦ãå¤ãï¼ç¹°ãè¿ãä¸è¦ãªãï¼ 3068// observer.unobserve(entry.target); 3069// } 3070// }); 3071// }, { 3072// root: null, // viewport 3073// threshold: 0.1 // 10% è¦ãããçºç«ï¼å¥½ã¿ã§ 0 ã 0.3 ãªã©ã«ï¼ 3074// // rootMargin: '0px 0px -10% 0px' // æ©ã/é ã調æ´ãããå ´åã«ä½¿ã 3075// }); 3076 3077// Array.prototype.forEach.call(targets, function (el) { 3078// observer.observe(el); 3079// }); 3080 3081// }); 3082 3083document.addEventListener('DOMContentLoaded', function () { 3084 3085 function applyLayoutAdjust() { 3086 // ç»é¢å¹ ã 768px 以ä¸ãã©ãããå¤å® 3087 const isDesktop = window.matchMedia('(min-width: 768px)').matches; 3088 const rows = document.querySelectorAll('.lay-row'); 3089 3090 rows.forEach(function (row) { 3091 const cparts616Elements = Array.from(row.children).filter(el => 3092 el.classList.contains('cparts-id616') 3093 ); 3094 3095 cparts616Elements.forEach(function (el, index) { 3096 // ã768px以ä¸ããã¤ã4ã¤ç®ä»¥éãã®å ´åã®ã¿é©ç¨ 3097 if (isDesktop && index >= 3) { 3098 el.style.setProperty('margin-top', '-3rem', 'important'); 3099 el.style.setProperty('border-top', '0', 'important'); 3100 } else { 3101 // ãã以å¤ï¼ã¹ããå¹ ãã¾ãã¯æåã®3ã¤ï¼ã¯ã¹ã¿ã¤ã«ãåé¤ 3102 el.style.removeProperty('margin-top'); 3103 el.style.removeProperty('border-top'); 3104 } 3105 }); 3106 }); 3107 } 3108 3109 // ååå®è¡ 3110 applyLayoutAdjust(); 3111 3112 // ç»é¢ã®ãªãµã¤ãºæã«ãå®è¡ï¼ã¹ããââPCã®åãæ¿ã対çï¼ 3113 window.addEventListener('resize', applyLayoutAdjust); 3114 3115 // CMSã®åç夿´ãç£è¦ 3116 const observer = new MutationObserver(function () { 3117 applyLayoutAdjust(); 3118 }); 3119 3120 observer.observe(document.body, { childList: true, subtree: true }); 3121}); 3122 3123 3124/* ============================================================ 3125 ã¹ã¯ãã¼ã«ãããã¢ãã 3126============================================================ */ 3127document.addEventListener('DOMContentLoaded', () => { 3128 // cparts-id623ã¯ã©ã¹ã«å¯¾ãã¦å¦çãå®è¡ããããã夿´ãã¾ãã 3129 const modalContent = document.querySelector('.cparts-id623'); 3130 if (!modalContent) return; 3131 3132 // ========================================= 3133 // #cms_contents_areaãåå¨ããå ´åï¼ç·¨éã¢ã¼ãçï¼ã®å¦ç 3134 // ========================================= 3135 if (document.getElementById('cms_contents_area')) { 3136 // ã¢ã¼ãã«æ¬ä½ãå¼·å¶çã«è¡¨ç¤ºç¶æ ã«ãã 3137 modalContent.style.display = 'block'; 3138 // ã¢ãã¡ã¼ã·ã§ã³ç¨ã®åæä½ç½®ãºã¬ï¼ä¸ã«20pxï¼ãè§£é¤ããæ£å¸¸ãªä½ç½®ã«ãã 3139 modalContent.style.transform = 'translateY(0)'; 3140 3141 // ããã§å¦çãçµäºãã以éã®é»ããªã¼ãã¼ã¬ã¤çæï¼fixedå¦çï¼ãã¤ãã³ãç»é²ãè¡ããªã 3142 return; 3143 } 3144 3145 // 1. JSã§é»ããªã¼ãã¼ã¬ã¤ãçæããå ã®DOMé層ã§modalContentãå²ãããã«é ç½®ãã 3146 const overlay = document.createElement('div'); 3147 overlay.className = 'cparts-js-modalOverlay'; 3148 overlay.id = 'cparts-js-modalOverlay'; 3149 3150 // modalContentã®è¦ªè¦ç´ å ã§ç´åã«overlayãæ¿å ¥ããä¸ã«ç§»åï¼ã©ããï¼ããã 3151 modalContent.parentNode.insertBefore(overlay, modalContent); 3152 overlay.appendChild(modalContent); 3153 3154 // 2. ã¢ã¼ãã«æ¬ä½ã®é表示è¨å®ãè§£é¤ãã 3155 modalContent.style.display = 'block'; 3156 3157 // Cookie管çç¨ã®é¢æ° 3158 const cookieName = 'modal_shown'; 3159 3160 function setCookie(name, value, hours) { 3161 let expires = ""; 3162 if (hours) { 3163 const date = new Date(); 3164 date.setTime(date.getTime() + (hours * 60 * 60 * 1000)); 3165 expires = "; expires=" + date.toUTCString(); 3166 } 3167 document.cookie = name + "=" + (value || "") + expires + "; path=/"; 3168 } 3169 3170 function getCookie(name) { 3171 const nameEQ = name + "="; 3172 const ca = document.cookie.split(';'); 3173 for(let i = 0; i < ca.length; i++) { 3174 let c = ca[i];
3175 while (c.charAt(0) === ' ') c = c.substring(1, c.length); 3176 if (c.indexOf(nameEQ) === 0) return c.substring(nameEQ.length, c.length); 3177 } 3178 return null; 3179 } 3180 3181 // ã¹ã¯ãã¼ã«ã¤ãã³ãã®å¦ç 3182 function handleScroll() { 3183 // ãã§ã«Cookieãåå¨ããå ´åï¼éå»24æé以å ã«è¡¨ç¤ºæ¸ã¿ï¼ã¯å¦çããªã 3184 if (getCookie(cookieName)) { 3185 window.removeEventListener('scroll', handleScroll); 3186 return; 3187 } 3188 3189 // ã¹ã¯ãã¼ã«éã300pxãè¶ ããã 3190 if (window.scrollY >= 300) { 3191 // ãªã¼ãã¼ã¬ã¤ã表示ï¼å å ããã¦ããã¢ã¼ãã«æ¬ä½ãä¸ç·ã«è¡¨ç¤ºãããï¼ 3192 overlay.classList.add('cparts-id623-isActive'); 3193 3194 // Cookieãã»ããï¼24æéæå¹ï¼ 3195 setCookie(cookieName, 'true', 24); 3196 3197 // 1度表示ãããã¹ã¯ãã¼ã«ç£è¦ãè§£é¤ 3198 window.removeEventListener('scroll', handleScroll); 3199 } 3200 } 3201 3202 // ã¹ã¯ãã¼ã«ã¤ãã³ããç»é² 3203 window.addEventListener('scroll', handleScroll); 3204 3205 3206 // éããå¦çã®é¢æ° 3207 function closeModal() { 3208 overlay.classList.remove('cparts-id623-isActive'); 3209 } 3210 3211 // é»ããªã¼ãã¼ã¬ã¤ï¼å¤å´ï¼ãã¯ãªãã¯ãã¦éãã 3212 overlay.addEventListener('click', (e) => { 3213 // ãªã¼ãã¼ã¬ã¤èªèº«ãã¯ãªãã¯ãããå ´åã®ã¿éãã 3214 if (e.target === overlay) { 3215 closeModal(); 3216 } 3217 }); 3218 3219 // éãããã¿ã³ãã¯ãªãã¯ãã¦éãã 3220 const closeBtn = document.getElementById('cparts-js-modal--closeBtn'); 3221 if (closeBtn) { 3222 closeBtn.addEventListener('click', closeModal); 3223 } 3224 3225}); 3226 3227/* ============================================================ 3228 ããã¼ã¹ã©ã¤ãããã¼ 3229============================================================ */ 3230document.addEventListener("DOMContentLoaded", function() { 3231 // 1. #cms_contents_area ãåå¨ããããã§ã㯠3232 const hasCmsArea = document.getElementById('cms_contents_area') !== null; 3233 3234 if (!hasCmsArea) { 3235 3236 // 1åã2åã3åã4åã®å¯¾è±¡è¦ç´ ãã¾ã¨ãã¦åå¾ 3237 const targetCols = document.querySelectorAll('.cparts-id624--01 .lay-col12-12, .cparts-id624--02 .lay-col12-6, .cparts-id624--03 .lay-col12-4, .cparts-id624--04 .lay-col12-3'); 3238 3239 targetCols.forEach(col => { 3240 const footBlock = col.querySelector('.cparts-foot-block'); 3241 const bodyBlock = col.querySelector('.cparts-body-block'); 3242 const linkTag = footBlock ? footBlock.querySelector('a') : null; 3243 3244 if (linkTag && bodyBlock) { 3245 const wrapperLink = document.createElement('a'); 3246 wrapperLink.href = linkTag.href; 3247 wrapperLink.className = 'banner-link-wrapper'; 3248 if(linkTag.target) wrapperLink.target = linkTag.target; 3249 3250 // bodyBlockç´ä¸ã®åè¦ç´ ãwrapperLinkã®ä¸ã«ç§»å 3251 const childrenToWrap = Array.from(bodyBlock.children); 3252 childrenToWrap.forEach(child => wrapperLink.appendChild(child)); 3253 3254 // wrapperLinkãbodyBlockã®ä¸ã«è¿½å 3255 bodyBlock.appendChild(wrapperLink); 3256 3257 // bodyBlockã®paddingãè§£é¤ãã¦aã¿ã°ã«ä»»ããããã®ã¯ã©ã¹ãä»ä¸ 3258 bodyBlock.classList.add('is-wrapped'); 3259 3260 // ããã¿ã¼ãé表示 3261 footBlock.style.display = 'none'; 3262 } 3263 }); 3264 3265 } 3266}); 3267 3268/* ============================================================ 3269 ä¸è¦§ãã¼ãver.17 3270============================================================ */ 3271document.addEventListener('DOMContentLoaded', function() { 3272 // ------------------------------------------------------------------- 3273 // ã1. HTMLæ§é ã®èªåè£å®ãã¸ãã¯ã 3274 // ------------------------------------------------------------------- 3275 3276 const slideBlocks = document.querySelectorAll('.cparts-id627'); 3277 3278 if (slideBlocks.length === 0) return; 3279 3280 let currentWrapper = null; 3281 let currentTrack = null; 3282 3283 slideBlocks.forEach((block) => { 3284 if (block.closest('.cparts-carousel-wrapper')) { 3285 return; 3286 } 3287 3288 if (currentWrapper && block.previousElementSibling === currentWrapper) { 3289 currentTrack.appendChild(block); 3290 } else { 3291 currentWrapper = document.createElement('div'); 3292 currentWrapper.className = 'cparts-carousel-wrapper'; 3293 3294 currentTrack = document.createElement('div'); 3295 currentTrack.className = 'cparts-carousel-track'; 3296 3297 currentWrapper.appendChild(currentTrack); 3298 3299 const prevBtn = document.createElement('span'); 3300 prevBtn.className = 'cparts-carousel-prev dec-bg--primary'; 3301 3302 const nextBtn = document.createElement('span'); 3303 nextBtn.className = 'cparts-carousel-next dec-bg--primary'; 3304 3305 currentWrapper.appendChild(prevBtn); 3306 currentWrapper.appendChild(nextBtn); 3307 3308 block.parentNode.insertBefore(currentWrapper, block); 3309 currentTrack.appendChild(block); 3310 } 3311 }); 3312 3313 // ------------------------------------------------------------------- 3314 // #cms_contents_area ãåå¨ããå ´åã¯ã 3315 // ã©ããã¼çæã®ã¿å®è¡ãã以éã®ã«ã«ã¼ã»ã«å¦çã¯ç¡å¹å 3316 // ------------------------------------------------------------------- 3317 if (document.getElementById('cms_contents_area')) { 3318 return; 3319 } 3320 3321 // ------------------------------------------------------------------- 3322 // ã2. ã«ã«ã¼ã»ã«ã®åä½ãã¸ãã¯ã軽éè¤è£½ç 3323 // ------------------------------------------------------------------- 3324 3325 const sliderViews = document.querySelectorAll('.cparts-carousel-wrapper'); 3326 3327 sliderViews.forEach(view => { 3328 if (view.dataset.carouselInitialized === 'true') return; 3329 view.dataset.carouselInitialized = 'true'; 3330 3331 const track = view.querySelector('.cparts-carousel-track'); 3332 if (!track) return; 3333 3334 let slides = Array.from(track.querySelectorAll('.cparts-id627')); 3335 if (slides.length === 0) return; 3336 3337 // å ã¹ã©ã¤ããä¿æ 3338 const originalSlides = slides.slice(); 3339 3340 // å ã¹ã©ã¤ãã«é£çªãä»ä¸ 3341 // è¤è£½ã»ä¸¦ã³æ¿ãå¾ããæ¬¡ã«ä½çªç®ãè¤è£½ãã¹ããå¤å®ããããã«ä½¿ç¨
3342 originalSlides.forEach((slide, idx) => { 3343 slide.dataset.carouselOriginalIndex = String(idx); 3344 }); 3345 3346 // åæè¡¨ç¤ºæã«ãå ã®1çªç®ã®ã¹ã©ã¤ããä¸å¤®ã¸é ç½®ãããã©ãã 3347 let isInitialPositionAdjusted = false; 3348 3349 let isAnimating = false; 3350 let itemWidth = 0; 3351 const duration = 400; 3352 3353 function getGap() { 3354 return window.innerWidth >= 768 ? 30 : 20; 3355 } 3356 3357 // è¤è£½æã«idéè¤ãé¿ãã 3358 function removeDuplicateIds(element) { 3359 if (element.id) { 3360 element.removeAttribute('id'); 3361 } 3362 3363 element.querySelectorAll('[id]').forEach(child => { 3364 child.removeAttribute('id'); 3365 }); 3366 } 3367 3368 // å¿ è¦ææ°ã ãè¤è£½ãã軽éå¦ç 3369 // è¤è£½ã¯å¿ ããå ã¹ã©ã¤ã1ã»ããåä½ãã§è¿½å ãã 3370 function normalizeSlideCount() { 3371 if (originalSlides.length === 0 || slides.length === 0) return; 3372 3373 const gap = getGap(); 3374 track.style.gap = gap + 'px'; 3375 3376 const slideWidth = slides[0].offsetWidth; 3377 3378 // ã¾ã å¹ ãåããªãå ´åã¯ç¡çã«è¤è£½ããªã 3379 if (!slideWidth) return; 3380 3381 const viewWidth = view.offsetWidth || window.innerWidth; 3382 const visibleCount = Math.ceil(viewWidth / (slideWidth + gap)); 3383 3384 const originalCount = originalSlides.length; 3385 3386 // å ã¹ã©ã¤ãæ°ã«å¿ãã¦ãæä½ã»ããæ°ãåãæ¿ãã 3387 let minSetCount; 3388 3389 if (originalCount === 1) { 3390 minSetCount = 10; 3391 } else if (originalCount === 2) { 3392 minSetCount = 5; 3393 } else if (originalCount <= 4) { 3394 minSetCount = 3; 3395 } else { 3396 minSetCount = 2; 3397 } 3398 3399 // è¡¨ç¤ºææ° + åå¾ã®ä½ç½åãèæ ® 3400 const minRequiredCount = Math.max( 3401 originalCount * minSetCount, 3402 visibleCount + 4, 3403 originalCount 3404 ); 3405 3406 // å¿ è¦ææ°ããå ã¹ã©ã¤ãæ°ã®åæ°ãã«è£æ£ 3407 const requiredCount = Math.ceil(minRequiredCount / originalCount) * originalCount; 3408 3409 if (slides.length >= requiredCount) return; 3410 3411 const fragment = document.createDocumentFragment(); 3412 3413 while (slides.length < requiredCount) { 3414 const lastSlide = slides[slides.length - 1]; 3415 const lastOriginalIndex = Number(lastSlide.dataset.carouselOriginalIndex || 0); 3416 3417 // æå¾ã«è¿½å ããã¦ããã¹ã©ã¤ãã®æ¬¡ã®çªå·ãè¤è£½ 3418 const nextOriginalIndex = (lastOriginalIndex + 1) % originalCount; 3419 3420 const baseSlide = originalSlides[nextOriginalIndex]; 3421 const clone = baseSlide.cloneNode(true); 3422 3423 clone.classList.remove('cparts-carousel-active'); 3424 clone.setAttribute('aria-hidden', 'true'); 3425 3426 // è¤è£½å ã®çªå·ãä¿æ 3427 clone.dataset.carouselOriginalIndex = String(nextOriginalIndex); 3428 3429 // CMSç·¨éç¨IDãªã©ãè¤è£½ã§éè¤ããªãããåé¤ 3430 removeDuplicateIds(clone); 3431 3432 // è¤è£½ç»åã¯ã§ããã ãè»½ãæ±ã 3433 clone.querySelectorAll('img').forEach(img => { 3434 img.loading = 'lazy'; 3435 img.decoding = 'async'; 3436 }); 3437 3438 fragment.appendChild(clone); 3439 slides.push(clone); 3440 } 3441 3442 track.appendChild(fragment); 3443 } 3444 3445 // åæè¡¨ç¤ºæãå ã®1çªç®ã®ã¹ã©ã¤ããtrackå ã®ä¸å¤®ä½ç½®ã¸ç§»åãã 3446 function alignFirstSlideToCenter() { 3447 if (isInitialPositionAdjusted) return; 3448 if (slides.length === 0 || originalSlides.length === 0) return; 3449 3450 const centerIdx = Math.floor(slides.length / 2); 3451 const firstOriginalSlide = originalSlides[0]; 3452 3453 if (!firstOriginalSlide) return; 3454 3455 let guard = slides.length; 3456 3457 // ä¸å¤®ä½ç½®ã«ãå ã®1çªç®ã®ã¹ã©ã¤ãããæ¥ãã¾ã§é åãå転 3458 while (slides[centerIdx] !== firstOriginalSlide && guard > 0) { 3459 const firstSlide = slides.shift(); 3460 slides.push(firstSlide); 3461 guard--; 3462 } 3463 3464 // é åé ã«åããã¦DOMãä¸¦ã¹æ¿ãã 3465 const fragment = document.createDocumentFragment(); 3466
3467 slides.forEach(slide => { 3468 fragment.appendChild(slide); 3469 }); 3470 3471 track.appendChild(fragment); 3472 3473 // activeã¯ã©ã¹ãä¸åº¦ãã¹ã¦å¤ããä¸å¤®ã®1çªç®ã¹ã©ã¤ãã«ã ãä»ä¸ 3474 slides.forEach(slide => { 3475 slide.classList.remove('cparts-carousel-active'); 3476 }); 3477 3478 if (slides[centerIdx]) { 3479 slides[centerIdx].classList.add('cparts-carousel-active'); 3480 } 3481 3482 isInitialPositionAdjusted = true; 3483 } 3484 3485 // --- é ç½®ã®è¨ç®ã¨æ´æ° --- 3486 function updateLayout(animate = false) { 3487 if (slides.length === 0) return 0; 3488 3489 const gap = getGap(); 3490 track.style.gap = gap + 'px'; 3491 3492 const slideWidth = slides[0].offsetWidth; 3493 itemWidth = slideWidth + gap; 3494 3495 const centerIdx = Math.floor(slides.length / 2); 3496 const viewWidth = view.offsetWidth || window.innerWidth; 3497 const centerX = viewWidth / 2; 3498 3499 const offsetLeft = (centerIdx * itemWidth) + (slideWidth / 2); 3500 const targetX = centerX - offsetLeft; 3501 3502 track.style.transition = animate ? `left ${duration}ms ease` : 'none'; 3503 track.style.left = `${targetX}px`; 3504 3505 slides.forEach((slide, idx) => { 3506 if (idx === centerIdx) { 3507 slide.classList.add('cparts-carousel-active'); 3508 } else { 3509 slide.classList.remove('cparts-carousel-active'); 3510 } 3511 }); 3512 3513 return targetX; 3514 } 3515 3516 // --- ãæ¬¡ã¸ãã¹ã©ã¤ãå¦ç --- 3517 function moveNext(e) { 3518 if (e) e.preventDefault(); 3519 if (isAnimating) return; 3520 3521 normalizeSlideCount(); 3522 alignFirstSlideToCenter(); 3523 3524 if (slides.length < 3) return; 3525 3526 isAnimating = true; 3527 3528 const currentX = updateLayout(false); 3529 track.offsetHeight; 3530 3531 track.style.transition = `left ${duration}ms ease`; 3532 track.style.left = `${currentX - itemWidth}px`; 3533 3534 const centerIdx = Math.floor(slides.length / 2); 3535 3536 if (slides[centerIdx]) { 3537 slides[centerIdx].classList.remove('cparts-carousel-active'); 3538 } 3539 3540 if (slides[centerIdx + 1]) { 3541 slides[centerIdx + 1].classList.add('cparts-carousel-active'); 3542 } 3543 3544 setTimeout(() => { 3545 const firstElement = slides.shift(); 3546 track.appendChild(firstElement); 3547 slides.push(firstElement); 3548 3549 updateLayout(false); 3550 isAnimating = false; 3551 }, duration); 3552 } 3553 3554 // --- ãåã¸ãã¹ã©ã¤ãå¦ç --- 3555 function movePrev(e) { 3556 if (e) e.preventDefault(); 3557 if (isAnimating) return; 3558 3559 normalizeSlideCount(); 3560 alignFirstSlideToCenter(); 3561 3562 if (slides.length < 3) return; 3563 3564 isAnimating = true; 3565 3566 const lastElement = slides.pop(); 3567 track.insertBefore(lastElement, slides[0]); 3568 slides.unshift(lastElement); 3569 3570 const currentX = updateLayout(false); 3571 3572 track.style.transition = 'none'; 3573 track.style.left = `${currentX - itemWidth}px`; 3574 track.offsetHeight; 3575 3576 track.style.transition = `left ${duration}ms ease`; 3577 track.style.left = `${currentX}px`; 3578 3579 const centerIdx = Math.floor(slides.length / 2); 3580 3581 slides.forEach(s => s.classList.remove('cparts-carousel-active')); 3582 3583 if (slides[centerIdx]) { 3584 slides[centerIdx].classList.add('cparts-carousel-active'); 3585 } 3586 3587 setTimeout(() => { 3588 isAnimating = false; 3589 }, duration); 3590 } 3591 3592 // --- ã¤ãã³ããªã¹ãã¼ã®ç»é² --- 3593 const nextBtn = view.querySelector('.cparts-carousel-next'); 3594 const prevBtn = view.querySelector('.cparts-carousel-prev'); 3595 3596 if (nextBtn) nextBtn.addEventListener('click', moveNext); 3597 if (prevBtn) prevBtn.addEventListener('click', movePrev); 3598 3599 let resizeTimer = null; 3600 3601 window.addEventListener('resize', () => { 3602 clearTimeout(resizeTimer); 3603 3604 resizeTimer = setTimeout(() => { 3605 normalizeSlideCount(); 3606 alignFirstSlideToCenter(); 3607 updateLayout(false); 3608 }, 150); 3609 }); 3610 3611 // åæé ç½® 3612 setTimeout(() => { 3613 normalizeSlideCount(); 3614 alignFirstSlideToCenter(); 3615 updateLayout(false); 3616 }, 100); 3617 }); 3618}); 3619 3620 3621/* ============================================================ 3622 ä¸è¦§ãã¼ãver.18 3623============================================================ */ 3624document.addEventListener('DOMContentLoaded', () => { 3625 // #cms_contents_area ãåå¨ããããã§ã㯠3626 const hasCmsArea = document.getElementById('cms_contents_area') !== null; 3627
3628 // 対象ãã¼ããåå¾ 3629 const partsList = Array.from(document.querySelectorAll('.cparts-id629')); 3630 3631 // 1. cparts-id629 ãé£ç¶ããå ´åã«ã¾ã¨ãã¦ã©ããããå¦ç 3632 const groups = []; 3633 let currentGroup = []; 3634 3635 partsList.forEach((part) => { 3636 if (currentGroup.length === 0) { 3637 currentGroup.push(part); 3638 } else { 3639 const lastPart = currentGroup[currentGroup.length - 1]; 3640 // DOMããªã¼ä¸ã§ç´åã®è¦ç´ ï¼ããã¹ããã¼ãçãé¤ãï¼ãåã®å¯¾è±¡ãã¼ãã§ããã°é£ç¶ã¨å¤å® 3641 if (part.previousElementSibling === lastPart) { 3642 currentGroup.push(part); 3643 } else { 3644 // éã«ä»ã®è¦ç´ ãæã¾ã£ã¦ããå ´åã¯ã°ã«ã¼ãã確å®ããæ°ã°ã«ã¼ã㸠3645 groups.push(currentGroup); 3646 currentGroup = [part]; 3647 } 3648 } 3649 }); 3650 if (currentGroup.length > 0) { 3651 groups.push(currentGroup); 3652 } 3653 3654 // ã°ã«ã¼ããã¨ã«ã©ããç¨è¦ç´ ãçæãã¦ç§»å 3655 groups.forEach(group => { 3656 const blockWrapper = document.createElement('div'); 3657 blockWrapper.className = 'cparts-id629-flex-block cparts-containerwidth-block'; 3658 3659 const rowWrapper = document.createElement('div'); 3660 rowWrapper.className = 'lay-row'; 3661 3662 // 横並ã³ã¬ã¤ã¢ã¦ããç¶æããããã®ã¹ã¿ã¤ã«è¨å® 3663 rowWrapper.style.display = 'flex'; 3664 rowWrapper.style.flexWrap = 'wrap'; 3665 rowWrapper.style.width = '100vw'; 3666 rowWrapper.style.maxWidth = '100vw'; 3667 rowWrapper.style.marginLeft = 'calc(50% - 50vw)'; 3668 rowWrapper.style.marginRight = 'calc(50% - 50vw)'; 3669 3670 blockWrapper.appendChild(rowWrapper); 3671 3672 // ã°ã«ã¼ãã®æåã®è¦ç´ ã®ç´åã«ã©ããã¼ãæ¿å ¥ 3673 const firstPart = group[0]; 3674 firstPart.parentNode.insertBefore(blockWrapper, firstPart); 3675 3676 // ã°ã«ã¼ãå ã®è¦ç´ ãé çªã«ã©ããã¼å ã¸ç§»å 3677 group.forEach(part => { 3678 rowWrapper.appendChild(part); 3679 }); 3680 }); 3681 3682 // 2. ãªã³ã¯åã»footeråé¤ã®å¦ç 3683 const allParts = Array.from(document.querySelectorAll('.cparts-id629')); 3684 allParts.forEach(part => { 3685 if (!hasCmsArea) { 3686 // -------------------------------------------------- 3687 // #cms_contents_area ãç¡ãå ´å (å ¬éç»é¢ã®å¦ç) 3688 // -------------------------------------------------- 3689 const footerBlock = part.querySelector('.cparts-footer-block'); 3690 3691 if (footerBlock) { 3692 const linkEl = footerBlock.querySelector('a'); 3693 const layRowInside = part.querySelector('.lay-row'); 3694 3695 if (linkEl && layRowInside) { 3696 // aã¿ã°ã®href屿§ãåå¾ 3697 const hrefUrl = linkEl.getAttribute('href'); 3698 3699 // æ°ããã©ããç¨ã®aã¿ã°ã使 3700 const wrapperLink = document.createElement('a'); 3701 wrapperLink.setAttribute('href', hrefUrl); 3702 wrapperLink.className = 'cparts-link-wrapper'; 3703 3704 // .lay-row ã aã¿ã° ã§å ã 3705 part.insertBefore(wrapperLink, layRowInside); 3706 wrapperLink.appendChild(layRowInside); 3707 } 3708 3709 // footer-block ã¯ä¸è¦ã«ãªãã®ã§åé¤ 3710 footerBlock.remove(); 3711 } 3712 } else { 3713 // -------------------------------------------------- 3714 // #cms_contents_area ãæãå ´å (CMSç·¨éç»é¢ã®å¦ç) 3715 // -------------------------------------------------- 3716 // 仿§éãã.cparts-footer-block ã¯ãã®ã¾ã¾è¡¨ç¤ºãã¾ãï¼ä½ãããªãï¼ 3717 } 3718 }); 3719 3720 // 3. 767px以ä¸ã®ã¹ãã表示æã®DOMç§»åå¦çï¼ããã¹ããç»åã®ä¸ã«é ç½®ï¼ 3721 function handleMobileLayout() { 3722 const isMobile = window.innerWidth <= 767; 3723 const allPartsForMobile = document.querySelectorAll('.cparts-id629'); 3724 3725 allPartsForMobile.forEach(part => { 3726 const layRowInside = part.querySelector('.lay-row'); 3727 const bodyBlock = part.querySelector('.cparts-body-block'); 3728 const txtBlock = part.querySelector('.cparts-txt-block'); 3729 3730 if (!layRowInside || !bodyBlock || !txtBlock) return; 3731 3732 if (isMobile) { 3733 // ã¢ãã¤ã«æï¼ããã¹ããããã¯ã .cparts-body-block ããåºãã.lay-row ã®ç´ä¸ï¼æ«å°¾ï¼ã«ç§»å 3734 if (txtBlock.parentNode === bodyBlock) { 3735 layRowInside.appendChild(txtBlock); 3736 } 3737 } else { 3738 // PCã»ã¿ãã¬ããæï¼ããã¹ããããã¯ã .cparts-body-block ã®ä¸ã«æ»ã 3739 if (txtBlock.parentNode === layRowInside) { 3740 bodyBlock.appendChild(txtBlock); 3741 } 3742 } 3743 });
3744 } 3745 3746 // ãªãµã¤ãºæã®ã¤ãã³ãç£è¦ã¨ãååèªã¿è¾¼ã¿æã®å®è¡ 3747 window.addEventListener('resize', handleMobileLayout); 3748 handleMobileLayout(); 3749}); 3750 3751/* ============================================================ 3752 ç»åï¼è¦åºãã»ããã¹ãï¼ãªã¹ããã¿ã³ï¼ 3753 è¦åºãã»ããã¹ãï¼ãªã¹ããã¿ã³ï¼ï¼ç»å 3754============================================================ */ 3755(function () { 3756 function addPrimaryBgClass() { 3757 var hasType01 = document.querySelector('.cparts-id635--01'); 3758 var hasType02 = document.querySelector('.cparts-id635--02'); 3759 if (!hasType01 && !hasType02) { 3760 return; 3761 } 3762 3763 var links = document.querySelectorAll( 3764 '.cparts-id635--01 > .lay-row > div:first-child > .cparts-txt-block:last-of-type ul li a,' + 3765 '.cparts-id635--02 > .lay-row > .cparts-img-block:first-child + div > .cparts-txt-block:last-of-type ul li a' 3766 ); 3767 3768 for (var i = 0; i < links.length; i += 1) { 3769 links[i].classList.add('dec-bg-pe--primary'); 3770 } 3771 } 3772 3773 if (document.readyState === 'loading') { 3774 document.addEventListener('DOMContentLoaded', addPrimaryBgClass); 3775 } else { 3776 addPrimaryBgClass(); 3777 } 3778})(); 3779 3780/* ============================================================ 3781 è¦åºãã»ããã¹ãï¼ã¹ã©ã¤ãèæ¯ 3782============================================================ */ 3783(function () { 3784 'use strict'; 3785 3786 function getSlideDirection(part) { 3787 if (part.classList.contains('cparts-animate--imageSlideRight')) { 3788 return 'right'; 3789 } 3790 3791 return 'left'; 3792 } 3793 3794 function moveImageListBlock(parts) { 3795 for (var i = 0; i < parts.length; i += 1) { 3796 var row = parts[i].querySelector('.lay-row'); 3797 if (!row) { 3798 continue; 3799 } 3800 3801 var column = row.querySelector('.lay-col12-12'); 3802 if (!column) { 3803 continue; 3804 } 3805 3806 var imageListBlock = column.querySelector( 3807 '.parts_h_type16 + .cparts-txt-block + .cparts-txt-block + .cparts-txt-block' 3808 ); 3809 3810 if (!imageListBlock || imageListBlock.parentNode === row) { 3811 continue; 3812 } 3813 3814 row.insertBefore(imageListBlock, column.nextSibling); 3815 } 3816 } 3817 3818 function fitVerticalSideText(part) { 3819 var target = part.querySelector( 3820 '.cparts-body-block > .parts_h_type16 + .cparts-txt-block + .cparts-txt-block' 3821 ); 3822 3823 if (!target) { 3824 return; 3825 } 3826 3827 var partHeight = part.getBoundingClientRect().height; 3828 if (!partHeight) { 3829 return; 3830 } 3831 3832 var maxSize = 150; 3833 var minSize = 24; 3834 var topPadding = 20; 3835 var bottomPadding = 20; 3836 var availableHeight = Math.max(partHeight - topPadding - bottomPadding, 0); 3837 var low = minSize; 3838 var high = maxSize; 3839 var best = minSize; 3840 3841 target.style.setProperty('position', 'absolute'); 3842 target.style.setProperty('top', topPadding + 'px', 'important'); 3843 target.style.setProperty('bottom', 'auto', 'important'); 3844 target.style.setProperty('font-size', maxSize + 'px', 'important'); 3845 3846 for (var i = 0; i < 10; i += 1) { 3847 var middle = (low + high) / 2; 3848 target.style.setProperty('font-size', middle + 'px', 'important'); 3849 3850 if (target.getBoundingClientRect().height <= availableHeight) { 3851 best = middle; 3852 low = middle; 3853 } else { 3854 high = middle; 3855 } 3856 } 3857 3858 target.style.setProperty('font-size', Math.floor(best) + 'px', 'important'); 3859 3860 var targetHeight = target.getBoundingClientRect().height; 3861 var top = Math.max(topPadding, Math.floor((partHeight - targetHeight) / 2)); 3862 var scrollbarWidth = window.innerWidth - document.documentElement.clientWidth; 3863 3864 if (window.matchMedia('(min-width: 768px)').matches) { 3865 target.style.setProperty('right', (scrollbarWidth - 18) + 'px', 'important'); 3866 } else { 3867 target.style.removeProperty('right'); 3868 } 3869 3870 target.style.setProperty('top', top + 'px', 'important'); 3871 } 3872 3873 function fitAllVerticalSideText(parts) { 3874 for (var i = 0; i < parts.length; i += 1) { 3875 fitVerticalSideText(parts[i]); 3876 } 3877 } 3878 3879 function getSliderBlock(part) { 3880 var sliderBlock = part.querySelector('.cparts-body-block > .cparts-txt-block:last-of-type'); 3881 if (sliderBlock && sliderBlock.querySelector('ul li img')) { 3882 return sliderBlock; 3883 } 3884 3885 sliderBlock = part.querySelector('.lay-row > .lay-col12-12 + .cparts-txt-block'); 3886 if (sliderBlock && sliderBlock.querySelector('ul li img')) { 3887 return sliderBlock; 3888 } 3889 3890 return null; 3891 } 3892 3893 function setupSlider(part) { 3894 var sliderBlock = getSliderBlock(part); 3895 if (!sliderBlock || sliderBlock.getAttribute('data-cparts-id631-slider') === 'true') { 3896 return; 3897 } 3898 3899 var list = sliderBlock.querySelector('ul'); 3900 if (!list) { 3901 return; 3902 } 3903 3904 var items = list.querySelectorAll('li'); 3905 if (items.length < 2) { 3906 if (items.length === 1) { 3907 items[0].style.setProperty('width', '100%', 'important'); 3908 } 3909 return; 3910 } 3911 3912 sliderBlock.setAttribute('data-cparts-id631-slider', 'true'); 3913 3914 var isStop = part.classList.contains('cparts-animate--imageSlideStop'); 3915 var direction = getSlideDirection(part); 3916 var count = items.length; 3917 var offset = 0; 3918 var lastTime = null; 3919 var loopWidth = 0; 3920 var speed = 34; 3921 3922 if (!isStop) { 3923 for (var i = 0; i < count; i += 1) { 3924 var clone = items[i].cloneNode(true); 3925 clone.setAttribute('data-cparts-id631-clone', 'true'); 3926 list.appendChild(clone); 3927 } 3928 } 3929 3930 function getSliderHeight() { 3931 var body = part.querySelector('.cparts-body-block'); 3932 var height = body ? body.getBoundingClientRect().height : 0; 3933 3934 if (!height) { 3935 height = part.getBoundingClientRect().height; 3936 } 3937 3938 return Math.max(height, 1); 3939 } 3940 3941 function refresh() { 3942 var allItems = list.querySelectorAll('li'); 3943 var total = allItems.length; 3944 var sliderWidth = sliderBlock.clientWidth || part.getBoundingClientRect().width || window.innerWidth; 3945 var sliderHeight = getSliderHeight(); 3946 var row = part.querySelector('.lay-row'); 3947 var itemWidth = isStop 3948 ? (100 / count) 3949 : (window.matchMedia('(max-width: 767px)').matches ? 30 : (100 / total)); 3950 3951 if (row) { 3952 row.style.setProperty('position', 'relative', 'important'); 3953 } 3954 3955 sliderBlock.style.setProperty('position', 'absolute'); 3956 sliderBlock.style.setProperty('top', '0', 'important'); 3957 sliderBlock.style.setProperty('right', '0', 'important'); 3958 sliderBlock.style.setProperty('bottom', 'auto', 'important'); 3959 sliderBlock.style.setProperty('left', '0', 'important'); 3960 sliderBlock.style.setProperty('z-index', '1', 'important'); 3961 sliderBlock.style.setProperty('overflow', 'hidden', 'important'); 3962 sliderBlock.style.setProperty('width', '100%', 'important'); 3963 sliderBlock.style.setProperty('height', sliderHeight + 'px'); 3964 sliderBlock.style.setProperty('margin', '0', 'important'); 3965 sliderBlock.style.setProperty('padding', '0', 'important'); 3966 3967 list.style.setProperty('position', 'relative', 'important'); 3968 list.style.setProperty('display', 'block', 'important'); 3969 list.style.setProperty('overflow', 'hidden', 'important'); 3970 list.style.setProperty('width', isStop ? '100%' : ((total * 50) + '%'), 'important'); 3971 list.style.setProperty('height', sliderHeight + 'px', 'important'); 3972 list.style.setProperty('transition', 'none', 'important'); 3973 list.style.setProperty('left', '0px', 'important'); 3974 list.style.setProperty('margin', '0', 'important'); 3975 list.style.setProperty('padding', '0', 'important'); 3976 3977 for (var i = 0; i < total; i += 1) { 3978 allItems[i].style.setProperty('display', 'block', 'important'); 3979 allItems[i].style.setProperty('float', 'left', 'important'); 3980 allItems[i].style.setProperty('width', itemWidth + '%', 'important'); 3981 allItems[i].style.setProperty('height', sliderHeight + 'px', 'important'); 3982 allItems[i].style.setProperty('margin', '0', 'important'); 3983 allItems[i].style.setProperty('padding', '0', 'important'); 3984 allItems[i].style.setProperty('list-style', 'none', 'important'); 3985 3986 var img = allItems[i].querySelector('img'); 3987 if (img) { 3988 img.style.setProperty('display', 'block', 'important'); 3989 img.style.setProperty('width', '100%', 'important'); 3990 img.style.setProperty('height', '100%', 'important'); 3991 img.style.setProperty('max-width', 'none', 'important'); 3992 img.style.setProperty('object-fit', 'cover', 'important'); 3993 img.style.setProperty('object-position', 'center center', 'important'); 3994 } 3995 } 3996 3997 if (isStop) { 3998 offset = 0; 3999 loopWidth = 0; 4000 lastTime = null; 4001 return; 4002 } 4003 4004 loopWidth = sliderWidth * count * 0.5; 4005 offset = direction === 'right' ? loopWidth : 0; 4006 lastTime = null; 4007 list.style.setProperty('left', (-offset) + 'px', 'important'); 4008 } 4009 4010 function tick(time) { 4011 if (isStop) { 4012 return; 4013 } 4014 4015 if (lastTime === null) { 4016 lastTime = time; 4017 } 4018 4019 if (direction === 'right') { 4020 offset -= ((time - lastTime) / 1000) * speed; 4021 } else { 4022 offset += ((time - lastTime) / 1000) * speed; 4023 } 4024 4025 lastTime = time; 4026 4027 if (loopWidth > 0 && offset >= loopWidth) { 4028 offset -= loopWidth; 4029 } 4030 4031 if (loopWidth > 0 && offset < 0) { 4032 offset += loopWidth; 4033 } 4034 4035 list.style.setProperty('left', (-offset) + 'px', 'important'); 4036 window.requestAnimationFrame(tick); 4037 } 4038 4039 refresh();
4040 window.addEventListener('load', refresh); 4041 window.addEventListener('resize', refresh); 4042 4043 if (!isStop) { 4044 window.requestAnimationFrame(tick); 4045 } 4046 } 4047 4048 function startCpartsId631() { 4049 var parts = document.querySelectorAll('.cparts-id631'); 4050 if (!parts.length) { 4051 return; 4052 } 4053 4054 if (document.getElementById('cms_contents_area')) { 4055 moveImageListBlock(parts); 4056 } 4057 4058 fitAllVerticalSideText(parts); 4059 4060 window.addEventListener('load', function () { 4061 fitAllVerticalSideText(parts); 4062 }); 4063 4064 window.addEventListener('resize', function () { 4065 fitAllVerticalSideText(parts); 4066 }); 4067 4068 for (var i = 0; i < parts.length; i += 1) { 4069 setupSlider(parts[i]); 4070 } 4071 } 4072 4073 if (document.readyState === 'loading') { 4074 document.addEventListener('DOMContentLoaded', startCpartsId631); 4075 } else { 4076 startCpartsId631(); 4077 } 4078})();
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.