1;(function () { 2 'use strict'; 3 4 5 /* ------------------------------------------*/ 6 // randomOrder 7 /* ------------------------------------------*/ 8 // è¦ç´ ã®åºç¾é ãã©ã³ãã å 9 var randomOrder = function(parent, array) { 10 var rand = []; 11 var len = array.length; 12 13 for (var i = 0; i < len; i++) { 14 rand.push(i); 15 } 16 17 rand.sort(function() { 18 return Math.random() - Math.random(); 19 }); 20 21 for (var j = 0; j < len; j++) { 22 parent.appendChild(array[rand[j]]); 23 } 24 }; 25 26 27 /* ------------------------------------------*/ 28 // heroImages 29 /* ------------------------------------------*/ 30 // use: http://kenwheeler.github.io/slick/ 31 32 var heroImages = function() { 33 var parent = document.querySelector('[data-hero-image]'); 34 35 if (!parent) { return false; } 36 37 // ç»åãã¡ã¤ã«ã®ãã¹ãæå® 38 var imgsrc = { 39 'sp' : [ 40 '/top/images/img-hero-10th01-sp.png' 41 ], 42 'pc' : [ 43 '/top/images/img-hero-10th01-pc.png' 44 ] 45 }; 46 47 // è¦ç´ ã®è¿½å 48 var item = document.createElement('div'); 49 item.setAttribute('data-hero-iamge-item', 'true'); 50 51 var img = document.createElement('img'); 52 img.setAttribute('alt', ''); 53 54 var itemCln; 55 var imgClnSP; 56 var imgClnPC; 57 var fragment = document.createDocumentFragment(); 58 var len = imgsrc.sp.length; 59 var state = document.querySelector('[data-hero-image-state]'); 60 61 for (var i = 0; i < len; i++) { 62 imgClnSP = img.cloneNode(true); 63 imgClnPC = img.cloneNode(true); 64 65 imgClnSP.setAttribute('src', imgsrc.sp[i]); 66 imgClnPC.setAttribute('src', imgsrc.pc[i]); 67 68 imgClnSP.setAttribute('data-show-width', 'narrow'); 69 imgClnPC.setAttribute('data-show-width', 'medium'); 70 71 itemCln = item.cloneNode(true); 72 itemCln.appendChild(imgClnSP); 73 itemCln.appendChild(imgClnPC); 74 75 fragment.appendChild(itemCln); 76 } 77 78 parent.textContent = ''; 79 parent.appendChild(fragment); 80 81 // ã©ã³ãã 82 randomOrder(parent, parent.querySelectorAll('[data-hero-iamge-item]')); 83 84 // slick.js ã®è¨å® 85 $(parent).on('init', function() { 86 state.setAttribute('data-hero-image-state', 'loaded'); 87 }); 88 89 $(parent).slick({ 90 dots : false, 91 arrows : false, 92 infinite : true, 93 speed : 800, 94 fade : true, 95 autoplay : true, 96 autoplaySpeed : 5000, 97 pauseOnHover : false 98 }); 99 }; 100 document.addEventListener('DOMContentLoaded', function() { 101 heroImages(); 102 }, false); 103 104 105 /* ------------------------------------------*/ 106 // topBanner 107 /* ------------------------------------------*/ 108 // use: http://kenwheeler.github.io/slick/ 109 var topBanner = function() { 110 var banner = document.querySelector('[data-top-banner]'); 111 112 if (!banner) { return false; } 113 114 var bp = 767; 115 116 $(banner).slick({ 117 dots : false, 118 arrows : true, 119 prevArrow : '<button type="button" class="btn-slider-pager-square btn-slider-pager-square--prev" aria-label="Previous"></button>', 120 nextArrow : '<button type="button" class="btn-slider-pager-square btn-slider-pager-square--next" aria-label="Next"></button>', 121 infinite : false, 122 slidesToShow : 3, 123 slidesToScroll : 1, 124 speed : 400, 125 responsive : [ 126 { 127 breakpoint : bp, 128 settings : { 129 slidesToShow : 1 130 } 131 } 132 ] 133 }); 134 }; 135 136 document.addEventListener('DOMContentLoaded', function() { 137 topBanner(); 138 }, false); 139 140 141 /* ------------------------------------------*/ 142 // checkSlickInitialized 143 /* ------------------------------------------*/ 144 // slick ãè¨å®ããã¦ããã°ç ´æ£ 145 var checkSlickInitialized = function($elem) { 146 if ($elem.attr('data-slider-initialized') === 'true' ) { 147 $elem.slick('unslick'); 148 } 149 }; 150 151 152 /* ------------------------------------------*/ 153 // ReFa Journal 154 /* ------------------------------------------*/ 155 // use: http://kenwheeler.github.io/slick/ 156 var journalSlider = function() {
157 var $journal = $('[data-slider="journal"]'); 158 159 if ($journal.length < 1) { return false; } 160 161 var bp = 767; 162 163 if ((window.matchMedia('(max-width:' + (bp - 1) + 'px)').matches)) { 164 checkSlickInitialized($journal); 165 166 $journal.slick({ 167 responsive : [ 168 { 169 breakpoint : bp, 170 settings : { 171 dots : false, 172 arrows : true, 173 prevArrow : '<button type="button" class="btn-slider-pager-square btn-slider-pager-square--prev" aria-label="Previous"></button>', 174 nextArrow : '<button type="button" class="btn-slider-pager-square btn-slider-pager-square--next" aria-label="Next"></button>', 175 infinite : false, 176 slidesToShow : 1, 177 slidesToScroll : 1, 178 speed : 400 179 } 180 } 181 ] 182 }); 183 184 $journal.attr('data-slider-initialized', 'true'); 185 } else { 186 checkSlickInitialized($journal); 187 $journal.attr('data-slider-initialized', 'false'); 188 } 189 }; 190 191 var journalSliderInit = function() { 192 journalSlider(); 193 194 var resizeTimer = false; 195 196 window.addEventListener('resize', function() { 197 if (resizeTimer !== false) { 198 clearTimeout(resizeTimer); 199 } 200 201 resizeTimer = setTimeout(function() { 202 journalSlider(); 203 }, 200); 204 }, false); 205 }; 206 document.addEventListener('DOMContentLoaded', function() { 207 journalSliderInit(); 208 }, false); 209 window.addEventListener('orientationchange', function() { 210 journalSlider(); 211 }, false); 212 213 214 /* ------------------------------------------*/ 215 // Instagram 216 /* ------------------------------------------*/ 217 // use: http://kenwheeler.github.io/slick/ 218 var instagramSlider = function() { 219 var $instagram = $('[data-slider="instagram"]'); 220 221 if ($instagram.length < 1) { return false; } 222 223 var bp = 767; 224 225 if ((window.matchMedia('(max-width:' + (bp - 1) + 'px)').matches)) { 226 checkSlickInitialized($instagram); 227 228 $instagram.slick({ 229 responsive : [ 230 { 231 breakpoint : bp, 232 settings : { 233 dots : false, 234 arrows : true, 235 prevArrow : '<button type="button" class="btn-slider-pager-square btn-slider-pager-square--prev" aria-label="Previous"></button>', 236 nextArrow : '<button type="button" class="btn-slider-pager-square btn-slider-pager-square--next" aria-label="Next"></button>', 237 infinite : false, 238 slidesToShow : 1, 239 slidesToScroll : 1, 240 speed : 400 241 } 242 } 243 ] 244 }); 245 246 $instagram.attr('data-slider-initialized', 'true'); 247 } else { 248 checkSlickInitialized($instagram); 249 $instagram.attr('data-slider-initialized', 'false'); 250 } 251 }; 252 253 var instagramSliderInit = function() { 254 instagramSlider(); 255 256 var resizeTimer = false; 257 258 window.addEventListener('resize', function() { 259 if (resizeTimer !== false) { 260 clearTimeout(resizeTimer); 261 } 262 263 resizeTimer = setTimeout(function() { 264 instagramSlider(); 265 }, 200); 266 }, false); 267 }; 268 window.addEventListener('orientationchange', function() { 269 instagramSlider(); 270 }, false); 271 272 // Instagram API çµç±ã§åå¾ãã HTML ã XMLHttpRequest ã§åä¿¡ 273 var getInstagramPhotos = function() { 274 var container = document.querySelector('[data-instagram-container]'); 275 276 if (!container) { return false; } 277 278 var url = '/api/top_instagram.php'; 279 var xhr = new XMLHttpRequest(); 280 281 xhr.onreadystatechange = function() { 282 if (xhr.readyState === 4 && xhr.status === 200) { 283 var data = xhr.responseText; 284 container.innerHTML = data; 285 instagramSliderInit(); 286 } else if (xhr.status === 404) { 287 return; 288 } 289 }; 290 291 xhr.open('POST', url, true); 292 xhr.send(); 293 }; 294 document.addEventListener('DOMContentLoaded', function() { 295 getInstagramPhotos(); 296 }, false); 297})();
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.