1/************************************************ 2 3@PC - common.js v5.0.0 4 5(c) ULM Co.,Ltd. - https://www.ulm-design.com 6************************************************/ 7/*-------------------------- 8global 9--------------------------*/ 10const WINDOW = $(window); 11const WRAPPER = $('#wrapper'); 12const DOCUMENT = $(document); 13var DEF_W = 1024;//ãã©ã¦ã¶ã®æ¨ªå¹ ã®æå°px 14var DEF_H = 650;//ãã©ã¦ã¶ã®ç¸¦å¹ ã®æå°px 15 16/*-------------------------- 17testã¢ã¼ã 18--------------------------*/ 19const IS_TEST = false;//TESTã¢ã¼ãã«ããå ´åã¯trueã«ã 20 21if(IS_TEST) { 22 //stats.js 23 var script2 = document.createElement('script'); 24 script2.src = 'https://cdnjs.cloudflare.com/ajax/libs/stats.js/r8/Stats.min.js'; 25 document.body.appendChild(script2); 26 script2.onload = (function(){ Common.initStats(); }); 27 28}//endif 29 30/******************************************************* 31 32movieè¨å® 33 34********************************************************/ 35const MOVIE_W = 853;//ããã©ã«ãã®æ¨ªå¹ 36const MOVIE_H = 480;//ããã©ã«ãã®ç¸¦å¹ 37const MOVIE_MARGIN = 50;//å·¦å³ã®ãã¼ã¸ã³ 38const MOVIE_NAVI_BTN_H = 40;//ããã®ãã¿ã³ã®é«ã 39const MOVIE_NAVI_BTN_LINE = 1;//ä½åã 40const MOVIE_NAVI_H = MOVIE_NAVI_BTN_H * MOVIE_NAVI_BTN_LINE;//ããã®é«ã(ããã©ã«ã50) 41const MOVIE_CLOSE_H = 32;//éãããã¿ã³ã®é«ã 42const MOVIE_URL = 'movie/index.html'; 43const MOVIE_ID_ARR = [ 44 { name: 'åç»1', id: 'XmjG7W2pRUk', width: '50%', height: MOVIE_NAVI_BTN_H }, 45 { name: 'åç»1', id: 'XmjG7W2pRUk', width: '50%', height: MOVIE_NAVI_BTN_H } 46]; 47 48 49 50/*------------------------------- 51@getMovieParams 52--------------------------------*/ 53function getMovieParams() { 54 55 var w = (WINDOW.width() - MOVIE_MARGIN) >> 0; 56 var h = MOVIE_H * (w / MOVIE_W) + MOVIE_NAVI_H + MOVIE_CLOSE_H >> 0; 57 var maxH = (WINDOW.height() - MOVIE_MARGIN) >> 0; 58 59 if( h > maxH){ 60 h = maxH;//å ¨ä½ã®é«ã 61 w = MOVIE_W * ((h - MOVIE_NAVI_H - MOVIE_CLOSE_H) / MOVIE_H) >> 0; 62 } 63 64 return { 65 'w' : w, 66 'h' : h, 67 'movieW' : MOVIE_W, 68 'movieH' : MOVIE_H, 69 'closeH' : MOVIE_CLOSE_H, 70 'url' : MOVIE_URL, 71 } 72 73}//getMovieParams 74 75 76/************************************************************************************************************** 77 78 79Common 80 81 82***************************************************************************************************************/ 83const Common = ( function() { 84 85 /*-------------------------- 86 nav 87 --------------------------*/ 88 var _scrollPosition; 89 var _isOpenDrawer = false; 90 var drawerContainer = $('#drawer-container'); 91 92 /******************************************************* 93 94 @init 95 96 ********************************************************/ 97 function init() { 98 99 //å³ã¯ãªãã¯ç¦æ¢ 100 if($('body').hasClass('protect')){ 101 $('body').on('contextmenu',function(e){ 102 return false; 103 }); 104 } 105 106 // SNSå°çª 107 openSnsWindow(); 108 109 110 /*-------------------------- 111 nav 112 --------------------------*/ 113 navInit(); 114 115 }//init 116 117 118 /******************************************************* 119 120 @navInit 121 122 ********************************************************/ 123 function navInit() { 124 125 $('#drawer-btn').on('click', function(){ 126 if(!_isOpenDrawer){ 127 showDrawer(); 128 }else{ 129 hideDrawer(); 130 } 131 }); 132 133 $(window).on('load', function(){ 134 //åºå®ã¡ãã¥ã¼ 135 $('#nav-trailer').on('click', function(){ 136 watchMovie(); 137 });//click 138 });//load 139 140} 141 142/******************************************************* 143 144showDrawer 145 146********************************************************/ 147function showDrawer(){ 148 149 //ã¢ãã¡ã¼ã·ã§ã³ãçµããã¾ã§touchã¤ãã³ããç¦æ¢ãã 150 $(window).on('touchmove.noScroll', function(e) { 151 e.preventDefault(); 152 }); 153 154 //naviãéããã¨ãã®ã¹ã¯ãã¼ã«éãåå¾ 155 _scrollPosition = $(window).scrollTop(); 156 157 //drawer-btnã«classããµã£ã¦ã¢ãã¡ã¼ã·ã§ã³ããã 158 $('.drawer-line').addClass('open'); 159 160 //åã¡ãã¥ã¼ã¯ãªãã¯ã§drawerãéãã
161 /*$('.drawer-nav-btn').on('click', function(){ 162 hideDrawer(); 163 });*/ 164 165 //drawerå ¨ä½ã®ã¢ãã¡ã¼ã·ã§ã³ 166 drawerContainer.css({'display':'block'}).stop().animate({'opacity': 1},600,'easeOutQuart',function() { 167 168 //touchã¤ãã³ãç¦æ¢è§£é¤ 169 $(window).off('.noScroll'); 170 171 onShowDrawer(); 172 173 }); 174 175}//showDrawer 176 177 178function onShowDrawer(){ 179 _isOpenDrawer = true; 180} 181 182 183/******************************************************* 184 185hideDrawer 186 187********************************************************/ 188function hideDrawer(){ 189 190 //ã¢ãã¡ã¼ã·ã§ã³ãçµããã¾ã§touchã¤ãã³ããç¦æ¢ãã 191 $(window).on('touchmove.noScroll', function(e) { 192 e.preventDefault(); 193 }); 194 195 //drawer-btnã«classããµã£ã¦ã¢ãã¡ã¼ã·ã§ã³ããã 196 $('.drawer-line').removeClass('open'); 197 198 //naviã¢ãã¡ã¼ã·ã§ã³ 199 drawerContainer.stop().animate({'opacity' : 0},600,'easeOutQuart',function(){ 200 201 $(this).css({'display':'none'}); 202 203 //touchã¤ãã³ãç¦æ¢è§£é¤ 204 $(window).off('.noScroll'); 205 206 onHideDrawer(); 207 208 }); 209 210}//hideDrawer 211 212function onHideDrawer(){ 213 214 _isOpenDrawer = false; 215 216} 217 218/***************************************** 219 220@get Is Top 221 222*****************************************/ 223function getIsTop(){ 224 225 if($('body').attr('id') == 'top'){ 226 return true; 227 }else{ 228 return false; 229 } 230 231}//getIsTop 232 233 /******************************************************* 234 235 @openSnsWindow 236 237 ********************************************************/ 238 function openSnsWindow() { 239 240 var widthHalf = window.screen.width / 2, 241 heightHalf = window.screen.height / 2, 242 blankWindowWidth = 510, // å¥çªã®æ¨ªå¹ 243 blankWindowHeight = 510, // å¥çªã®ç¸¦å¹ 244 options = { // å¾ã»ã©è¨è¼ãã window.open ã®ç¬¬ï¼å¼æ°ã§ä½¿ç¨ãã 245 left : Math.floor(widthHalf - (blankWindowWidth / 2)), // å¥çªã® Xåº§æ¨ 246 top : Math.floor(heightHalf - (blankWindowHeight / 2)), // å¥çªã® Yåº§æ¨ 247 width : blankWindowWidth, 248 height: blankWindowHeight 249 }; 250 251 $(document).on('click', '.share-link-btn', function(event) { 252 // if(window.innerWidth < 768) return; 253 event.preventDefault(); 254 var thisHref = $(this).attr('href'), 255 arg = 'left=' + options.left 256 + ',top=' + options.top 257 + ',width=' + options.width 258 + ',height=' + options.height; 259 260 window.open(thisHref, 'blankShareWindow', arg); 261 }); 262 263 } 264 265 /*--------------------------------------------- 266 PRIVATE 267 ---------------------------------------------*/ 268 function render(){ 269 window.requestAnimationFrame(render); 270 if(_stats){ _stats.update(); } 271 } 272 273 274 /*--------------------------------------------- 275 @STATS 276 ---------------------------------------------*/ 277 function initStats(){ 278 _stats = new Stats(); 279 _stats.domElement.style.position = 'fixed'; 280 _stats.domElement.style.left = '0px'; 281 _stats.domElement.style.top = '0px'; 282 document.body.appendChild(_stats.domElement); 283 284 var requestAnimationFrame = window.requestAnimationFrame || window.mozRequestAnimationFrame || window.webkitRequestAnimationFrame || window.msRequestAnimationFrame; 285 window.requestAnimationFrame = requestAnimationFrame; 286 287 render(); 288 } 289 290 return{ 291 init:init, 292 initStats:initStats 293 } 294 295 296})(); 297 298 299/******************* 300@ready 301*******************/ 302Common.init(); 303/******************************************************* 304 305@getParam 306 307********************************************************/ 308function getParam(name, url) { 309 if (!url) url = window.location.href; 310 name = name.replace(/[\[\]]/g, "\\$&"); 311 let regex = new RegExp("[?&]" + name + "(=([^&#]*)|&|#|$)"), 312 results = regex.exec(url); 313 if (!results) return null; 314 if (!results[2]) return ''; 315 return decodeURIComponent(results[2].replace(/\+/g, " ")); 316}
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.