PageSourceSearch

https://ab-company.co.jp/jp/js/index.js

js ab-company.co.jp collected 2026-10-04 13:26:01 UTC 9,248 bytes, 424 lines download raw bytes

1(function() {
2
3  $(window).on('load',function(){
4
5    var $vis = $('#visual-main li');
6
7    var len = $vis.length;
8
9    if(len>1){
10
11      var
12
13      current = 0,
14
15      count = 0,
16
17      timer;
18
19      $vis.each(function(){
20
21        $('<img>').attr('src', $(this).find('img').attr('src') )
22
23        .on('load',function(){
24
25          count++;
26
27          if(count>=len){
28
29            $vis.removeClass('init');
30
31            $('#visual-cts li').removeClass('init');
32
33          }
34
35        }).attr('src',$(this).attr('src'));
36
37      });
38
39
40      $('#visual-cts span').each(function(index){
41
42        $(this).on('click', function(){
43
44          $('#visual-cts li.current').addClass('click-out').removeClass('current');
45
46          $(this).parent('li').removeAttr('class').addClass('current');
47
48          $vis.eq(index).addClass('current').siblings('li').removeClass('current');
49
50
51          return false;
52        });
53      });
54
55
56      if(!userAgentIE){
57
58        $('#visual-cts circle').on('animationend',function(){
59
60          setTimer();
61
62        });
63
64      }else{
65
66        $('#visual-cts li').on('animationend',function(){
67
68          setTimer();
69
70        });
71
72      }
73
74      function setTimer(){
75
76        var $target = $('#visual-cts li.current').addClass('anime-out').next('li');
77
78        if($target.length){
79
80          $target.children('span').trigger('click');
81
82        }else{
83
84          $('#visual-cts li:eq(0) span').trigger('click');
85
86        }
87
88      }
89
90    }
91
92  }).on('scroll',function(){
93
94    if( $(window).scrollTop() > $('#main').offset().top ){
95
96      $('#visual-cts li.current').addClass('paused');
97
98    }else{
99
100      $('#visual-cts li.current').removeClass('paused');
101    }
102
103  });
104
105  $('#main-message>span img, #main-business>span, #main-business>span img').on('transitionend',function(){
106
107    $(this).css('transition','none');
108
109  });
110
111
112  /* セクションタイトル
113  ----------------------------------------------------*/
114
115  $('section h2 .en em').each(function(index){
116
117    $(this).css('transition-delay', index*0.03 + 's');
118
119  });
120
121  $('section h2 .en:not(:has(em))').each(function(){
122
123    var section_title = '';
124
125    $.each( $(this).text().split('') , function(i,v){
126
127      section_title = section_title + ((v==' ')?' ':'<em style="transition-delay:'+ i*0.03 +'s">'+ v + '</em>');
128
129    });
130
131    if( $(this).find('br').length>0 ){
132
133      var br_pos = $(this).html().match(/<br>/).index;
134
135    }
136
137    $(this).next('span').css('transition-delay', $(this).text().split('').length*0.03 + 0.5 + 's');
138
139    $(this).html(section_title);
140
141    if( br_pos ){
142
143      $(this).find('em').eq( br_pos - $(this).text().slice(0,br_pos).match(/ /g).length ).before('<br>');
144
145    }
146
147  });
148
149  $(window).on('load.effect resize.effect scroll.effect',function(){
150
151    var $ready = $('section h2:not(.scroll_in)');
152
153    if($ready.length == 0){
154
155      $(window).off('load.effect resize.effect scroll.effect');
156
157      return false;
158
159    }
160
161    $ready.each(function(index){
162
163      if( $(window).scrollTop() + $(window).height()*0.85 > $(this).offset().top ){
164
165        var $target = $(this).addClass('scroll_in');
166
167      }
168
169    });
170
171  });
172
173
174  function sanitize(str){
175
176    return str.replace(/\&/g,'&amp;').replace(/\</g,'&lt;').replace(/\>/g,'&gt;').replace(/\"/g,'&quot;').replace(/\'/g,'&#x27');
177
178  }/*"*/
179
180
181  /* 数字で見る カウントアップ
182  ----------------------------------------------------*/
183  var dataArr = [];
184
185  $('#main-numbers em[data-num]').each(function(index){
186
187  	dataArr.push( parseInt(sanitize($(this).attr('data-num')).replace(',', ''),10)  )
188
189  });
190
191  var abc_numbers_min = Math.min(dataArr[0], dataArr[1], dataArr[2], dataArr[3]);
192
193  $(window).on('load.numbers resize.numbers scroll.numbers',function(){
194
195    var $ready = $('#main-numbers li:not(.start)');
196
197    if($ready.length == 0){
198
199      $(window).off('load.numbers resize.numbers scroll.numbers');
200
201      return false;
202
203    }
204
205    $ready.each(function(index){
206
207      if( $(window).scrollTop() + $(window).height()*0.6 > $(this).offset().top ){
208
209        var $target = $(this).addClass('start').find('em');
210
211        $target.children('span').text('0');
212
213        $target.next('span').show();
214
215        var num = 0;
216
217        var number = parseInt(sanitize($target.attr('data-num')).replace(',', ''),10);
218
219        var timer = setInterval(function(){
220
221          if(num <= number){
222
223            $target.children('span').text(num.toLocaleString());
224
225            if(number!=abc_numbers_min){
226
227              num = num + parseInt(number/abc_numbers_min)+1;
228
229            }else{
230
231              num++;
232            }
233
234          }else{
235
236            $target.children('span').text( number.toLocaleString() );
237
238            $target.parent().next('i:not(.hide)').addClass('finish');
239
240            clearInterval(timer);
241
242          }
243
244        }, Math.ceil(1500/abc_numbers_min) );
245
246      }
247
248    });
249
250  });
251
252
253  /* 数字で見る グラフ
254  ----------------------------------------------------*/
255
256  $('.num-graph').each(function(index){
257
258    var graph_dm = sanitize($(this).attr('data-dm')).split(' ').map(Number),
259
260    graph_fc = sanitize($(this).attr('data-fc')).split(' ').map(Number),
261
262    graph_max = parseInt(sanitize($(this).attr('data-max')),10),
263
264    $bars =  $('<div class="graph-box">');
265
266    $.each( sanitize($(this).attr('data-year')).split(' '), function(i,v){
267
268      $bars.append(
269
270        $('<div class="graph-bar">').append(
271
272          '<div><span style="height:' + graph_dm[i]/graph_max*100 +'%"></span><span style="height:' + graph_fc[i]/graph_max*100 +'%"><b>'+(graph_dm[i]+graph_fc[i]).toLocaleString()+'</b></span></div><p>' + v + 'å¹´</p>'
273        )
274      )
275
276    });
277
278
279    var $line =  $('<div class="graph-line">');
280
281    for( var i=0; i<parseInt(sanitize($(this).attr('data-line')),10); i++ ){
282
283      $line.append('<span>');
284
285    }
286
287    var $arrow = $('<span class="graph-arrow"><svg width="500" height="18" viewBox="0 0 500 18"><path d="M0,7.5H476v3H0ZM500,9,476,0V18Z"/></svg></span>').css({
288
289      'top' : ( 1 - ( graph_dm.slice(-1)[0] + graph_fc.slice(-1)[0] ) / graph_max ) * 100 + '%',
290
291      'height' : ( graph_dm.slice(-1)[0] + graph_fc.slice(-1)[0] - graph_dm[0] - graph_fc[0] ) / graph_max * 100 + '%'
292
293    });
294
295    $(this).append($line).append($arrow).append($bars);
296
297  });
298
299
300  function graphArrow(){
301
302    $('.graph-arrow').each(function(){
303
304  	// IE no Flex
305  	var $target = $(this).css({
306
307  		'width' : $(this).next().children(':last').position().left - $(this).next().children(':first').position().left - $(this).next().children(':first').width()*1.4 ,
308
309  		'left' : $(this).next().children(':first').position().left + $(this).next().children(':first').width()*1.2
310
311  	});
312
313  	// width確定後
314      $target.children('svg').css('transform', 'translate(0,-50%) rotate(-'+ Math.atan2($target.height(),$target.width())*( 180 / Math.PI ) + 'deg)');
315
316
317    });
318
319  }
320
321  function countUp(){
322
323    setTimeout(function(){
324
325      $('.modal-cont dd em').removeClass('finish').find('i').remove()
326
327      var $current = $('.modal-cont.current dd em').append('<i>0</i>');
328
329      var $target = $current.children('i');
330
331      var num = 0;
332
333      var number = $current.children('span').text();
334
335      var timer = setInterval(function(){
336
337        if(num <= number){
338
339          $target.text(num);
340
341          //num++;
342          num = num + parseInt(number/30)+1;
343
344        }else{
345
346          $current.addClass('finish');
347
348          clearInterval(timer);
349
350        }
351
352      }, Math.ceil(1000/30) );
353
354    }, 300 );
355
356  }
357
358  $('.modal-trigger').on('click', function(){
359
360    graphArrow();
361
362    $(window).on('resize.graph',function(){
363
364      graphArrow();
365
366    });
367
368  //  countUp();
369
370  //  $('#modal-5').on('transitionend.count',function(){
371  //
372  //    countUp();
373  //
374  //  });
375
376  });
377
378  $('#modal-0, #modal-0 .x-close').on('click', function(){
379
380    $(window).off('resize.graph');
381
382    $('#modal-5').off('transitionend.count');
383
384  });
385
386
387
388  /* お知らせ
389  ----------------------------------------------------*/
390  var $news_tab = $('.tab-list');
391
392  var $news_list = $('#news-list');
393
394  $news_tab.find('a').on('click', function(){
395
396    if(!$(this).parent().hasClass('act')){
397
398      $(this).parent().addClass('act').siblings('li').removeClass('act');
399
400      $news_tab.removeClass('tab-open');
401
402      var index = $('.tab-list a').index($(this));
403
404      $news_list.height( $news_list.height() ).animate({ height : $news_list.children('li').eq(index).height() }, 300)
405
406      .children('li').eq(index).addClass('act').slideDown(300)
407
408      .siblings('li:visible').removeClass('act').addClass('slideup').fadeOut(300).slideUp(300, function(){ $(this).removeClass('slideup'); $news_list.css('height','auto');});
409
410    }else{
411
412      if( $('.tab-list').css('flex-direction') == 'column' ){
413
414        $news_tab.toggleClass('tab-open')
415
416      }
417    }
418
419    return false;
420
421  });
422
423
424})();

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.