1let scrollTrigger; 2let cookiePath = "7/" 3let originalOgpImage; 4 5$(function () { 6 7 // ãµããã¼ã¸ã®åæå 8 if (location.href.match(/page=/)) { 9 let param = location.href.substring(location.href.lastIndexOf("/") + 1); 10 updateSubPage(param, true); 11 } 12 else { 13 let url = ""; 14 if (location.href.lastIndexOf("/") < location.href.length) { 15 url = location.href.substring(location.href.lastIndexOf("/") + 1); 16 } 17 updateNav(url); 18 $('#content').removeClass("hidden"); 19 } 20 21 scrollEvent(); 22 23 initBarba(); 24 initScrollTrigger(); 25 initSwiper(); 26 initColorBox(); 27 initBgm(); 28 29 // è±å¹éª 30 // if (!isMacOS()) { 31 initParticle(); 32 // } 33 34 // é²ã®é ç½® 35 let code = ""; 36 for (let i = 4; i < $(document).height() / 500; i++) { 37 let value = "left"; 38 let offset = 0; 39 if (i % 2 == 1) 40 { 41 value = "right"; 42 // offset = -500; 43 } 44 code += '<div class="common-bg-cloud ' + value + '" style="top: ' + (500 * i + offset) + 'px;"></div>'; 45 } 46 $('.common-bg-clouds').html(code); 47 48 // ã°ãã¼ãã«ããã²ã¼ã·ã§ã³ 49 /* 50 var systemNav = $(".glnav-sub-container.system"); 51 var systemNavOver = false; // ãã·ã¹ãã ãã®ä¸ã«ã«ã¼ã½ã«ãããã 52 var systemSubNavOver = false; // ã·ã¹ãã ãµãã¡ãã¥ã¼ã®ä¸ã«ã«ã¼ã½ã«ãããã 53 var systemSubNavCloseWait = -1; 54 var systemSubNavWaitClose = false; 55 */ 56 // const systemNav = { 57 // parent: $(".glnav-item.system"), 58 // body: $(".glnav-sub-container.system"), 59 // over: false, 60 // subNavOver: false, 61 // subNavCloseWait: -1, 62 // subNavWaitClose: false 63 // } 64 // const characterNav = { 65 // parent: $(".glnav-item.character"), 66 // body: $(".glnav-sub-container.character"), 67 // over: false, 68 // subNavOver: false, 69 // subNavCloseWait: -1, 70 // subNavWaitClose: false 71 // } 72 // const arrCategory = { 73 // 'system' : systemNav, 74 // 'character' : characterNav 75 // }; 76 77 let waitClose = function(category) { 78 //console.log("Over:" + category.over + " SubOver:" + category.subNavOver + " wait:" + category.subNavCloseWait); 79 if (!category.over && !category.subNavOver && category.subNavCloseWait == -1) { 80 category.body.removeClass("show"); 81 category.subNavCloseWait = -1; 82 } 83 else { 84 setTimeout(waitClose, 100, category); 85 if (category.subNavCloseWait > -1) { 86 category.subNavCloseWait--; 87 } 88 89 } 90 } 91 92 // function setHoverEvent(category){ 93 // category.parent.hover( 94 // function() { 95 // category = getCategory(this); 96 // // ãã¦ã¹ãªã¼ãã¼ 97 // if (!category.body.hasClass("show")) { category.body.addClass("show"); } 98 // category.over = true; 99 // $(".glnav-sub-container").removeClass("front"); 100 // category.body.addClass("front"); 101 // }, 102 // // ãã¦ã¹ã¢ã¦ã 103 // function() { 104 // category = getCategory(this); 105 // category.over = false; 106 // if (category.subNavCloseWait == -1) { 107 // setTimeout(waitClose, 100, category); 108 // } 109 // category.subNavCloseWait = 2; 110 // } 111 // ); 112 // category.body.hover( 113 // // ãã¦ã¹ãªã¼ãã¼ 114 // function() { 115 // category = getCategory(this); 116 // category.subNavOver = true; 117 // }, 118 // // ãã¦ã¹ã¢ã¦ã 119 // function() { 120 // category = getCategory(this); 121 // category.subNavOver = false; 122 // if (category.subNavCloseWait == -1) { 123 // setTimeout(waitClose, 100, category); 124 // } 125 // category.subNavCloseWait = 2; 126 // } 127 // ); 128 // } 129 // function getCategory(hoverObj){ 130 // return arrCategory[$(hoverObj).data('nav')]; 131 // } 132 //setHoverEvent(systemNav); 133 //ããã¼ã¤ãã³ãåæå 134 // for(const category in arrCategory){ 135 // setHoverEvent(arrCategory[category]); 136 // } 137 138 $('body').on('click', '.glnav-item', function(e) { 139 // ããã²ã¼ã·ã§ã³ã®æ´æ° 140 let href = $(this).find('a').attr("href"); 141 if (href != null && href !== 'undefined') { 142 updateNav(href); 143 // if (isSP()) { $('.sp-glnav-button').click(); } 144 $('.glnav-close-button').click(); 145 } 146 });
147 $('body').on('click', '.glnav-wrapper .glnav-sub-item', function(e) { 148 if(location.href.match(/topics/) == false){ 149 e.preventDefault(); 150 } 151 // ããã²ã¼ã·ã§ã³ã®æ´æ° 152 let href = $(this).find('a').attr("href"); 153 updateNav(href); 154 155 // if (!isSP()) { 156 // // ãµãããã²ã¼ã·ã§ã³ãéãã 157 // for(const category in arrCategory){ 158 // closeNav(arrCategory[category]); 159 // } 160 // } 161 // else { $('.sp-glnav-button').click(); } 162 163 // function closeNav(category) { 164 // category.body.addClass("hidden"); 165 // setTimeout(function (category){ 166 // category.body.removeClass("hidden"); 167 // }, 500, category); 168 // } 169 $('.glnav-close-button').click(); 170 }); 171 172 // ã¹ããåãã°ãã¼ãã«ããã²ã¼ã·ã§ã³ 173 // $('body').on('click', ".sp-glnav-button", function(e) { 174 // e.preventDefault(); 175 // if ($(".glnav-wrapper").hasClass("show")) { 176 // $(".glnav-wrapper").removeClass("show"); 177 // $(".sp-glnav-button").removeClass("show"); 178 // } 179 // else { 180 // $(".glnav-wrapper").addClass("show"); 181 // $(".sp-glnav-button").addClass("show"); 182 // } 183 184 // }); 185 186 // ã¹ããåãã°ãã¼ãã«ããã²ã¼ã·ã§ã³ 187 $('body').on('click', ".glnav-open-button", function(e) { 188 $(".glnav-wrapper").addClass("show"); 189 }); 190 $('body').on('click', ".glnav-close-button", function(e) { 191 $(".glnav-wrapper").removeClass("show"); 192 }); 193 194 // ã¹ã¯ãã¼ã«ã¤ãã³ã 195 $(window).on('scroll', scrollEvent); 196 197 var requestId; 198 var prevScrollTop = 0; 199 function scrollEvent(e) { 200 201 cancelAnimationFrame(requestId); 202 requestId = requestAnimationFrame(function() { 203 204 let top = $(window).scrollTop(); 205 // let glnav = $('.glnav-wrapper'); 206 let footOrderBtn = $('.foot-order-button'); 207 let scrollTopBtn = $('.sctop-button'); 208 if (top > 100) { 209 // if (!isSP()) { 210 // if (top < prevScrollTop || top > $(document).height() - $(window).height() - 250) { 211 // glnav.addClass("show"); 212 // } 213 // else { glnav.removeClass("show"); } 214 // } 215 footOrderBtn.addClass("show"); 216 scrollTopBtn.addClass("show"); 217 } 218 else { 219 // if (!isSP()) { 220 // glnav.addClass("show"); 221 // } 222 footOrderBtn.removeClass("show"); 223 scrollTopBtn.removeClass("show"); 224 } 225 226 prevScrollTop = top; 227 }); 228 } 229 230 /* -------------------------------------------------------------------------------- 231 ã¦ã£ã³ãã¦ã®ãªãµã¤ãºã¤ãã³ã 232 -------------------------------------------------------------------------------- */ 233 $(window).on("resize", resizeEvent); 234 function resizeEvent() { 235 // ãã£ã³ãã¹ã®ãµã¤ãºãæ´æ° 236 // let cvsWidth = $(window).innerWidth(); 237 // let cvsHeight = $(window).innerHeight(); 238 // $("canvas").attr("width", cvsWidth); 239 // $("canvas").attr("height", cvsHeight); 240 } 241 242 // ãã¼ã¸ããããã¿ã³ 243 $('body').on('click', '.sctop-button', function(e) { 244 e.preventDefault(); 245 $('body,html').animate({ 246 scrollTop: 0 247 }, 600,"swing"); 248 }); 249 250 // ã·ã§ã¼ãã«ããï¼ãã¼ã¸å ã¹ã¯ãã¼ã«ï¼ 251 $(document).on("click", ".shortcut", function(e) { 252 e.preventDefault(); 253 254 let href = $(this).attr("href"); 255 if (!$(href).length) { return; } 256 257 $("body,html").animate({ 258 scrollTop: $(href).offset().top 259 }, 600, "swing"); 260 }); 261 262 // æ©è¦è¡¨ã®ç¢å° 263 $(document).on("click", ".arrow", function() { 264 $(".scroll").animate({ 265 scrollLeft: $(".comparison th").eq(1).outerWidth() 266 }, 600,"swing"); 267 }); 268 269 // ãµããã¼ã¸åãæ¿ã 270 var subPageParam; 271 $('body').on('click', '[data-page]', function(e) { 272 e.preventDefault(); 273 e.stopPropagation(); 274 e.stopImmediatePropagation(); 275 276 param = $(this).attr('href'); 277 $('#content').addClass("hidden"); 278 $('.footer-wrapper').addClass("hidden"); 279 setTimeout(function() { 280 updateSubPage(param, true); 281 }, 250); 282 }); 283 // $('#content').on('transitionend', function() { 284 // if($(this).hasClass("hidden") && subPageParam != null) { updateSubPage(subPageParam); } 285 // }); 286 287 288 // ãµããã¼ã¸åãæ¿ãã®ããã¼ã¸ãæ»ããå¯¾å¿ 289 $(window).on('popstate', function(e) { 290 // if (!location.href.match(/page=/)) { return; } 291 292 let url = location.href.substring(location.href.lastIndexOf("/") + 1); 293 let [file, category, subCategory, page] = getSubPageParam(url); 294 295 let state = e.originalEvent.state; 296 if (state != null && state.data != null) { 297 $('#content').addClass("hidden"); 298 $('.footer-wrapper').addClass("hidden"); 299 setTimeout(function() { 300 $('#content').empty(); 301 $('#content').append(state.data); 302 303 initSubPage(url); 304 $('#content').removeClass("hidden"); 305 $('.footer-wrapper').removeClass("hidden"); 306 }, 250); 307 } 308 else if (category == "story" || category == "system" || category == "character") { 309 let noSubPage = false; 310 if (category == "story" && page == null) { url += "?page=synopsis" } 311 else if ((category == "system" || category =="character") && page == null) { 312 // console.log("subCategory:" + subCategory); 313 if (subCategory == "battle") { url += "?page=max" } 314 else if (subCategory == "training") { url += "?page=character_training" } 315 else { noSubPage = true; } 316 } 317 // console.log("url:" + url); 318 $('#content').addClass("hidden"); 319 $('.footer-wrapper').addClass("hidden"); 320 setTimeout(function() { 321 if (noSubPage) { $('.footer-wrapper').removeClass("hidden"); } 322 else { updateSubPage(url, false); } 323 }, 250); 324 } 325 }); 326 327 // ãã£ã©ã¯ã¿ã¼ãã¼ã¸ã®ãã£ã©ã¢ã¤ã³ã³ 328 // $('body').on('click', '.character_list li a', function(e) { 329 // e.preventDefault(); 330 331 // // å±¥æ´ã追å 332 // if (window.history && window.history.pushState) { 333 // let charaId = $(this).parent().attr("class"); 334 // history.pushState(null, null, "character.html?chara=" + charaId); 335 // // console.log("character.html?chara=" + charaId); 336 // } 337 // }); 338 339 // ã«ã¦ã³ããã¦ã³ 340 if ($('#countdown').length) { 341 // setTimeout(function() { 342 // $("#countdown").click(); 343 // }, 750); 344 $("#countdown").click(); 345 } 346}); 347 348$(window).on('load', function () { 349 // ãã¼ã¸ã®è¡¨ç¤º 350 $('body').addClass("loaded"); 351 352 // ããããã¼ã¸ã®åæå 353 if ($('#top').length) { 354 initTopPage(); 355 } 356 else if ($('#dlc').length) { 357 initDLCPage(); 358 } 359 360 // ãã£ã©ã¯ã¿ã¼ãã¼ã¸ã®åæå 361 if (location.href.match(/chara=/)) { 362 let param = location.href.substring(location.href.lastIndexOf("/") + 1); 363 let charaId = getParam(location.href, "chara"); 364 // console.log("charaId:" + charaId); 365 if (charaId != null) { 366 $('.character_list .' + charaId + ' a').click(); 367 } 368 } 369 370 // æ©è¦è¡¨ã®ã¹ã¯ãã¼ã« 371 $(".scroll").on("scroll", function() { 372 let scroll = $(".scroll").scrollLeft(); 373 if (scroll == 0) { $(".arrow").show(); } 374 else { $(".arrow").hide(); } 375 }); 376}); 377 378/* -------------------------------------------------------------------------------- 379 Swiperã®åæå 380-------------------------------------------------------------------------------- */ 381function initSwiper() { 382 const swiperTop = new Swiper(".swiper-top", { 383 slidesPerView: 4, 384 loop: false, 385 spaceBetween: 0, 386 simulateTouch: true, 387 observer: true, 388 observeParents: true, 389 breakpoints: { 390 960:{ 391 slidesPerView: 1.1, 392 centeredSlides: true, 393 }, 394 }, 395 navigation: { 396 nextEl: '.swiper-button-next', 397 prevEl: '.swiper-button-prev' 398 }, 399 }); 400 401 const swiperStory = new Swiper(".swiper-story", { 402 slidesPerView: 1, 403 autoplay: true, 404 loop: true, 405 spaceBetween: 0, 406 simulateTouch: true, 407 observer: true, 408 observeParents: true, 409 breakpoints: { 410 960:{ 411 slidesPerView: 1, 412 centeredSlides: true, 413 }, 414 }, 415 pagination: { 416 el: '.swiper-pagination', 417 clickable: true, 418 }, 419 }); 420} 421 422/* -------------------------------------------------------------------------------- 423 barbaã®åæå 424-------------------------------------------------------------------------------- */ 425function initBarba() { 426 try{ 427 const replaceHead = function(data){
428 const head = document.head; 429 const newPageRawHead = data.next.html.match(/<head[^>]*>([\s\S.]*)<\/head>/i)[0]; 430 const newPageHead = document.createElement('head'); 431 newPageHead.innerHTML = newPageRawHead; 432 433 const removeHeadTags = [ 434 "meta" 435 ,"link" 436 ].join(','); 437 438 const headTags = head.querySelectorAll(removeHeadTags); 439 440 for(let i = 0; i < headTags.length; i++) { 441 head.removeChild(headTags[i]); 442 } 443 444 const newHeadTags = newPageHead.querySelectorAll(removeHeadTags); 445 446 for(let i = 0; i < newHeadTags.length; i++ ){ 447 head.appendChild(newHeadTags[i]); 448 } 449 } 450 451 barba.use(barbaCss); 452 barba.init({ 453 transitions: [{ 454 beforeLeave() { 455 $('body').removeClass("loaded"); 456 }, 457 leave() { 458 }, 459 beforeEnter(data) { 460 // URLãããã¼ã¸ã®ã«ãã´ãªãå²ãåºã 461 let url = ""; 462 if (location.href.lastIndexOf("/") < location.href.length) { 463 url = location.href.substring(location.href.lastIndexOf("/") + 1); 464 } 465 let [file, category, subCategory, page] = getSubPageParam(url); 466 467 // ãããã¯ã¹ãã¼ã¸ããé·ç§»ããéã¯URLãå¤ãã¦ãã 468 // if ($("body").attr("id") == "topics") { 469 // $(".glnav-item a").each(function (e) { 470 // let href = $(this).attr("href"); 471 // href = href.replace("../../", ""); 472 // $(this).attr("href", href); 473 // }); 474 // } 475 476 $('body').removeAttr('id'); 477 $('body').attr('id', category); 478 if (category == "top") { 479 // ã¹ã¯ãã¼ã«ä¸å¯ã«å¤æ´ 480 $('body').removeClass("no_fixed"); 481 initTopPage(); 482 } 483 else if (category == "dlc") { 484 initDLCPage(); 485 } 486 487 // æ©è¦è¡¨ã®ã¹ã¯ãã¼ã« 488 $(".scroll").on("scroll", function() { 489 let scroll = $(".scroll").scrollLeft(); 490 if (scroll == 0) { $(".arrow").show(); } 491 else { $(".arrow").hide(); } 492 }); 493 494 // ãããã¯ã¹ãã¼ã¸ã¸é·ç§»ããéã¯URLãå¤ãã¦ãã 495 // else if (category == "topics") { 496 497 // $(".glnav-item a").each(function (e) { 498 // let href = "../../" + $(this).attr("href"); 499 // $(this).attr("href", href); 500 // }); 501 // } 502 503 // ã¹ã¯ãã¼ã«ä½ç½®ããªã»ãã 504 let index = location.href.lastIndexOf("#"); 505 if (index == -1) { $('body,html').scrollTop(0); } 506 else { 507 let anchor = location.href.substring(index); 508 if ($(anchor).length) { 509 $('body,html').scrollTop($(anchor).offset().top - 75); 510 } 511 else { $('body,html').scrollTop(0); } 512 } 513 514 // ããã²ã¼ã·ã§ã³ã®æ´æ° 515 updateNav(url); 516 517 // replaceHead(data); 518 519 initScrollTrigger(); 520 initSwiper(); 521 initColorBox(); 522 523 // ãã£ã©ã¯ã¿ã¼ãã¼ã¸ã®åæåï¼ããããã¼ã¸ãããã£ã©è©³ç´°ã«é£ã¶ã®ã«ä½¿ç¨ï¼ 524 if (location.href.match(/chara=/)) { 525 let param = location.href.substring(location.href.lastIndexOf("/") + 1); 526 let charaId = getParam(location.href, "chara"); 527 // console.log("charaId:" + charaId); 528 // console.log('a.' + charaId); 529 if (charaId != null) { 530 $('.character_list .' + charaId + ' a').click(); 531 } 532 } 533 // ã·ã¹ãã ãã¼ã¸ã®åæåï¼æ°ã·ã¹ãã ãã¼ã¸ããé£ã¶ã®ã«ä½¿ç¨ï¼ 534 else if (location.href.match(/page=/)) { 535 // $('article .glnav-sub-container').addClass("hidden"); 536 537 let param = location.href.substring(location.href.lastIndexOf("/") + 1); 538 updateSubPage(param, false); 539 } 540 }, 541 afterEnter() { 542 $('body').addClass("loaded"); 543 544 if ($('#top').length) { 545 $(window).trigger('load'); 546 } 547 548 // ãµããã¼ã¸å¯¾å¿ 549 $('#content').removeClass("hidden"); 550 } 551 }] 552 }); 553 }catch(e){ 554 555 } 556 557} 558 559/* -------------------------------------------------------------------------------- 560 BGMã®åæå 561-------------------------------------------------------------------------------- */ 562let bgmPlayer; 563let bgmFilePath = "sound/bgm/bgm_01.mp3";
564let bgmLoopStart = 1870949 * 1000 / 48000; 565let bgmLoopEnd = 9270657 * 1000 / 48000 - bgmLoopStart; 566let bgmVolArray = [ 0, 0.075, 0.2 ]; 567let bgmVolClassNameArray = [ "vol_0", "vol_1", "vol_2" ]; 568let bgmVolSwitch = false; 569let bgmVolLv = 0; 570 571function initBgm() { 572 let pathfix = ""; 573 if(location.href.match(/topics/)){ 574 pathfix = "../../"; 575 } 576 bgmPlayer = new Howl({ 577 src: [pathfix+bgmFilePath], 578 volume: 0, 579 sprite: { 580 first: [ 0, bgmLoopStart ], 581 loop: [ bgmLoopStart, bgmLoopEnd, true] 582 }, 583 onload: function() { 584 // let userAgent = window.navigator.userAgent.toLowerCase(); 585 // if (userAgent.indexOf('chrome') !== -1 && userAgent.indexOf('trident') === -1 && userAgent.indexOf('edg') === -1) { 586 // if(($.cookie(cookiePath + "bgmLv") > 0)){ 587 // bgmVolLv = $.cookie(cookiePath + "bgmLv"); 588 // if (bgmVolLv == bgmVolArray.length - 1) { bgmVolSwitch != bgmVolSwitch; } 589 // } 590 // } 591 592 // if (bgmVolArray[bgmVolLv] != 0) { 593 // setTimeout(function() { 594 // bgmPlayer.play("first"); 595 // }, 500); 596 // } 597 // setVolume(bgmVolLv); 598 }, 599 onend: function() { 600 if (!bgmPlayer.playing()) { 601 bgmPlayer.play("loop"); 602 } 603 } 604 }); 605} 606 607// BGMã®ä¸æ 608function suspendBgm() { 609 // BGMã®ãã§ã¼ãã¢ã¦ã 610 if (bgmVolLv > 0) { 611 bgmPlayer.fade(bgmPlayer.volume(), 0, 600); 612 } 613} 614 615// BGMã®åé 616function resumeBgm() { 617 // BGMã®ãã§ã¼ãã¤ã³ 618 if (bgmVolLv > 0) { 619 bgmPlayer.fade(bgmPlayer.volume(), bgmVolArray[bgmVolLv], 600); 620 } 621} 622 623$(document).on("click", ".bgm-button", function() { 624 let prevVol = bgmVolArray[bgmVolLv]; 625 // ãã¿ã³ãæ¼ããã³ã«å¾å¾©ããããã«ããªã¥ã¼ã ã墿¸ãã 626 if (bgmVolSwitch) { 627 if (bgmVolLv > 0) { bgmVolLv--; } 628 if (bgmVolLv == 0) { bgmVolSwitch = !bgmVolSwitch; } 629 } 630 else { 631 if (bgmVolLv < bgmVolArray.length - 1) { bgmVolLv++; } 632 if (bgmVolLv == bgmVolArray.length - 1) { bgmVolSwitch = !bgmVolSwitch; } 633 } 634 if (bgmVolArray[bgmVolLv] == 0) { 635 bgmPlayer.pause(); 636 } 637 else if (prevVol == 0) { 638 bgmPlayer.play("first"); 639 } 640 setVolume(bgmVolLv); 641}); 642 643function setVolume(lv) { 644 bgmPlayer.volume(bgmVolArray[lv]); 645 $(".bgm-button").attr("class", "bgm-button " + bgmVolClassNameArray[lv]); 646 // $.cookie(cookiePath + "bgmLv", lv, { path: "/" }); 647} 648 649/* -------------------------------------------------------------------------------- 650 ãã¤ã¹ã®åç 651-------------------------------------------------------------------------------- */ 652let voicePlayer; 653let voiceVol = 0.2; 654let playingVoiceData = null; 655$(document).on("click", ".voice-button", function() { 656 let stop = false; 657 if (voicePlayer != null && voicePlayer.playing()) { 658 stop = true; 659 voicePlayer.stop(); 660 voicePlayer.unload(); 661 } 662 if (stop == false || (stop && playingVoiceData != $(this).data("voice"))) { 663 // BGMã®ä¸æ 664 suspendBgm(); 665 666 playingVoiceData = $(this).data("voice"); 667 let filePath = "sound/voice/" + $(this).data("voice") + ".mp3"; 668 voicePlayer = new Howl({ 669 src: [filePath], 670 volume: voiceVol, 671 onend: function() { 672 voicePlayer.unload(); 673 674 // BGMã®åé 675 resumeBgm(); 676 } 677 }); 678 voicePlayer.play(); 679 } 680 else { 681 // BGMã®åé 682 resumeBgm(); 683 } 684}); 685 686/* -------------------------------------------------------------------------------- 687 ScrollTriggerã®åæå 688-------------------------------------------------------------------------------- */ 689function initScrollTrigger() { 690 // data-scrollã«onceãä»ãã 691 if (isSP() && !isLandscape()) { 692 $('[data-scroll]').each(function(i) { 693 $(this).attr('data-scroll', 'once offset(0, 400px)'); 694 }); 695 } 696 else { 697 $('[data-scroll]').each(function(i) { 698 $(this).attr('data-scroll', 'once'); 699 }); 700 } 701 702 scrollTrigger = new ScrollTrigger(); 703 704 if ($(window).scrollTop() == 0) { 705 $('.visible').each(function(i) { 706 $(this).addClass("first_view"); 707 }); 708 } 709} 710 711/* -------------------------------------------------------------------------------- 712 Colorboxã®åæå 713-------------------------------------------------------------------------------- */ 714function initColorBox() { 715 // ã¹ãããªããã£ã©ã¯ã¿ã¼ãã¼ã¸ã®ã¯ã©ã¹ãã¹ããåãã«æ¸ãæãã 716 if ($('.character_list').length && isSP()) { 717 // console.log("SP"); 718 $('.character_list .popup').each(function(i) { 719 $(this).removeClass("popup"); 720 $(this).addClass("popup-chara"); 721 }); 722 } 723 724 $('.popup').colorbox({ 725 maxWidth: "80%", 726 maxHeight: "80%", 727 transition: "fade", 728 speed: 400, 729 scrolling: false, 730 fixed: true, 731 opacity: 0.75, 732 overlayClose: true, 733 }); 734 735 $('.popup-movie').colorbox({ 736 iframe: true, 737 maxWidth: "90%", 738 maxHeight: "90%", 739 transition: "fade", 740 speed: 400, 741 scrolling: false, 742 fixed: true, 743 opacity: 0.75, 744 overlayClose: true, 745 innerWidth: "950px", 746 innerHeight: "534px", 747 }); 748 749 $('.popup-chara').colorbox({ 750 maxWidth: "100%", 751 maxHeight: "100%", 752 transition: "fade", 753 speed: 400, 754 // scrolling: false, 755 fixed: true, 756 opacity: 0.75, 757 overlayClose: true, 758 }); 759 760 $('.popup-inline').colorbox({ 761 inline: true, 762 maxWidth: "80%", 763 maxHeight: "80%", 764 transition: "fade", 765 speed: 400, 766 scrolling: false, 767 fixed: true, 768 opacity: 0.75, 769 overlayClose: true, 770 }); 771 772 $('.popup-information').colorbox({ 773 inline: true, 774 maxWidth: "100%", 775 maxHeight: "100%", 776 transition: "fade", 777 speed: 400, 778 // scrolling: false, 779 fixed: true, 780 opacity: 0.75, 781 overlayClose: true, 782 }); 783 784 // ãç¥ãã/ãããæ å ±ãã¿ã³(ããã¼) 785 $('body').on('click', '.popup-information', function(e) { 786 e.preventDefault(); 787 popupInformation = true; 788 789 $("body").addClass("information"); 790 }); 791} 792 793 794 795$(document).on('visibilitychange', function() { 796 if (bgmPlayer != null && bgmPlayer.playing()) 797 { 798 if (document.visibilityState == "visible") { 799 // BGMã®åé 800 resumeBgm(); 801 } 802 else if (document.visibilityState == "hidden") { 803 // BGMã®ä¸æ 804 suspendBgm(); 805 } 806 } 807}); 808 809// $(document).on('cbox_open', function() { 810// console.log("cbox_open"); 811// // åç»ã®ãããã¢ããã®å ´å 812// if ($(".cboxIframe").length) { 813// if (bgmPlayer != null && bgmPlayer.playing()) { 814// setTimeout(function() { 815// // BGMã®ä¸æ 816// suspendBgm();
817// }, 100); 818// } 819// if (voicePlayer != null && voicePlayer.playing()) { 820// setTimeout(function() { 821// voicePlayer.fade(voicePlayer.volume(), 0, 600); 822// }, 100); 823// } 824// } 825// }); 826 827let popupCharId = null; 828let popupCharMedia = false; 829let popupInformation = false; 830$(document).on("cbox_complete", function() { 831 832 // if ($('#cboxLoadedContent iframe').length) { 833 // // BGMã®ä¸æ 834 // suspendBgm(); 835 // } 836 837 if ($(".character-popup-container").length) { 838 let scale = 1; 839 let left = 0; 840 let top = 0; 841 if (isSP()) { 842 let width = 629; 843 let height = 1193 + 10 + $('.character-popup-container .sns-wrapper').outerHeight(true); 844 if (scale < $("#colorbox").width() / width) { 845 scale = $("#colorbox").width() / width; 846 } 847 // $(".sns-wrapper").css({ 848 // 'width': 'calc(100% / ' + scale + ')', 849 // }); 850 } 851 else { 852 let width = 1093; 853 let height = 629 + 10 + $('.character-popup-container .sns-wrapper').outerHeight(true); 854 if (scale > $("#colorbox").width() / width) { 855 scale = $("#colorbox").width() / width; 856 } 857 if (scale > $("#colorbox").height() / height) { 858 scale = $("#colorbox").height() / height; 859 } 860 left = ($("#colorbox").width() - $(".character-popup-container").width() * scale) / 2; 861 top = ($("#colorbox").height() - $(".character-popup-container").height() * scale) / 2; 862 // console.log("w:" + $("#colorbox").width() + " w:" + $(".character-popup-container").width());
863 // console.log("h:" + $("#colorbox").height() + " h:" + $(".character-popup-container").height()); 864 } 865 $(".character-popup-container").css({ 866 'transform': 'scale(' + scale + ',' + scale + ')', 867 'margin-left': '' + left + 'px', 868 'margin-top': '' + top + 'px', 869 }); 870 } 871 872 // ãã£ã©ã¯ã¿ã¼ã®ãããã¢ããæ 873 if ($(".character-popup-container").length) { 874 // $(".character-popup-container").removeClass("invisible"); 875 // $(".character-popup-container").addClass("visible"); 876 877 // SNSã«ã¼ãã®å¤æ´ 878 originalOgpImage = $('meta[name="twitter:image"]').attr("content"); 879 let charaId = $(".sns-wrapper.character").data("sns"); 880 // let url = "https://disgaea.jp/7/img/character/ogp_" + charaId + ".jpg" 881 // $('meta[name="twitter:image"]').attr("content", url); 882 // $('meta[property="og:image"]').attr("content", url); 883 popupCharId = charaId; 884 885 initColorBox(); 886 initCharacterPopup(); 887 888 $("body").addClass("detail"); 889 } 890 else if (popupCharId != null) { 891 popupCharMedia = true; 892 $("body").removeClass("detail"); 893 } 894 895}); 896 897// ãã£ã©ã¯ã¿ã¼ã®è©³ç´°ãã¼ã¸ã®ãããã¢ãã 898// $('body').on('click', '.character-popup-container .popup', function(e) { 899 900// $.colorbox.close(); 901// return false; 902// }); 903 904$(document).on("cbox_cleanup", function() { 905 // console.log("cbox_cleanup"); 906 907 // ãã£ã©ã¯ã¿ã¼ã®ãããã¢ããçµäºæ 908 if ($(".character_detail-wrapper").length && popupCharMedia == false) { 909 // SNSã«ã¼ãã®å¤æ´ 910 $('meta[name="twitter:image"]').attr("content", originalOgpImage); 911 $('meta[property="og:image"]').attr("content", originalOgpImage); 912 } 913 914 if (voicePlayer != null && voicePlayer.playing()) { 915 voicePlayer.fade(voicePlayer.volume(), 0, 400); 916 } 917}); 918 919$(document).on("cbox_closed", function() { 920 // console.log("cbox_closed"); 921 // if(playingVoice != "") { 922 // se[playingVoice].stop(); 923 // } 924 $(".serif button.stop").removeClass("stop"); 925 // BGMã®åé 926 resumeBgm(); 927 928 if (popupCharMedia == true) { 929 $('.character_list .' + popupCharId + ' a').click(); 930 popupCharMedia = false; 931 } 932 else { $("body").removeClass("detail"); } 933 934 //ãããã/ãããæ å ±ãéããããããã©ã°off,class remove 935 if (popupInformation == true) { 936 popupInformation = false; 937 $("body").removeClass("information"); 938 } 939}); 940 941/* -------------------------------------------------------------------------------- 942 IEå¤å® 943-------------------------------------------------------------------------------- */ 944function isIE() { 945 let userAgent = window.navigator.userAgent.toLowerCase(); 946 return userAgent.indexOf("msie") != -1 || userAgent.indexOf("trident") != -1; 947} 948 949/* -------------------------------------------------------------------------------- 950 MacOSå¤å® 951-------------------------------------------------------------------------------- */ 952function isMacOS() { 953 let userAgent = window.navigator.userAgent.toLowerCase(); 954 return userAgent.indexOf("mac") != -1; 955} 956 957/* -------------------------------------------------------------------------------- 958 ã¹ããå¤å® 959-------------------------------------------------------------------------------- */ 960function isSP() { 961 return window.matchMedia( "(max-width: 960px)" ).matches; 962} 963 964/* -------------------------------------------------------------------------------- 965 横åãå¤å® 966-------------------------------------------------------------------------------- */ 967function isLandscape() { 968 return window.matchMedia( "(orientation: landscape)" ).matches; 969} 970 971/* -------------------------------------------------------------------------------- 972 ãã¼ãã£ã¯ã« 973-------------------------------------------------------------------------------- */ 974function initParticle() { 975 976 var canvas = document.getElementById("particles"); 977 var ctx = canvas.getContext("2d"); 978 var particleCnt = 10; // æç»ããç»åã®æ° 979 var infoArray = []; // ãã¼ãã£ã¯ã«ã®æ å ±ãæ ¼ç´ 980 var cvsWidth = $(window).innerWidth(); // canvasã®å¹ 981 var cvsHeight = $(window).innerHeight(); // canvasã®é«ã
982 var imgWidth = 19; // ç»åã®åºæ¬ãµã¤ãºæ¨ªå¹ 983 var imgHeight = 13; // ç»åã®åºæ¬ãµã¤ãºç«å¹ 984 var aspectMax = 1.5; // ã¢ã¹ãã¯ãæ¯è¨ç®æã®æå¤§å¤ 985 var aspectMin = 0.5; // ã¢ã¹ãã¯ãæ¯è¨ç®æã®æå°å¤ 986 var speedMax = 3; // è½ä¸éåº¦ã®æå¤§å¤ 987 var speedMin = 1; // è½ä¸éåº¦ã®æå°å¤ 988 var angleAdd = 2; // ç»åè§åº¦ã¸ã®å ç®å¤ 989 var delayMax = 600; // æå¤§é å»¶æé 990 const rad = Math.PI / 180; 991 let pathfix = ""; 992 if(location.href.match(/topics/)){ 993 pathfix = "../../"; 994 } 995 $('canvas').attr('width', cvsWidth); 996 $('canvas').attr('height', cvsHeight); 997 998 // var petal = "petal_0"; 999 // if ($.cookie(cookiePath + "petal")) { 1000 // petal = $.cookie(cookiePath + "petal"); 1001 // if (petal == "petal_0") { petal = "petal_1"; } 1002 // else { petal = "petal_0"; } 1003 // } 1004 // $.cookie(cookiePath + "petal", petal, { path: "/" }) 1005 let petal = "petal_1"; 1006 1007 // ç»åã®èªã¿è¾¼ã¿ 1008 var img = new Image(); 1009 img.src = pathfix +"./img/" + petal + ".png"; 1010 img.onload = init(); 1011 1012 // ãã¼ãã£ã¯ã«ã®ãã©ã¡ã¼ã¿ãçæ 1013 function generateParam() { 1014 // ç»åãµã¤ãºã«æããã¢ã¹ãã¯ãæ¯ã0.5~1.5åã§ã©ã³ãã ã§çæ 1015 let aspect = Math.random() * (aspectMax - aspectMin) + aspectMin; 1016 1017 return { 1018 "x": Math.random() * cvsWidth, // åæè¡¨ç¤ºä½ç½®x 1019 "y": -imgHeight, // åæè¡¨ç¤ºä½ç½®y 1020 "w": imgWidth * aspect, // ç»åã®æ¨ªå¹ 1021 "h": imgHeight * aspect, // ç»åã®ç¸¦å¹ 1022 "speed": Math.random() * (speedMax - speedMin) + speedMin, // ç»åãè½ã¡ã¦ããé度 1023 "angle": Math.random() * 360, // è§åº¦ 1024 "dir": Math.random() * 60 + 60, // ç§»åæ¹å 1025 "delay": Math.random() * delayMax, // é å»¶æé 1026 }; 1027 } 1028 1029 // ãã¼ãã£ã¯ã«ã®åæå 1030 function init() { 1031 for (let i = 0; i < particleCnt; i++) { 1032 infoArray.push(generateParam()); 1033 } 1034 1035 // setInterval(update, 10); 1036 update(); 1037 } 1038 1039 1040 // ãã¼ãã£ã¯ã«ã®æ´æ° 1041 function update () { 1042 ctx.clearRect(0, 0, cvsWidth, cvsHeight); 1043 for (let i = 0; i < particleCnt; i++) { 1044 if (infoArray[i].delay > 0) { 1045 infoArray[i].delay--; 1046 continue; 1047 } 1048 1049 infoArray[i].x += Math.cos(infoArray[i].dir * rad) * infoArray[i].speed; 1050 infoArray[i].y += Math.sin(infoArray[i].dir * rad) * infoArray[i].speed; 1051 infoArray[i].angle += Math.random()*angleAdd; 1052 let cos = Math.cos(infoArray[i].angle * rad); 1053 let sin = Math.sin(infoArray[i].angle * rad); 1054 ctx.setTransform(cos, sin, sin, cos, infoArray[i].x, infoArray[i].y); 1055 ctx.drawImage(img, 0, 0 , infoArray[i].w , infoArray[i].h); 1056 ctx.setTransform(1, 0, 0, 1, 0, 0); 1057 // console.log("i:" + i + " x:" + infoArray[i].x + " y:" + infoArray[i].y); 1058 1059 // ç¯å²å¤ã«æç»ãããç»åãä¸ã«æ»ã 1060 if (infoArray[i].x < -infoArray[i].w || 1061 infoArray[i].x >= cvsWidth + infoArray[i].w || 1062 infoArray[i].y >= cvsHeight + infoArray[i].h) { 1063 infoArray[i] = generateParam(); 1064 } 1065 } 1066 1067 requestAnimationFrame(update) 1068 } 1069} 1070 1071/* -------------------------------------------------------------------------------- 1072 URLã®GETãã©ã¡ã¼ã¿ãåå¾ãã 1073-------------------------------------------------------------------------------- */ 1074function getParam(url, name) { 1075 name = name.replace(/[\[\]]/g, "\\$&"); 1076 let regex = new RegExp("[?&]" + name + "(=([^&#]*)|&|#|$)"), 1077 results = regex.exec(url); 1078 if (!results) return null; 1079 if (!results[2]) return ''; 1080 return decodeURIComponent(results[2].replace(/\+/g, " ")); 1081} 1082 1083/* -------------------------------------------------------------------------------- 1084 ãµããã¼ã¸ãã©ã¡ã¼ã¿ã®åå¾ 1085-------------------------------------------------------------------------------- */ 1086function getSubPageParam(url) { 1087 let file = url.substring(0, url.indexOf(".")); 1088 let page = getParam(url, "page"); 1089 let subCategory = ""; 1090 let end = -1; 1091 if (url.indexOf("_") != -1 && url.indexOf("_") < url.indexOf(".")) { 1092 end = url.indexOf("_"); 1093 subCategory = url.substring(end + 1, url.indexOf(".")); 1094 } 1095 else { end = url.indexOf("."); } 1096 let category = "top"; 1097 if (end > 0) { category = url.substring(0, end); } 1098 else if (location.href.indexOf("topics/") != -1) { category = "topics"; } 1099 1100 return [file, category, subCategory, page]; 1101} 1102 1103/* -------------------------------------------------------------------------------- 1104 ãµããã¼ã¸ã®åæå 1105-------------------------------------------------------------------------------- */ 1106function initSubPage(url) { 1107 initScrollTrigger(); 1108 initSwiper(); 1109 initColorBox(); 1110 1111 1112 // ããã²ã¼ã·ã§ã³ã®æ´æ° 1113 updateNav(url); 1114} 1115 1116/* -------------------------------------------------------------------------------- 1117 ãµããã¼ã¸ã®æ´æ° 1118-------------------------------------------------------------------------------- */ 1119function updateSubPage(url, updateHistory) { 1120 let [file, category, subCategory, page] = getSubPageParam(url); 1121 // alert("category:" + category + " subCategory:" + subCategory + " page:" + page); 1122 $.ajax({
1123 type: "GET", 1124 dataType: "text", 1125 url: "inc/" + category + "/" + subCategory + "/" + page + ".html", 1126 cache: false 1127 }) 1128 .done(function(data) { 1129 $('#content').empty(); 1130 $('#content').append(data); 1131 1132 initSubPage(url); 1133 1134 // ããã·ã¥ã§ç§»åå ãæç¥ããããã¼ã¸è¡¨ç¤ºåã«ã¹ã¯ãã¼ã«ããã¦ãã 1135 let hash = location.hash.replace("#",""); 1136 let scrollTarget = document.getElementById(hash); 1137 if(scrollTarget) { 1138 window.scrollTo(0, scrollTarget.offsetTop - 20); 1139 } 1140 else { 1141 window.scrollTo(0, 0); 1142 } 1143 1144 // å±¥æ´ã追å 1145 if (updateHistory) { 1146 if (window.history && window.history.pushState) { 1147 history.pushState({ data: data }, null, file + ".html?page=" + page); 1148 // console.log(file + ".html?page=" + page); 1149 } 1150 } 1151 1152 // setTimeout(function() { 1153 $('#content').removeClass("hidden"); 1154 // $('article .glnav-sub-container').removeClass("hidden"); 1155 $('.footer-wrapper').removeClass("hidden"); 1156 // }, 100); 1157 }) 1158 .fail(function() { 1159 console.log("ajax error."); 1160 }); 1161} 1162 1163/* -------------------------------------------------------------------------------- 1164 ããã²ã¼ã·ã§ã³ã®æ´æ° 1165-------------------------------------------------------------------------------- */ 1166function updateNav(url) { 1167 if (url == null) { return; } 1168 //ããã·ã¥æ´å½¢ 1169 let hash = location.hash; 1170 url = url.replace(hash,""); 1171 1172 let [file, category, subCategory, page] = getSubPageParam(url); 1173 //console.log("category:" + category + " url:" + url + " file:" + file); 1174 if(file == '' && category != 'top') { return; } 1175 1176 1177 // ã°ãã¼ãã«ããã²ã¼ã·ã§ã³ 1178 $('.glnav-item').each(function(i) { 1179 if ($(this).hasClass(category)) { $(this).addClass("selected"); } 1180 else { $(this).removeClass("selected"); } 1181 }); 1182 1183 // ã°ãã¼ãã«ãµãããã²ã¼ã·ã§ã³ 1184 let obj = null; 1185 let find = false; 1186 $('.glnav-sub-item').each(function(i) { 1187 let href = $(this).find('a').attr("href"); 1188 let [file_, category_, subCategory_, page_] = getSubPageParam(href); 1189 if (file == file_) { $(this).addClass("selected"); find = true; } 1190 else { $(this).removeClass("selected"); } 1191 1192 if (obj == null && file == file_) { obj = $(this); } 1193 }); 1194 if (find == false && obj != null) { obj.addClass("selected"); } 1195 1196 // ãµãããã²ã¼ã·ã§ã³ 1197 obj = null; 1198 find = false; 1199 $('.sub-nav-item').each(function(i) { 1200 let href = $(this).find('a').attr("href"); 1201 // console.log("href:" + href + ", url:" + url); 1202 if (href == url) { $(this).addClass("selected"); find = true; } 1203 else { $(this).removeClass("selected"); } 1204 1205 let [file_, category_, subCategory_, page_] = getSubPageParam(href); 1206 if (obj == null && file == file_) { obj = $(this); } 1207 }); 1208 if (find == false && obj != null) { obj.addClass("selected"); } 1209} 1210 1211/* -------------------------------------------------------------------------------- 1212 ããããã¼ã¸ã®åæå 1213-------------------------------------------------------------------------------- */ 1214function initTopPage() { 1215 // ãµãã¾ãéã 1216 setTimeout(function() { 1217 $('.sliding_screen-left').addClass("open"); 1218 $('.sliding_screen-right').addClass("open"); 1219 }, 750); 1220 1221 $('.sliding_screen-left').on('transitionend', function() { 1222 // ã¹ã¯ãã¼ã«ã§ããããã«ãã¦ãã 1223 $('.wrapper').addClass("show"); 1224 1225 // ãµãã¾ã®ã¢ãã¡ã¼ã·ã§ã³ã0ç§ã«å¤æ´ 1226 $('.sliding_screen-left').addClass("end"); 1227 $('.sliding_screen-right').addClass("end"); 1228 1229 // ã¹ã¯ãã¼ã«å¯è½ã«å¤æ´ 1230 $('body').addClass("no_fixed"); 1231 }); 1232 1233 // ã¢ãã¡ã¼ã·ã§ã³ 1234 $('.sliding_screen-left').on('transitionend', function() { 1235 1236 // ã¿ã¤ãã«ãã´ 1237 setTimeout(function() { 1238 $('.logo').addClass("show"); 1239 }, 200); 1240 1241 // çºå£²æ¥ 1242 setTimeout(function() { 1243 $('.release').addClass("show"); 1244 }, 1000); 1245 1246 // PV 1247 setTimeout(function() { 1248 $('.pv').addClass("show"); 1249 }, 1200); 1250 1251 // ãäºç´åä»ä¸ï¼ 1252 setTimeout(function() { 1253 $('.store_link').addClass("show"); 1254 }, 1500); 1255 }); 1256 1257 // ããã¼ã®ã¢ãã¡ã¼ã·ã§ã³ 1258 $('.logo').on('animationend', function() { 1259 $('.banner-container').each(function(i) { 1260 $(this).delay(50 * i).queue(function() { 1261 $(this).addClass("show"); 1262 }); 1263 }); 1264 $('.review').addClass("show"); 1265 $('.arrival_5').addClass("show"); 1266 1267 setTimeout(function() { 1268 $('.top-movie-container').addClass("show"); 1269 $('.catch_copy.left').addClass("hidden");
1270 $('.catch_copy.right').addClass("hidden"); 1271 }, 2000); 1272 }); 1273} 1274 1275/* -------------------------------------------------------------------------------- 1276 DLCæ å ±ãã¼ã¸ã®åæå 1277-------------------------------------------------------------------------------- */ 1278function initDLCPage() { 1279 setTimeout(function() { 1280 $('.section-banner .banner-container').each(function(i) { 1281 $(this).delay(50 * i).queue(function() { 1282 $(this).addClass("show"); 1283 }); 1284 }); 1285 }, 500); 1286} 1287 1288/* -------------------------------------------------------------------------------- 1289 ãã£ã©ã¯ã¿ã¼ãã¼ã¸ã®ãããã¢ããã®åæå 1290-------------------------------------------------------------------------------- */ 1291function initCharacterPopup() { 1292 // 飿²« 1293 setTimeout(function() { 1294 $('.character_detail-bg-paint').addClass("show"); 1295 }, 300); 1296 1297 // ãã£ã©ã¯ã¿ã¼ 1298 setTimeout(function() { 1299 $('.character_detail-image').addClass("show"); 1300 }, 500); 1301 1302 // å°è© 1303 setTimeout(function() { 1304 $('.character_detail-wards').addClass("show"); 1305 }, 800); 1306 1307 // ã«ããã¤ã³ 1308 // setTimeout(function() { 1309 // $('.character_detail-bg-cutin').addClass("show"); 1310 // }, 1200); 1311}
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.