PageSourceSearch

https://www.mapple.net/js/common.js?ver=1790240323

js mapple.net collected 2026-09-24 09:23:26 UTC 30,397 bytes, 917 lines download raw bytes

1$(function() {
2    $('iframe').each(function(index, element) {
3        var src = element.src;
4        var iframeWrap = $('<div class="iframe-wrap"></div>');
5        if (src.indexOf('https://www.youtube.com/embed/') !== -1) {
6            $(this).wrap(iframeWrap);
7        }
8    });
9
10    if ($.cookie('list_display_type')) {
11        var list_display_type = $.cookie('list_display_type');
12        if (list_display_type == 1) {
13            $("#list .main_area .type_list").removeClass("current").addClass("current");
14            $("#list .main_area .type_thumb").removeClass("current");
15            $("#list .main_area .post_area").addClass("list").removeClass("thumb");
16        } else if (list_display_type == 2) {
17            $("#list .main_area .type_thumb").removeClass("current").addClass("current");
18            $("#list .main_area .type_list").removeClass("current");
19            $("#list .main_area .post_area").addClass("thumb").removeClass("list");
20        }
21    } else {
22        $("#list .main_area .type_list").removeClass("current").addClass("current");
23        $("#list .main_area .type_thumb").removeClass("current");
24        $("#list .main_area .post_area").addClass("list").removeClass("thumb");
25        $.cookie("list_display_type", 1, { expires: 365, path: '/' });
26    }
27
28    $('body').on('click', '.type_list', function() {
29        $(this).removeClass("current").addClass("current");
30        $("#list .main_area .type_thumb").removeClass("current");
31        $("#list .main_area .post_area").addClass("list").removeClass("thumb");
32        $.cookie("list_display_type", 1, { expires: 365, path: '/' });
33    });
34    $('body').on('click', '.type_thumb', function() {
35        $(this).removeClass("current").addClass("current");
36        $("#list .main_area .type_list").removeClass("current");
37        $("#list .main_area .post_area").addClass("thumb").removeClass("list");
38        $.cookie("list_display_type", 2, { expires: 365, path: '/' });
39    });
40
41
42    var $setElm = $('.list_title');
43    var cutFigure = '52'; // カットする文字数
44    var afterTxt = ' …'; // 文字カット後に表示するテキスト
45
46    $setElm.each(function() {
47        var textLength = $(this).text().length;
48        var textTrim = $(this).text().substr(0, (cutFigure))
49
50        if (cutFigure < textLength) {
51            $(this).html(textTrim + afterTxt).css({ visibility: 'visible' });
52        } else if (cutFigure >= textLength) {
53            $(this).css({ visibility: 'visible' });
54        }
55    });
56
57    var $setElm2 = $('.thumb_title');
58    var cutFigure2 = '26'; // カットする文字数
59    var afterTxt2 = ' …'; // 文字カット後に表示するテキスト
60
61    $setElm2.each(function() {
62        var textLength2 = $(this).text().length;
63        var textTrim2 = $(this).text().substr(0, (cutFigure2))
64
65        if (cutFigure2 < textLength2) {
66            $(this).html(textTrim2 + afterTxt2).css({ visibility: 'visible' });
67        } else if (cutFigure2 >= textLength2) {
68            $(this).css({ visibility: 'visible' });
69        }
70    });
71
72    var ua = navigator.userAgent;
73    if (ua.indexOf('iPhone') > 0 || ua.indexOf('iPod') > 0 || (ua.indexOf('Android') > 0) && (ua.indexOf('Mobile') > 0) || ua.indexOf('Windows Phone') > 0) {
74        var $setElm3 = $('.post_area.list .cont_area p');
75        var cutFigure3 = '35'; // カットする文字数
76        var afterTxt3 = ' …'; // 文字カット後に表示するテキスト
77
78        $setElm3.each(function() {
79            var textLength3 = $(this).text().length;
80            var textTrim3 = $(this).text().substr(0, (cutFigure3))
81
82            if (cutFigure3 < textLength3) {
83                $(this).html(textTrim3 + afterTxt3).css({ visibility: 'visible' });
84            } else if (cutFigure3 >= textLength3) {
85                $(this).css({ visibility: 'visible' });
86            }
87        });
88    }
89
90
91    var logo = new Image();
92    logo.src = "https://www.mapple.net/img/watermark.png";
93
94    var elm = $(".photo");
95    //console.log(box.width());
96    //console.log(box.height());
97    elm.each(function(index, element) {
98        //console.log($(this).data('src'));
99        //console.log($(this).attr("id"));
100
101        var watermark_id = $(this).attr("id");
102        var context = element.getContext('2d');
103        var canvasWidth = $(this).width();
104        var canvasHeight = $(this).height();
105        this.width = $(this).width();
106        this.height = $(this).height();
107
108        var img = new Image;
109        img.onload = function() {
110            //context.drawImage(this, 0, 0);
111            var imageWidth = this.width;
112            var imageHeight = this.height;
113
114            // 1 縮小比を計算
115            var scale = 1.0;
116            if (imageWidth / imageHeight > canvasWidth / canvasHeight) {
117                scale = canvasHeight / imageHeight;
118            } else {
119                scale = canvasWidth / imageWidth;
120            }
121
122            scale = Math.ceil(scale * 100) / 100;
123
124            // 2 切り出し領域を計算
125            var clipWidth = canvasWidth / scale;
126            var clipHeight = canvasHeight / scale;
127            var clipX = (imageWidth - clipWidth) / 2;
128            var clipY = (imageHeight - clipHeight) / 2;
129
130            // 3 drawImageメソッドの呼び出し
131            context.drawImage(this, clipX, clipY, clipWidth, clipHeight, 0, 0, canvasWidth, canvasHeight);
132            context.save();
133
134            alpha = 0.8;
135            context.globalAlpha = alpha;
136            context.drawImage(logo, canvasWidth - logo.width - 10, canvasHeight - logo.height - 10);
137            context.restore();
138            context.save();
139
140            if (index == elm.length - 1) {
141                //console.log('ループが終わりました。');
142            }
143        };
144        img.src = $(this).data('src');
145        //var img_png_src = element.toDataURL();
146        //document.getElementById(watermark_id+"_img").src = img_png_src;
147        //console.log(img_png_src);
148    });
149
150
151
152    var elm = $(".photo_no_crop");
153    elm.each(function(index, element) {
154        //console.log($(this).data('src'));
155        //console.log($(this).attr("id"));
156
157        var watermark_id = $(this).attr("id");
158        var context = element.getContext('2d');
159
160        // 表示時の大きさ
161        var canvasWidth = element.width;
162        var canvasHeight = element.height;
163        //console.log(canvasWidth);
164        //console.log(canvasHeight);
165        var trueHeight, trueWidth = 0;
166
167        var img = new Image;
168        img.onload = function() {
169
170            trueHeight = this.height;
171            trueWidth = this.width;
172
173            // 縦またはどちらも同じの場合
174            if (canvasHeight >= canvasWidth) {
175                d = canvasHeight / trueHeight;
176                trueHeight = trueHeight * d;
177                trueWidth = trueWidth * d;
178            } else { // 横の場合
179                d = canvasWidth / trueWidth;
180                trueHeight = trueHeight * d;
181                trueWidth = trueWidth * d;
182            }
183
184            // サイズ内におさまっていない場合
185            if (trueWidth > canvasWidth || trueHeight > canvasHeight) {
186                // 縦横基準で縦横比を変更
187                // 縦またはどちらも同じの場合
188                if (trueHeight >= trueWidth) {
189                    d = canvasHeight / trueHeight;
190                    trueHeight = trueHeight * d;
191                    trueWidth = trueWidth * d;
192
193                } else { // 横の場合
194                    d = canvasWidth / trueWidth;
195                    trueHeight = trueHeight * d;
196                    trueWidth = trueWidth * d;
197                }
198
199                if (trueWidth > canvasWidth) {
200                    d = canvasWidth / trueWidth;
201                    trueHeight = trueHeight * d;
202                    trueWidth = trueWidth * d;
203                }
204
205                if (trueHeight > canvasHeight) {
206                    d = canvasHeight / trueHeight;
207                    trueHeight = trueHeight * d;
208                    trueWidth = trueWidth * d;
209                }
210            }
211
212            document.getElementById(watermark_id).width = trueWidth;
213            document.getElementById(watermark_id).height = trueHeight;
214
215            // 3 drawImageメソッドの呼び出し
216            context.drawImage(this, 0, 0, trueWidth, trueHeight)
217            context.save();
218
219            alpha = 0.8;
220            context.globalAlpha = alpha;
221            context.drawImage(logo, trueWidth - logo.width - 10, trueHeight - logo.height - 10);
222            context.restore();
223            context.save();
224
225            if (index == elm.length - 1) {
226                //console.log('ループが終わりました。');
227            }
228        };
229        img.src = $(this).data('src');
230    });
231
232
233
234    var elm = $(".post_header figure .photo_no_crop_fix");
235    elm.each(function(index, element) {
236        //console.log($(this).data('src'));
237        //console.log($(this).attr("id"));
238
239        var figure = $(this).parent();
240
241        var watermark_id = $(this).attr("id");
242        var context = element.getContext('2d');
243
244        // 表示時の大きさ
245        var canvasWidth = figure.width();
246        var canvasHeight = figure.height();
247        //console.log(canvasWidth);
248        //console.log(canvasHeight);
249        var trueHeight, trueWidth = 0;
250
251        var img = new Image;
252        img.onload = function() {
253
254            trueHeight = this.height;
255            trueWidth = this.width;
256
257            // 縦またはどちらも同じの場合
258            if (canvasHeight >= canvasWidth) {
259                d = canvasHeight / trueHeight;
260                trueHeight = trueHeight * d;
261                trueWidth = trueWidth * d;
262
263            } else { // 横の場合
264                d = canvasWidth / trueWidth;
265                trueHeight = trueHeight * d;
266                trueWidth = trueWidth * d;
267            }
268
269            // サイズ内におさまっていない場合
270            if (trueWidth > canvasWidth || trueHeight > canvasHeight) {
271                // 縦横基準で縦横比を変更
272                // 縦またはどちらも同じの場合
273                if (trueHeight >= trueWidth) {
274                    d = canvasHeight / trueHeight;
275                    trueHeight = trueHeight * d;
276                    trueWidth = trueWidth * d;
277                } else { // 横の場合
278                    d = canvasWidth / trueWidth;
279                    trueHeight = trueHeight * d;
280                    trueWidth = trueWidth * d;
281                }
282            }
283
284            document.getElementById(watermark_id).width = trueWidth;
285            document.getElementById(watermark_id).height = trueHeight;
286
287            // 3 drawImageメソッドの呼び出し
288            context.drawImage(this, 0, 0, trueWidth, trueHeight)
289            context.save();
290
291            alpha = 0.8;
292            context.globalAlpha = alpha;
293            context.drawImage(logo, trueWidth - logo.width - 10, trueHeight - logo.height - 10);
294            context.restore();
295            context.save();
296
297            if (index == elm.length - 1) {
298                //console.log('ループが終わりました。');
299            }
300        };
301        img.src = $(this).data('src');
302    });
303
304    var elm = $(".post_body figure .photo_no_crop_fix");
305    elm.each(function(index, element) {
306        //console.log($(this).data('src'));
307        //console.log($(this).attr("id"));
308
309        var figure = $(this).parent();
310
311        var watermark_id = $(this).attr("id");
312        var context = element.getContext('2d');
313
314        // 表示時の大きさ
315        var canvasWidth = figure.width();
316        var canvasHeight = figure.height();
317        //console.log(canvasWidth);
318        //console.log(canvasHeight);
319        var trueHeight, trueWidth = 0;
320
321        var img = new Image;
322        img.onload = function() {
323
324            trueHeight = this.height;
325            trueWidth = this.width;
326
327            if (canvasHeight < trueHeight) {
328                canvasHeight = trueHeight;
329            }
330
331            // 縦またはどちらも同じの場合
332            if (canvasHeight >= canvasWidth) {
333                d = canvasHeight / trueHeight;
334                trueHeight = trueHeight * d;
335                trueWidth = trueWidth * d;
336            } else { // 横の場合
337                d = canvasWidth / trueWidth;
338                trueHeight = trueHeight * d;
339                trueWidth = trueWidth * d;
340
341            }
342
343            // サイズ内におさまっていない場合
344            if (trueWidth > canvasWidth || trueHeight > canvasHeight) {
345                // 縦横基準で縦横比を変更
346                // 縦またはどちらも同じの場合
347                if (trueHeight >= trueWidth) {
348                    d = canvasHeight / trueHeight;
349                    trueHeight = trueHeight * d;
350                    trueWidth = trueWidth * d;
351                } else { // 横の場合
352                    d = canvasWidth / trueWidth;
353                    trueHeight = trueHeight * d;
354                    trueWidth = trueWidth * d;
355
356                }
357
358                if (trueWidth > canvasWidth) {
359                    d = canvasWidth / trueWidth;
360                    trueHeight = trueHeight * d;
361                    trueWidth = trueWidth * d;
362
363                }
364
365                if (trueHeight > canvasHeight) {
366                    d = canvasHeight / trueHeight;
367                    trueHeight = trueHeight * d;
368                    trueWidth = trueWidth * d;
369
370                }
371            }
372
373            //console.log(trueWidth);
374            //console.log(trueHeight);
375
376            document.getElementById(watermark_id).width = trueWidth;
377            document.getElementById(watermark_id).height = trueHeight;
378
379            $('#' + watermark_id + "_text").width(trueWidth);
380
381            // 3 drawImageメソッドの呼び出し
382            context.drawImage(this, 0, 0, trueWidth, trueHeight)
383            context.save();
384
385            alpha = 0.8;
386            context.globalAlpha = alpha;
387            context.drawImage(logo, trueWidth - logo.width - 10, trueHeight - logo.height - 10);
388            context.restore();
389            context.save();
390
391            if (index == elm.length - 1) {
392                //console.log('ループが終わりました。');
393            }
394        };
395        img.src = $(this).data('src');
396    });
397
398    // -- グローバルナビ検索
399    $('#header_search_button').on('click', function(e) {
400
401        //var header_search_type = $("#header_search_type").val();
402        var header_search_type = $('#header_search input:radio[name="search_type"]:checked').val();
403        var header_search_query = $("#q").val();
404
405        //console.log(header_search_query);
406
407        if (header_search_query != '') {
408            if (header_search_type == 'article') {
409                $('#header_search').attr('action', '/site_search/');
410            } else if (header_search_type == 'poi') {
411                $('#header_search').attr('action', '/spots/poi_search/');
412            }
413            $('#header_search').submit();
414
415            e.preventDefault();
416        } else {
417            return false;
418        }
419
420    });
421
422    // -- グローバルナビ検索
423    $('#header_search_button2').on('click', function(e) {
424
425        //var header_search_type = $("#header_search_type").val();
426        var header_search_type = $('#header_search2 input:radio[name="search_type"]:checked').val();
427        var header_search_query = $("#q2").val();
428
429        //console.log(header_search_query);
430
431        if (header_search_query != '') {
432            if (header_search_type == 'article') {
433                $('#header_search2').attr('action', '/site_search/');
434            } else if (header_search_type == 'poi') {
435                $('#header_search2').attr('action', '/spots/poi_search/');
436            }
437            $('#header_search2').submit();
438
439            e.preventDefault();
440        } else {
441            return false;
442        }
443
444    });
445
446    /* --- search ---*/
447    $('body').on('click', '.search_btn', function() {
448        /*$("#s_menu").addClass("in");
449        $("#s_menu").fadeIn();
450        $(".overlay").fadeIn();
451        $(".menu_btn img").fadeOut();*/
452
453        $(".search_mordal__block").fadeIn();
454    });
455    $('body').on('click', '.search_mordal__header .btn.close_btn', function() {
456        /*$("#s_menu").addClass("in");
457        $("#s_menu").fadeIn();
458        $(".overlay").fadeIn();
459        $(".menu_btn img").fadeOut();*/
460
461        $(".search_mordal__block").fadeOut();
462    });
463
464    /* --- narrow_down ---*/
465    $('body').on('click', '.narrow_down_btn', function() {
466        $(".sp_filtering_mordal__block").addClass("in");
467        $(".sp_filtering_mordal__block").fadeIn();
468        /*$("#s_menu").addClass("in");
469        $("#s_menu").fadeIn();
470        $(".overlay").fadeIn();
471        $(".menu_btn img").fadeOut();*/
472    });
473
474    $('body').on('click', '.sp_filtering_mordal__block .sp_filtering_mordal__header .btn.close_btn', function() {
475        $(".sp_filtering_mordal__block").removeClass("in");
476        $(".sp_filtering_mordal__block").fadeOut();
477        /*$("#s_menu").removeClass("in");
478        $("#s_menu").fadeOut();
479        $(".overlay").fadeOut();
480        $(".menu_btn img").fadeOut();*/
481    });
482
483
484    var _spot = new Array();
485    _spot.push("すべて");
486    _spot.push("全国");
487
488    /*setTimeout(function(){
489      var _time = setInterval(function(){
490        console.log($(".area_menu.set_item").length)
491        if($(".area_menu.set_item").length > 0){
492          $(".area_menu.set_item").off('click');
493          $(".area_menu.set_item").on('click', function(){
494            var _name = $(this).attr("data-name");
495            console.log(_name,"_name");
496            return false;
497          });
498          clearInterval(_time);
499        }
500      },200)
501    },1000)
502
503    function set_search_item(_name){
504      console.log(_name,"_name");
505    }
506*/
507    /*var _time = setInterval(function(){
508      console.log($(".area_menu").length)
509      if($(".area_menu").length > 0){
510        $(".area_menu").off('click');
511        $(".area_menu").on('click', function(){
512          var _name = $(this).attr("data-name");
513          console.log(_name,"_name");
514        });
515        clearInterval(_time);
516      }
517    },200)*/
518
519    $('body').on('click', '.overlay', function() {
520        $("#s_menu").removeClass("in");
521        $("#s_menu").fadeOut();
522        $(".overlay").fadeOut();
523        $(".menu_btn img").fadeIn();
524    });
525
526    $(".share_btns").on('click', function() {
527        console.log("share_btns");
528        $(".sns_mordal_cover").fadeIn();
529        $(".sns_mordal").fadeIn();
530    });
531
532    $(".sns_area .sns .sns_mordal .close_btn,.sns_mordal_cover").on('click', function() {
533        $(".sns_mordal_cover").fadeOut();
534        $(".sns_mordal").fadeOut();
535    });
536
537    $(".sns .copy").on('click', function() {
538        copyUrl();
539    });
540
541    $(".area_spot_list .toggle_btn").off('click');
542    $(".area_spot_list .toggle_btn").on('click', function() {
543        console.log("aaa");
544        if ($(this).hasClass("open")) {
545            $(this).removeClass("open");
546            $(this).next().slideUp(200);
547        } else {
548            $(this).addClass("open");
549            $(this).next().slideDown(200);
550        }
551        return false;
552    });
553
554    var _w = 0;
555
556    $(window).on("resize", function() {
557        //console.log("resize");
558        setPosiSerchbox();
559    })
560    setPosiSerchbox();
561
562    function setPosiSerchbox() {
563        _w = $(window).width();
564        //
565        if (_w > 640) {
566            //console.log($(".search_area .thema").offset().left);
567            //$("#hidden_pref_content").css({"left":$(".search_area .pref_name").offset().left});
568            //$("#hidden_theme_content").css({"left":$(".search_area .thema").offset().left});
569        }
570    }
571
572
573    jQuery('img.svg').each(function() {
574        var $img = jQuery(this);
575        var imgID = $img.attr('id');
576        var imgClass = $img.attr('class');
577        var imgURL = $img.attr('src');
578
579        jQuery.get(imgURL, function(data) {
580            // Get the SVG tag, ignore the rest
581            var $svg = jQuery(data).find('svg');
582
583            // Add replaced image's ID to the new SVG
584            if (typeof imgID !== 'undefined') {
585                $svg = $svg.attr('id', imgID);
586            }
587            // Add replaced image's classes to the new SVG
588            if (typeof imgClass !== 'undefined') {
589                $svg = $svg.attr('class', imgClass + ' replaced-svg');
590            }
591
592            // Remove any invalid XML tags as per http://validator.w3.org
593            $svg = $svg.removeAttr('xmlns:a');
594
595            // Check if the viewport is set, else we gonna set it if we can.
596            if (!$svg.attr('viewBox') && $svg.attr('height') && $svg.attr('width')) {
597                $svg.attr('viewBox', '0 0 ' + $svg.attr('height') + ' ' + $svg.attr('width'))
598            }
599
600            // Replace image with new SVG
601            $img.replaceWith($svg);
602
603        }, 'xml');
604
605    });
606
607    if ($("#toc_list").length > 0) {
608        //初期値
609        var h = $('#toc_list').height();
610        var lh = $('#toc_list ul li').height();
611        var cut = h - (h - ((lh + 5) * 3)); //最初から表示しておく #list の高さ。
612        $('#toc_list ul').css('height', cut);
613        $('.switch.off').html('<div class="toc_more">目次を見る</div>');
614        //実行
615        $("#toc_wrap").on('click', '.switch.off', function() {
616            $('#toc_list ul').css('height', '');
617            $('.switch.off').html('<div class="toc_close">閉じる</div>').removeClass('off').addClass('on');
618        });
619        $("#toc_wrap").on('click', '.switch.on', function() {
620            $('#toc_list ul').css('height', cut);
621            $('.switch.on').html('<div class="toc_more">目次を見る</div>').removeClass('on').addClass('off');
622        });
623    }
624
625    if ($(".copy").length > 0) {
626        $(".copy").off("click");
627        $(".copy").on("click", function() {
628            copyUrl();
629            return false;
630        })
631    }
632
633    function copyUrl() {
634        console.log("copy ----");
635        const element = document.createElement('input');
636        element.value = location.href;
637        document.body.appendChild(element);
638        element.select();
639        document.execCommand('copy');
640        document.body.removeChild(element);
641        alert("URLをコピーしました");
642    }
643
644
645
646    /*
647	if($("#header_display").length > 0 && $("#header_display").length > 0){
648        $("#header_display").hide();
649        $("#footer_display").hide();
650        $(window).on("scroll", function() {
651            scrollHeight = $(document).height();
652            scrollPosition = $(window).height() + $(window).scrollTop();
653
654            if ($(this).scrollTop() > 200 && (scrollHeight - scrollPosition) <= 200) {
655                $("#header_display").show();
656                $('#header_display').slideDown("fast");
657            } else {
658                $('#header_display').slideUp("fast");
659            }
660
661            if ($(this).scrollTop() > 200 && (scrollHeight - scrollPosition) > 200) {
662                $("#footer_display").show();
663                $('#footer_display').slideDown("fast");
664            } else {
665                $("#footer_display").show();
666                $('#footer_display').slideUp("fast");
667            }
668        });
669    }
670	*/
671    /*
672	if($("#footer_display").length > 0){
673        $("#footer_display").hide();
674        var $win = $(window);
675        var windowWidth = $win.width();
676        if (windowWidth > 1024) {
677		// PCの処理
678		} else if (windowWidth > 768) {
679		// TABの処理
680		} else {
681		// SPの処理
682			$(window).on("scroll", function() {
683				scrollHeight = $(document).height();
684				scrollPosition = $(window).height() + $(window).scrollTop();
685				footHeight = 200;
686				if ($(this).scrollTop() > 200 && scrollHeight - scrollPosition > footHeight) {
687					$('#footer_display').slideDown("fast");
688		        } else {
689		            $('#footer_display').slideUp("fast");
690		        }
691			});
692		}
693    }*/
694
695
696
697    _w = $(window).width();
698    _h = window.innerHeight ? window.innerHeight : $(window).height();
699    _scroll = $(this).scrollTop();
700    _scroll_old = 0;
701
702
703    $(window).scroll(function() {
704        _scroll = $(this).scrollTop();
705        //console.log("_scroll",_scroll);
706        if (_w < 560) {
707            if (_scroll > 525) {
708                if ($('.search_mordal__block').is(':visible')) {
709
710                } else {
711                    $(".fixed_narrow_down__block").fadeIn(200);
712                }
713
714            } else {
715                if ($('.search_mordal__block').is(':visible')) {
716
717                } else {
718                    $(".fixed_narrow_down__block").fadeOut(200);
719                }
720
721            }
722        }
723
724        /*
725        if(_w < 560){
726          if(_scroll_old > _scroll){
727            //console.log("dl");
728            $("header").css(cssTransitionArr(['transform 0.16s cubic-bezier(0.45, 0, 0.55, 1) 0s'])).css(transitionXY(0,0));
729          }else{
730            //console.log("up");
731            $("header").css(cssTransitionArr(['transform 0.16s cubic-bezier(0.45, 0, 0.55, 1) 0s'])).css(transitionXY(0,-65));
732          }
733        }
734        */
735
736        _scroll_old = _scroll;
737    })
738
739
740    var beforePos = 0; //スクロールの値の比較用の設定
741
742    //スクロール途中でヘッダーが消え、上にスクロールすると復活する設定を関数にまとめる
743    function ScrollAnime() {
744        var elemTop = 300; //#area-2の位置まできたら
745        var scroll = $(window).scrollTop();
746        //ヘッダーの出し入れをする
747        if (scroll == beforePos) {
748            //IE11対策で処理を入れない
749        } else if (elemTop > scroll || 0 > scroll - beforePos) {
750            //ヘッダーが上から出現する
751            $('header').removeClass('UpMove'); //#headerにUpMoveというクラス名を除き
752            $('header').addClass('DownMove'); //#headerにDownMoveのクラス名を追加
753        } else {
754            //ヘッダーが上に消える
755            $('header').removeClass('DownMove'); //#headerにDownMoveというクラス名を除き
756            $('header').addClass('UpMove'); //#headerにUpMoveのクラス名を追加
757        }
758
759        beforePos = scroll; //現在のスクロール値を比較用のbeforePosに格納
760    }
761
762
763    // 画面をスクロールをしたら動かしたい場合の記述
764    $(window).scroll(function() {
765        ScrollAnime(); //スクロール途中でヘッダーが消え、上にスクロールすると復活する関数を呼ぶ
766    });
767
768    // ページが読み込まれたらすぐに動かしたい場合の記述
769    $(window).on('load', function() {
770        ScrollAnime(); //スクロール途中でヘッダーが消え、上にスクロールすると復活する関数を呼ぶ
771    });
772
773
774    $(window).on("resize", function() {
775        _w = $(window).width();
776        _h = window.innerHeight ? window.innerHeight : $(window).height();
777
778
779    });
780
781
782});
783
784
785
786/* --------------------------------*
787 * CSS3
788 * --------------------------------*/
789function transformOrigin(x, y) {
790    var origin = x + " " + y;
791    return {
792        "-webkit-transform-origin": origin,
793        "-moz-transform-origin": origin,
794        "-o-transform-origin": origin,
795        "-ms-transform-origin": origin,
796        "transform-origin": origin
797    };
798}
799
800function cssRotate(x, y) {
801    var css3 = 'rotateX(' + x + 'deg) rotateY(' + y + 'deg)';
802    return {
803        '-webkit-transform': css3,
804        '-moz-transform': css3,
805        '-o-transform': css3,
806        '-ms-transform': css3,
807        'transform': css3
808    };
809}
810
811function cssRotate2(x) {
812    var css3 = 'rotate(' + x + 'deg)';
813    return {
814        '-webkit-transform': css3,
815        '-moz-transform': css3,
816        '-o-transform': css3,
817        '-ms-transform': css3,
818        'transform': css3
819    };
820}
821
822function cssTransition(duration, easing) {
823    var css = duration + 's' + ' cubic-bezier(' + easing + ') ';
824    return {
825        '-webkit-transition': css,
826        '-moz-transition': css,
827        '-o-transition': css,
828        '-ms-transition': css,
829        'transition': css
830    };
831}
832
833function cssTransitionArr(arr) {
834    var css = arr;
835    return {
836        '-webkit-transition': css,
837        '-moz-transition': css,
838        '-o-transition': css,
839        '-ms-transition': css,
840        'transition': css
841    };
842}
843
844function cssTransitionP(property) {
845    return {
846        '-webkit-transition-property': property,
847        '-moz-transition-property': property,
848        '-o-transition-property': property,
849        '-ms-transition-property': property,
850        'transition-property': property
851    };
852}
853
854function transitionDR(duration) {
855    return {
856        '-webkit-transition-duration': duration + 's',
857        '-moz-transition-duration': duration + 's',
858        '-o-transition-duration': duration + 's',
859        '-ms-transition-duration': duration + 's',
860        'transition-duration': duration + 's'
861    };
862}
863
864function transitionDL(delay) {
865    return {
866        '-webkit-transition-delay': delay + 's',
867        '-moz-transition-delay': delay + 's',
868        '-o-transition-delay': delay + 's',
869        '-ms-transition-delay': delay + 's',
870        'transition-delay': delay + 's'
871    };
872}
873
874function transitionXY(x, y) {
875    var css3 = 'translateX(' + x + 'px) translateY(' + y + 'px)';
876    return {
877        '-webkit-transform': css3,
878        '-moz-transform': css3,
879        '-o-transform': css3,
880        '-ms-transform': css3,
881        'transform': css3
882    };
883}
884
885function transitionXYZ(x, y, z) {
886    var css3 = 'translateX(' + x + 'px) translateY(' + y + 'px) translateZ(' + z + 'px)';
887    return {
888        '-webkit-transform': css3,
889        '-moz-transform': css3,
890        '-o-transform': css3,
891        '-ms-transform': css3,
892        'transform': css3
893    };
894}
895
896function transitionScale(x, y) {
897    var css3 = 'scale(' + x + ',' + y + ')';
898    return {
899        '-webkit-transform': css3,
900        '-moz-transform': css3,
901        '-o-transform': css3,
902        '-ms-transform': css3,
903        'transform': css3
904    };
905}
906
907
908function brightness(a) {
909    var css3 = 'brightness(a)';
910    return {
911        '-webkit-filter': css3,
912        '-moz-filter': css3,
913        '-o-filter': css3,
914        '-ms-filter': css3,
915        'filter': css3
916    };
917}

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.