1'use strict'; 2 3/** 4 * Oneplate 5 * init.js 6 * ver.202007200000 7 */ 8 9/** 10 * ããã¤ã¹å¶å¾¡ 11*/ 12var viewMode = { 13 set: function() { 14 var target = $('#container'); 15 var classList = 'pc-view tablet-view phone-view'; 16 17 // pc 18 if ($('#header #button_navi').css('display') === 'none') { 19 target.removeClass(classList).addClass('pc-view'); 20 21 // ã¹ãã 22 } else if ($('h2.page_title').css('margin-top') === '40px') { 23 target.removeClass(classList).addClass('phone-view'); 24 25 // ã¿ãã¬ãã 26 } else { 27 target.removeClass(classList).addClass('tablet-view'); 28 } 29 }, 30 31 get: function(classname) { 32 return $('#container').hasClass(classname); 33 } 34}; 35 36/** 37 * ãã©ã¦ã¶å¤å® 38*/ 39var browser = { 40 set: function() { 41 var u = window.navigator.userAgent.toLowerCase(); 42 43 // ie 44 if (u.match(/(MSIE|msie)/) || u.match(/(T|t)rident/) || u.match(/(E|e)dge/)) { 45 $('#container').addClass('ie'); 46 } 47 } 48}; 49 50/** 51 * headerå¶å¾¡ 52*/ 53var header = { 54 actFlag: false, 55 headerHeight: 0, 56 57 getHeight: function() { 58 header.headerHeight = $('#header').height(); 59 return this; 60 }, 61 62 init: function() { 63 header.getHeight(); 64 // ã¹ã¯ãã¼ã«å¯è½éããããé«*2以ä¸ãªãå¶å¾¡ç¡ã 65 header.actFlag = ($(document).height() - $(window).height()) > header.headerHeight * 2; 66 return this; 67 }, 68 69 scroll: function() { 70 if (header.actFlag) { 71 var target = $('.cd-header'); 72 var winY = $(window).scrollTop(); 73 74 // ãããé« < ã¹ã¯ãã¼ã«é 75 if (header.headerHeight < winY) { 76 if (!$('.clone-header').length) { 77 target.clone().insertBefore(target).removeClass('cd-header').addClass('clone-header').css('visibility', 'hidden'); 78 } 79 target.removeClass('hide').addClass('is-scroll'); 80 81 // ãããé«*0.75 < ã¹ã¯ãã¼ã«é < ãããé« 82 } else if ((header.headerHeight * 0.75) < winY && winY < header.headerHeight) { 83 $('.clone-header').remove(); 84 target.removeClass('is-scroll').addClass('hide'); 85 86 // ã¹ã¯ãã¼ã«é0 87 } else { 88 $('.clone-header').remove(); 89 target.removeClass('is-scroll hide'); 90 } 91 } 92 return this; 93 } 94}; 95 96$(function(){ 97 header.init(); 98}); 99 100$(window).on('scroll', function() { 101 header.scroll(); 102}); 103 104$(window).on('load resize', function() { 105 header.init().scroll(); 106}); 107 108/** 109 * Initialize 110*/ 111$(function() { 112 // ããã¤ã¹å¶å¾¡init 113 viewMode.set(); 114 browser.set(); 115 116 // ããclone 117 $('.navi.pc .navi_list').clone(true).appendTo($('.navi.mobile')); 118 119 // ããå¶å¾¡ 120 $('#button_navi .navi_trigger, .navi.mobile').on('click', function() { 121 var isOpened, yPos; 122 var $target = $('#header'); 123 var scrollbarW = window.innerWidth - document.body.clientWidth; 124 125 // ç¶æ ãã©ã°åå¾ 126 isOpened = ($target.hasClass('open')); 127 128 // ããYåº§æ¨ 129 yPos = (!isOpened) ? $(window).scrollTop().top : 0; 130 131 // ããclose -> open 132 if (!isOpened) { 133 // ããã¢ã¤ã³ã³å¤æ´ 134 $('#button_navi i').removeClass('fa-navicon').addClass('fa-close'); 135 136 // ããé«ãã¦ã£ã³ãã¦é«ã«fit 137 $('.navi.mobile').css({ 138 'height': '100%', 139 'position': 'fixed' 140 }); 141 142 $('#button_navi').css({ 143 'right': scrollbarW + 20 + 'px' 144 }); 145 146 // headerY座æ¨ã»ãã 147 $target.css({ 148 'top': yPos + 'px', 149 'padding-right': scrollbarW + 'px' 150 }); 151 152 // bodyã¹ã¯ãã¼ã«ãã¼é表示 153 $('body').css({ 154 'overflow-y': 'hidden' 155 }); 156 157 // ããopenã¢ã¯ã·ã§ã³ 158 $('.navi.mobile').css('overflow-y', 'scroll').animate({opacity: 'show'}, {duration: 200, easing: 'swing'}); 159 160 // ããopen -> close 161 } else { 162 // ããã¢ã¤ã³ã³å¤æ´ 163 $('#button_navi i').removeClass('fa-close').addClass('fa-navicon'); 164 165 // ããcloseã¢ã¯ã·ã§ã³ 166 $('.navi.mobile').css('overflow-y', 'hidden').animate({opacity: 'hide'}, {duration: 100, easing: 'swing'}); 167 168 $('#button_navi').css({ 169 'right': 20 + 'px' 170 }); 171 172 // bodyã¹ã¯ãã¼ã«ãã¼é表示 173 $('body').css({ 174 'overflow-y': 'scroll' 175 }); 176 177 // headerY座æ¨ã»ãã 178 $target.css({ 179 'top': 0, 180 'padding-right': 0 181 }); 182 } 183 184 // ç¶æ ãã©ã°(class)ã»ãã 185 $target.toggleClass('open'); 186 $('body').toggleClass('navi-open'); 187 }); 188 189 // ãã¿ã³å¤clickæã®å¶å¾¡ 190 $('.navi.mobile ul').on('click', function(event) { 191 event.stopPropagation(); 192 }); 193 194 // ãã¼ã¸ã¿ã¤ãã«ã«ãªã³ã¯ä»å (top, free, minne-gallery以å¤) 195 var bodyId = $('body').attr('id'); 196 var siteURL = $('#header .logo a').attr('href') + '/' + bodyId; 197 198 if (bodyId !== 'free' && bodyId !== 'top' && bodyId !== 'minne-gallery' && bodyId !== 'event-reservation') { 199 $('<a>'+ $('.page_title span').text() + '</a>').appendTo('.page_title').attr('href', siteURL); 200 $('.page_title span').remove(); 201 } 202 203 // é»è©±çªå·ã¿ããå¯¾å¿ 204 if (!viewMode.get('pc-view') && $('.shop_tel').css('display') === 'block') { 205 $('.shop_tel > div').wrap('<a href="tel:' + $('.shop_tel').data('shoptel') + '"></a>'); 206 } 207 208 // pager(nextã»prev)ãfont-awesomeã«ç½®æ 209 $('.pager .prev').text('').attr('class', 'prev fa fa-angle-left'); 210 $('.pager .next').text('').attr('class', 'next fa fa-angle-right'); 211 212 // navi_parts(ããã¼/ã¦ã£ã¸ã§ãã)ãæ½åºãã¦ç§»å 213 var naviparts = $('#navi_parts'); 214 215 if (naviparts.children().length !== 0) { 216 $('.gadgets .inner').append(naviparts); 217 } else { 218 $('.gadgets').remove(); 219 } 220 221 // Schedule, Counter, QRã³ã¼ãstyle 222 $('.sidebar .block').each(function() { 223 if ($(this).css('display') === 'block') { 224 $(this).css('display', 'inline-block'); 225 } else { 226 $(this).remove(); 227 } 228 }); 229 230 // Scheduleã0ä»¶ãªãé ååé¤ 231 if ($('.today_area dd').length === 0) { 232 $('.today_area').remove(); 233 } 234 235 // Schedule, Counter, QRã³ã¼ããå ¨ã¦é表示ãªãé ååé¤ 236 if ($('.sidebar .block').children().length === 0) { 237 $('.sidebar').remove(); 238 } 239 240 // Socialãã¿ã³ãå ¨ã¦é表示ãªãé ååé¤ 241 if ($('.social .inner').children().length === 0) { 242 $('.social').remove(); 243 } 244 245 // facebookãã¼ã¸ã¦ã£ã¸ã§ããã®æåã«æ¹è¡ä»å 246 $('.social_widget_facebook_likebox').before('<br />'); 247 248 if ( $('.commoncontent').children().length === 0 ) { 249 $('.commoncontent').remove(); 250 } 251 252 // Powered byãinlineã« 253 if ($('.powered').css('display') === 'block') { 254 $('.powered').css('display', 'inline'); 255 } 256 257 // RSSãinlineã« 258 if ($('.shop_rss').css('display') === 'block') { 259 $('.shop_rss').css('display', 'inline'); 260 261 if ($('.powered').css('display') !== 'none') { 262 $('.shop_rss span').css('display', 'inline'); 263 } 264 } 265 266 // colorbox(æ±äººãã¼ã¸ã»ã¡ã«ãã¬ã»ãã©ãã¢ã«ãã é¤å¤) 267 $('.thickbox').not('.navi_recruit, .navi_melmaga, .js-colorbox-html').each(function() { 268 $(this).colorbox({ 269 rel: $(this).attr('rel'), 270 className: 'cb', 271 width: '90%', 272 height: '90%', 273 transition: 'fade', 274 previous: '<i class="fa fa-angle-left"></i>', 275 next: '<i class="fa fa-angle-right"></i>', 276 close: '<i class="fa fa-close"></i>', 277 fixed: true 278 }); 279 }); 280 281 $(document).on('cbox_open cbox_closed', function() { 282 $('body').toggleClass('modal-open'); 283 }); 284 285 // back to topãã¿ã³ 286 var $pagetop = $('.totop .button'); 287 288 $(window).on('scroll', function() { 289 if ($(this).scrollTop() > 100) { 290 $pagetop.addClass('is-visible'); 291 } else { 292 $pagetop.removeClass('is-visible'); 293 } 294 }); 295 296 $pagetop.on('click', function() { 297 $('body, html').animate({ scrollTop: 0 }, 500); 298 return false;
299 }); 300}); 301 302/** 303 * Window Load, Resize 304*/ 305$(window).on('load resize', function() { 306 // ããã¤ã¹å¶å¾¡reinit 307 viewMode.set(); 308 309 // Schedule, Counter, QRã³ã¼ãé åé«ãæã 310 if (!viewMode.get('phone-view')) { 311 $('.sidebar .block').tile(); 312 } else { 313 $('.sidebar .block').css('height', 'auto'); 314 } 315});
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.