1$(document).ready(function () { 2 setupMoveToInnerLink(); 3 goToTop(); 4 toggleAccordion(); 5 togglePcGlobalMenu(); 6 toggleSpGlobalMenu(); 7 switchTextSize(); 8 setupTopSlider(); 9 toggleSpLink(); 10 createChartDom(); 11 loadCharts(); 12 clickTopCatButton('topics'); 13 clickTopCatButton('news'); 14 changeSiteColor(); 15 openArchiveFilter(); 16}); 17 18// ã¹ããæã«ã¢ã¼ã«ã¤ãã®çµè¾¼ã¿ã¢ã³ã¼ãã£ãªã³ãæãããã 19function openArchiveFilter() { 20 const filter = $('.archive-filter'); 21 if (filter && window.innerWidth >= 768) { 22 filter.attr('open', 'true'); 23 } 24} 25 26function changeSiteColor() { 27 $('#inverse-btn-white').accessible_inverse(); 28 $('#inverse-btn-black').accessible_inverse({ 29 inverse_class: 'black' 30 }); 31 $('#inverse-btn-blue').accessible_inverse({ 32 inverse_class: 'blue' 33 }); 34 $('#inverse-btn-yellow').accessible_inverse({ 35 inverse_class: 'yellow' 36 }); 37 38 $('.gcse-searchbox-only').removeClass('inverse-default inverse-black inverse-blue inverse-yellow'); 39 $('.gcse-searchresults-only').removeClass('inverse-default inverse-black inverse-blue inverse-yellow'); 40} 41 42// ããããã¼ã¸ã®è¨äºä¸è¦§ã«ãã´ãªåæ¿æã«ã¯ã©ã¹ä»ä¸ 43function clickTopCatButton(target) { 44 const labels = $(`.${target}-label label`); 45 if (!labels || labels.length < 1) return; 46 47 $.each(labels, function (index, item) { 48 // åæè¡¨ç¤ºæã¯'xxx-all'ãactive 49 if ($(item).attr('for') === `${target}-all`) { 50 $(item).addClass('active'); 51 } 52 53 $(item).click(function () { toggleTopCategoryButton(this) }); 54 }) 55 56 function toggleTopCategoryButton(label) { 57 // å ¨ã©ãã«ã®activeã¯ã©ã¹åé¤ 58 $.each(labels, function (index, item) { 59 $(item).removeClass('active'); 60 }) 61 // 対象ã©ãã«ã¸activeã¯ã©ã¹ä»ä¸ 62 $(label).addClass('active'); 63 } 64} 65 66 67// ãã¼ã¸å ãªã³ã¯ 68function setupMoveToInnerLink() { 69 $('a[href^="#"]') 70 .not('a[href^="#modal_menu"]') 71 .click(function () { 72 return moveToInnerLink($(this).attr('href')); 73 }); 74 const hash = location.hash; 75 if (hash) { 76 return moveToInnerLink(hash); 77 } 78} 79 80function moveToInnerLink(href) { 81 const target = $(href == '#' || href == '' ? 'html' : href); 82 const position = target.offset().top; 83 $('html, body').animate( 84 { 85 scrollTop: position, 86 }, 87 500, 88 'swing' 89 ); 90 return false; 91} 92 93function goToTop() { 94 const topBtn = $('#pagetop'); 95 topBtn.hide(); 96 //ã¹ã¯ãã¼ã«ã200ã«éããããã¿ã³è¡¨ç¤º 97 $(window).scroll(function () { 98 if ($(this).stop().scrollTop() > 200) { 99 topBtn.fadeIn(); 100 } else { 101 topBtn.fadeOut(); 102 } 103 }); 104 //ã¹ã¯ãã¼ã«ãã¦ããã 105 topBtn.click(function () { 106 $('body,html').stop().animate( 107 { 108 scrollTop: 0, 109 }, 110 500 111 ); 112 return false; 113 }); 114} 115 116// ã¢ã³ã¼ãã£ãªã³UIã®éé 117function toggleAccordion() { 118 $(document).ready(function () { 119 $(".accordion, .accordion-dl dt").on("click", function () { 120 $(this).toggleClass("active"); 121 $(this).next().slideToggle(); 122 }); 123 }); 124} 125 126// PCã¬ã¤ã¢ã¦ã ã°ãã¼ãã«ã¡ãã¥ã¼éé 127function togglePcGlobalMenu() { 128 // ã°ãã¼ãã«ã¡ãã¥ã¼hoverè¡¨ç¤ºåæ¿ 129 $('.global-menu li').each(function () { 130 let $childTarget = $('ul[data-parent_id="' + $(this).data('id') + '"]'); 131 if ($childTarget.length) { 132 $(this).on('mouseover', function () { 133 $(this).closest('ul').addClass('is-active'); 134 $childTarget.addClass('is-active'); 135 $('#menu:hover .menu-box').css('width', '840px'); 136 }).on("mouseleave", function () { 137 $(this).closest('ul').removeClass('is-active'); 138 $childTarget.removeClass('is-active'); 139 $('#menu:hover .menu-box').css('width', ''); 140 }); 141 } 142 let $parentTarget = $('li[data-id="' + $(this).closest('ul').data('parent_id') + '"]').closest('ul'); 143 $(this).on('mouseover', function () { 144 $(this).addClass('is-active'); 145 $parentTarget.addClass('is-active'); 146 $('#menu:hover .menu-box').css('width', '840px'); 147 }).on("mouseleave", function () { 148 if ($parentTarget.length) { 149 $parentTarget.addClass('is-active'); 150 $('#menu:hover .menu-box').css('width', '840px'); 151 } else { 152 $(this).removeClass('is-active'); 153 $parentTarget.removeClass('is-active'); 154 $('#menu:hover .menu-box').css('width', ''); 155 } 156 }); 157 }); 158 $('.global-menu ul').each(function () { 159 let $parentTarget = $('li[data-id="' + $(this).closest('ul').data('parent_id') + '"]').closest('ul'); 160 $(this).on('mouseover', function () { 161 $(this).addClass('is-active'); 162 $parentTarget.addClass('is-active'); 163 $('#menu:hover .menu-box').css('width', '840px'); 164 }).on("mouseleave", function () { 165 $(this).removeClass('is-active'); 166 $parentTarget.removeClass('is-active'); 167 $('#menu:hover .menu-box').css('width', ''); 168 }); 169 }); 170} 171 172// SPã¬ã¤ã¢ã¦ã ã°ãã¼ãã«ã¡ãã¥ã¼éé 173function toggleSpGlobalMenu() { 174 //ãã³ãã¼ã¬ã¼ã¡ãã¥ã¼ 175 //夿°å®ç¾© 176 let navigationOpenFlag = false;
177 let navButtonFlag = true; 178 let focusFlag = false; 179 180 $(document).on('click', '.el_humburger', function () { 181 if (navButtonFlag) { 182 spNavInOut.switch(); 183 //䏿çã«ãã¿ã³ãæ¼ããªããã 184 setTimeout(function () { 185 navButtonFlag = true; 186 }, 200); 187 navButtonFlag = false; 188 } 189 }); 190 $(document).on('click', function (event) { 191 if (!$(event.target).closest('.bl_header,.el_humburger').length && $('body').hasClass('js_humburgerOpen') && focusFlag) { 192 focusFlag = false; 193 //scrollBlocker(false); 194 spNavInOut.switch(); 195 } 196 }); 197 198 //ããéãå¦ç 199 function spNavIn() { 200 $('body').removeClass('js_humburgerClose'); 201 $('body').addClass('js_humburgerOpen'); 202 setTimeout(function () { 203 focusFlag = true; 204 }, 200); 205 setTimeout(function () { 206 navigationOpenFlag = true; 207 }, 200); 208 } 209 210 //ããéããå¦ç 211 function spNavOut() { 212 $('body').removeClass('js_humburgerOpen'); 213 $('body').addClass('js_humburgerClose'); 214 setTimeout(function () { 215 $(".uq_spNavi").removeClass("js_appear"); 216 focusFlag = false; 217 }, 200); 218 navigationOpenFlag = false; 219 } 220 221 //ããééã³ã³ããã¼ã« 222 const spNavInOut = { 223 switch: function () { 224 if ($('body.spNavFreez').length) { 225 return false; 226 } 227 if ($('body').hasClass('js_humburgerOpen')) { 228 spNavOut(); 229 } else { 230 spNavIn(); 231 } 232 } 233 }; 234
235 $('.global-menu-toggle').each(function () { 236 $(this).on('click', function (e) { 237 let $toggle = $(this); 238 if ($toggle.hasClass('global-menu-toggle-active')) { 239 $toggle.next().stop().slideUp('normal', function () { 240 $(this).remove(); 241 }); 242 $toggle.removeClass('global-menu-toggle-active'); 243 } else { 244 let id = $(this).closest('li').data('id'); 245 let $target = $('ul[data-parent_id="' + id + '"]').clone(true, true); 246 if ($target.length) { 247 $toggle.closest('li').append($target); 248 $toggle.next().stop().slideDown(); 249 $toggle.addClass('global-menu-toggle-active'); 250 } 251 } 252 e.stopPropagation(); 253 }); 254 }); 255 256 $('.menu-select > div').each(function () { 257 $(this).on('click', function (e) { 258 e.stopPropagation(); 259 }); 260 }); 261 262 263 $('.research-box').each(function () { 264 $(this).on('click', function (e) { 265 e.stopPropagation(); 266 }); 267 }); 268 269 $('.gsc-input').each(function () { 270 $(this).on('click', function (e) { 271 e.stopPropagation(); 272 }); 273 }); 274} 275 276 277// ã¹ãã ããããã¼ã¸ ãã°ã«ã¡ãã¥ã¼éé 278function toggleSpLink() { 279 $(".clicktoggle").on("click", function () { 280 $(this).toggleClass("open"); 281 $(this).next().slideToggle(); 282 }); 283 $(".hovertoggle").on("mouseover", function () { 284 $(this).toggleClass("open"); 285 $(this).next().slideToggle(); 286 }); 287} 288 289// æåãµã¤ãºåæ¿ 290function switchTextSize() { 291 $('#fzS').click(function () { 292 $('html').css('font-size', '53.125%'); 293 }); 294 $('#fzM').click(function () { 295 $('html').css('font-size', '62.5%'); 296 }); 297 $('#fzL').click(function () { 298 $('html').css('font-size', '87.5%'); 299 }); 300} 301 302// ããããã¼ã¸ã®ã¢ã¤ãã£ããã¹ã©ã¤ãã¼ã®å¶å¾¡ 303function setupTopSlider() { 304 $('#eyecatch').slick({ 305 autoplay: true, 306 // arrows: false, 307 prevArrow: '<i class="fas fa-chevron-left"></i>', 308 nextArrow: '<i class="fas fa-chevron-right"></i>', 309 dots: true, 310 fade: true, 311 speed: 500, 312 }); 313 314 $('.top-events-box').slick({ 315 autoplay: true, 316 autoplaySpeed: 4000, 317 slidesToShow: 2, 318 centerMode: true, 319 centerPadding: '15%', 320 responsive: [ 321 { 322 breakpoint: 1700, 323 settings: { 324 slidesToShow: 1, 325 centerPadding: '30%', 326 } 327 }, 328 { 329 breakpoint: 1500, 330 settings: { 331 slidesToShow: 1, 332 centerPadding: '20%', 333 } 334 }, 335 { 336 breakpoint: 768, 337 settings: { 338 slidesToShow: 1, 339 centerPadding: '10%', 340 } 341 }, 342 { 343 breakpoint: 640, 344 settings: { 345 slidesToShow: 1, 346 centerPadding: '13%', 347 } 348 } 349 ] 350 }); 351 $(window).on("resize orientationchange", function () { 352 $(".top-events-box").slick("resize"); 353 }); 354 355 $('.features').slick({ 356 autoplay: true, 357 centerMode: true, 358 centerPadding: '37%', 359 responsive: [ 360 { 361 breakpoint: 860, 362 settings: { 363 centerPadding: '30%', 364 } 365 }, 366 { 367 breakpoint: 480, 368 settings: { 369 centerPadding: '20%', 370 } 371 } 372 ] 373 }); 374} 375 376 377// åå¦é¨ãã¼ã¸ã®åã°ã©ãDOMã使 378function createChartDom() { 379 // 人æç¤¾ä¼ç§å¦é¨ 380 createChart( 381 '#humanity-chart', 382 { 383 'id': "chart", 384 'data-label_1': "å ¬åå¡", 385 'data-value_1': "70", 386 'data-label_2': "æ å ±éä¿¡", 387 'data-value_2': "29", 388 'data-label_3': "å¸ã»å°å£²", 389 'data-value_3': "28", 390 'data-label_other': "ãã®ä»", 391 'data-value_other': "113", 392 } 393 ); 394 395 // æè²å¦é¨ 396 createChart( 397 '#education-chart', 398 { 399 'id': "chart", 400 'data-label_1': "妿 ¡æè²", 401 'data-value_1': "122", 402 'data-label_2': "æ å ±éä¿¡", 403 'data-value_2': "5", 404 'data-label_3': "å ¬åå¡", 405 'data-value_3': "4", 406 'data-label_other': "ãã®ä»", 407 'data-value_other': "18", 408 } 409 ); 410 411 // å»å¦é¨ä¿å¥å¦ç§ 412 createChart( 413 '#health-chart', 414 { 415 'id': "chart", 416 'data-label_1': "å»çã»ç¦ç¥", 417 'data-value_1': "163", 418 'data-label_other': "ãã®ä»", 419 'data-value_other': "12", 420 } 421 ); 422 423 // å»å¦é¨å¿çæ¯æ´ç§å¦ç§ 424 createChart( 425 '#psychological-chart', 426 { 427 'id': "chart", 428 'data-label_1': "å ¬åå¡", 429 'data-value_1': "1", 430 'data-label_2': "建è¨", 431 'data-value_2': "1", 432 'data-label_3': "ãµã¼ãã¹", 433 'data-value_3': "1", 434 } 435 ); 436 437 // çå·¥å¦é¨ 438 createChart(
439 '#technology-chart', 440 { 441 'id': "chart", 442 'data-label_1': "æ å ±éä¿¡", 443 'data-value_1': "33", 444 'data-label_2': "å ¬åå¡", 445 'data-value_2': "31", 446 'data-label_3': "製é ", 447 'data-value_3': "29", 448 'data-label_other': "ãã®ä»", 449 'data-value_other': "64", 450 } 451 ); 452 453 // è¾²å¦çå½ç§å¦é¨ 454 createChart( 455 '#agriculture-chart', 456 { 457 'id': "chart", 458 'data-label_1': "å ¬åå¡", 459 'data-value_1': "27", 460 'data-label_2': "製é ", 461 'data-value_2': "22", 462 'data-label_3': "å¸ã»å°å£²", 463 'data-value_3': "12", 464 'data-label_other': "ãã®ä»", 465 'data-value_other': "63", 466 } 467 ); 468 469 function createChart(target, displayData) { 470 const $target = $(target); 471 if ($target) { 472 $('<canvas id="chart">').attr(displayData).appendTo($target); 473 } 474 } 475} 476 477 478// pie chartã®èªã¿è¾¼ã¿ 479function loadCharts() { 480 const $chart = $("#chart"); 481 if (!$chart.length) { 482 return; 483 } 484 485 let labels = []; 486 let values = []; 487 for (let i = 1; i <= 3; i++) { 488 if ($chart.data('label_' + i)) { 489 labels.push($chart.data('label_' + i)); 490 values.push($chart.data('value_' + i)); 491 } 492 } 493 // ãããä¿®æ£ï¼label_otherãåå¨ããå ´åã®ã¿pushãã 494 if ($chart.data('label_other')) { 495 labels.push($chart.data('label_other')); 496 values.push($chart.data('value_other')); 497 } 498 499 new Chart($chart.get()[0], { 500 type: 'pie', 501 data: { 502 labels: labels, 503 datasets: [{ 504 data: values, 505 backgroundColor: [ 506 "#284a68", 507 "#7090a8", 508 "#a1bcce", 509 "#bdc2c5" 510 ] 511 }] 512 }, 513 plugins: [ChartDataLabels], 514 options: { 515 plugins: { 516 legend: { 517 display: false 518 }, 519 datalabels: { 520 align: "end", 521 anchor: "end", 522 offset: -70, 523 color: '#fff', 524 font: { 525 size: 14, 526 }, 527 formatter: (value, ctx) => { 528 return ctx.chart.data.labels[ctx.dataIndex] + "\n" + value; 529 }, 530 } 531 } 532 } 533 }); 534}
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.