PageSourceSearch

https://tutujien.net/wp-content/themes/tutujien/js/base.js?ver=1.0.0

js tutujien.net collected 2026-10-07 00:18:21 UTC 23,134 bytes, 547 lines download raw bytes

vendor: 4,502 bytes, lines 1-18
1/* ----------------------------------------------------------------------
2 object-fit画像のサイズを調整するjs
3---------------------------------------------------------------------- */
4/*! npm.im/object-fit-images 3.2.4 */
5var objectFitImages = function () { "use strict"; function t(t, e) { return "data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='" + t + "' height='" + e + "'%3E%3C/svg%3E" } function e(t) { if (t.srcset && !p && window.picturefill) { var e = window.picturefill._; t[e.ns] && t[e.ns].evaled || e.fillImg(t, { reselect: !0 }), t[e.ns].curSrc || (t[e.ns].supported = !1, e.fillImg(t, { reselect: !0 })), t.currentSrc = t[e.ns].curSrc || t.src } } function i(t) { for (var e, i = getComputedStyle(t).fontFamily, r = {}; null !== (e = u.exec(i));)r[e[1]] = e[2]; return r } function r(e, i, r) { var n = t(i || 1, r || 0); b.call(e, "src") !== n && h.call(e, "src", n) } function n(t, e) { t.naturalWidth ? e(t) : setTimeout(n, 100, t, e) } function c(t) { var c = i(t), o = t[l]; if (c["object-fit"] = c["object-fit"] || "fill", !o.img) { if ("fill" === c["object-fit"]) return; if (!o.skipTest && f && !c["object-position"]) return } if (!o.img) { o.img = new Image(t.width, t.height), o.img.srcset = b.call(t, "data-ofi-srcset") || t.srcset, o.img.src = b.call(t, "data-ofi-src") || t.src, h.call(t, "data-ofi-src", t.src), t.srcset && h.call(t, "data-ofi-srcset", t.srcset), r(t, t.naturalWidth || t.width, t.naturalHeight || t.height), t.srcset && (t.srcset = ""); try { s(t) } catch (t) { window.console && console.warn("https://bit.ly/ofi-old-browser") } } e(o.img), t.style.backgroundImage = 'url("' + (o.img.currentSrc || o.img.src).replace(/"/g, '\\"') + '")', t.style.backgroundPosition = c["object-position"] || "center", t.style.backgroundRepeat = "no-repeat", t.style.backgroundOrigin = "content-box", /scale-down/.test(c["object-fit"]) ? n(o.img, function () { o.img.naturalWidth > t.width || o.img.naturalHeight > t.height ? t.style.backgroundSize = "contain" : t.style.backgroundSize = "auto" }) : t.style.backgroundSize = c["object-fit"].replace("none", "auto").replace("fill", "100% 100%"), n(o.img, function (e) { r(t, e.naturalWidth, e.naturalHeight) }) } function s(t) { var e = { get: function (e) { return t[l].img[e ? e : "src"] }, set: function (e, i) { return t[l].img[i ? i : "src"] = e, h.call(t, "data-ofi-" + i, e), c(t), e } }; Object.defineProperty(t, "src", e), Object.defineProperty(t, "currentSrc", { get: function () { return e.get("currentSrc") } }), Object.defineProperty(t, "srcset", { get: function () { return e.get("srcset") }, set: function (t) { return e.set(t, "srcset") } }) } function o() { function t(t, e) { return t[l] && t[l].img && ("src" === e || "srcset" === e) ? t[l].img : t } d || (HTMLImageElement.prototype.getAttribute = function (e) { return b.call(t(this, e), e) }, HTMLImageElement.prototype.setAttribute = function (e, i) { return h.call(t(this, e), e, String(i)) }) } function a(t, e) { var i = !y && !t; if (e = e || {}, t = t || "img", d && !e.skipTest || !m) return !1; "img" === t ? t = document.getElementsByTagName("img") : "string" == typeof t ? t = document.querySelectorAll(t) : "length" in t || (t = [t]); for (var r = 0; r < t.length; r++)t[r][l] = t[r][l] || { skipTest: e.skipTest }, c(t[r]); i && (document.body.addEventListener("load", function (t) { "IMG" === t.target.tagName && a(t.target, { skipTest: e.skipTest }) }, !0), y = !0, t = "img"), e.watchMQ && window.addEventListener("resize", a.bind(null, t, { skipTest: e.skipTest })) } var l = "fregante:object-fit-images", u = /(object-fit|object-position)\s*:\s*([-.\w\s%]+)/g, g = "undefined" == typeof Image ? { style: { "object-position": 1 } } : new Image, f = "object-fit" in g.style, d = "object-position" in g.style, m = "background-size" in g.style, p = "string" == typeof g.currentSrc, b = g.getAttribute, h = g.setAttribute, y = !1; return a.supportsObjectFit = f, a.supportsObjectPosition = d, o(), a }();
6
7$(function () {
8  objectFitImages();
9});
10/* ----------------------------------------------------------------------
11カテゴリーの編集画面で画像がアップロードできるようにする
12---------------------------------------------------------------------- */
13(function ($) {
14  $(function () {
15    $('#upload_image_button').click(function () {
16      formfield = $('#upload_image').attr('name');
17      tb_show('', 'media-upload.php?type=image&post_id=&TB_iframe=true');
18      return false;
19    });
20    window.send_to_editor = function (html) {
21      imgurl = $('img', html).attr('src');
22      $('#upload_image').val(imgurl);
23      tb_remove();
24    }
25  });
26})(jQuery);
27/* ----------------------------------------------------------------------
28 SP画面対策 画面高さの取得し、top_fvに付与
29---------------------------------------------------------------------- */
30$(document).ready(function(){
31  var hSize = $(window).height();
32    $('.top_page , .sp_navi').height(hSize); // アドレスバーを除いたサイズを付与
33  });
34  $(window).resize(function(){ // ページをリサイズした時の処理
35  var hSize = $(window).height();
36    $('.top_page , .sp_navi').height(hSize); // アドレスバーを除いたサイズを付与
37  });
38/* ----------------------------------------------------------------------
39ハンバガーメニューの動き
40---------------------------------------------------------------------- */
41$(function(){
42  $(".ham_btn").on("click",function(){
43    $(this).toggleClass("top_hdr_ham_btn_move");
44    $(".sp_navi").toggleClass("top_hdr_sp_navi_move");
45  })
46})
47$(document).on('click',function(e) {
48  if(!$(e.target).closest('.sp_navi , .ham_btn').length) {
49  // ターゲット要素の外側をクリックした時の操作
50  $(".sp_navi").removeClass("top_hdr_sp_navi_move");
51  $(".ham_btn").removeClass("top_hdr_ham_btn_move");
52  $(".screen_all").css({display: "none"});
53  } else {
54  // ターゲット要素をクリックした時の操作
55  }
56});
57/* ----------------------------------------------------------------------
58 ハンバガーメニュー 途中から黒くなる
59---------------------------------------------------------------------- */
60$(window).scroll(function () {
61  if($(window).scrollTop() > 600) {
62    $('.ham_btn').addClass('ham_btn_scroll_move');
63  } else {
64    $('.ham_btn').removeClass('ham_btn_scroll_move');
65  }
66});
67/* ----------------------------------------------------------------------
68 サイドバーカテゴリーのプルダウンの動き
69---------------------------------------------------------------------- */
70$(function () {
71  const down = $("<div>").text("").addClass("down_box");
72  $('.sidebar ul li ul li').parent().before(down);
73  $(".sidebar .down_box").on("click", function () {
74    $(this).next("ul").slideToggle();
75  });
76});
77/* ----------------------------------------------------------------------
78 テキストアニメーション (要素が出現したら)
79---------------------------------------------------------------------- */
80// 0.7秒
81$(window).on('scroll', function () {
82
83  var text_in_07s = $('.text_in_07s');
84  var isAnimate = 'isAnimate';
85
86  text_in_07s.each(function () {
87
88    var text_in_07sOffset = $(this).offset().top;
89    var scrollPos = $(window).scrollTop();
90    var wh = $(window).height();
91
92    if (scrollPos > text_in_07sOffset - wh + (wh / 5)) {
93      $(this).addClass(isAnimate);
94    }
95  });
96
97});
98// 1秒
99$(window).on('scroll', function () {
100
101  var text_in_1s = $('.text_in_1s');
102  var isAnimate = 'isAnimate';
103
104  text_in_1s.each(function () {
105
106    var text_in_1sOffset = $(this).offset().top;
107    var scrollPos = $(window).scrollTop();
108    var wh = $(window).height();
109
110    if (scrollPos > text_in_1sOffset - wh + (wh / 5)) {
111      $(this).addClass(isAnimate);
112    }
113  });
114
115});
116/* ----------------------------------------------------------------------
117 データが読み込まれたら
118---------------------------------------------------------------------- */
119window.onload = function () {
120  // ローディングアニメーション 
121  const spinner = document.getElementById('loading');
122  spinner.classList.add('loaded');
123  setTimeout(function () {//ローディングが終わってから1.4秒後
124    $("main").css({ opacity: "1" });
125  }, 500);
126  // テキストなどのfade_up
127  setTimeout(function () {//ローディングが終わってから1.8秒後
128    $(".fade_up_5s,.fade_up_10s,.fade_up_15s,.fade_up_18s,.fade_up_20s").addClass("isAnimate_02");
129  }, 800);
130
131};
132/* ----------------------------------------------------------------------
133 よくある質問
134---------------------------------------------------------------------- */
135$(function () {
136  $(".q-a_no_002 .conts dt").on("click", function () {
137    $(this).toggleClass("q-a_no_002_move");
138    $("+dd", this).slideToggle();
139  });
140});
141/* ----------------------------------------------------------------------
142 トップに戻るボタン
143---------------------------------------------------------------------- */
144$(function () {
145  $("#return_top").on("click", function () {
146    $('html, body').animate({ scrollTop: 0 }, 1500);
147  });
148});
149$(function () {
150  $(window).scroll(function () {
151    var doch = $(document).innerHeight(); //ページ全体の高さ
152    if ($(this).scrollTop() > 1000) {  //600pxスクロールしたら表示
153      $("#return_top").addClass("return_top_move");
154    } else {
155      $("#return_top").removeClass("return_top_move");
156    }
157  });
158});
159/* ----------------------------------------------------------------------
160 SPスクロールしてもついてくる、フッターアクションボタン
161---------------------------------------------------------------------- */
162$(function () {
163  $(window).scroll(function () {
164    var doch = $(document).innerHeight(); //ページ全体の高さ
165    if ($(this).scrollTop() > 600) {  //600pxスクロールしたら表示
166      $(".action_ftr_sp_001").addClass("action_ftr_sp_001_move");
167    } else {
168      $(".action_ftr_sp_001").removeClass("action_ftr_sp_001_move");
169    }
170  });
171});
172/* ----------------------------------------------------------------------
173 ハイフンを消す
174---------------------------------------------------------------------- */
175$(function () {
176  var $slack = $(" #slack").text();
177  var result = $slack.replace("-", " ");
178  $("#slack").text(result);
179});
180
181
182/* ----------------------------------------------------------------------
183タグ切り替えアーカイブ
184---------------------------------------------------------------------- */
185$(document).ready(function () {
186  /**
187   * @param items		1ページあたりの最大表示数(省略時の初期値は 5 )
188   * @param contents	タブコンテンツのクラス名(省略時の初期値は 'contents' )
189   * @param time		ページ切り替え時のフェードイン時間(省略時の初期値は 800 )
190   * @param previous	前のページに1つ戻るナビゲーションのテキスト(省略時の初期値は 'Previous&raquo;' )
191   * @param next		次のページに1つ進むナビゲーションのテキスト(省略時の初期値は '&laquo;Next' )
192   * @param start		初期ロード時のタブ開始位置(省略時の初期値は 1 )
193   * @param position	ページナビゲーションの表示位置( 'top' または 'bottom' を指定可能で省略時の初期値は 'bottom' )
194   * @param scroll	スクロール位置を保持( true または false を指定可能で省略時の初期値は true )
195   */
196  $("#tab").tabpager({
197    items: 6,
198    contents: 'contents',
199    //time: 300,
200    previous: '<i class="fas fa-chevron-left"></i>',
201    next: '<i class="fas fa-chevron-right"></i>',
202    //start: 1,
203    position: 'bottom',
204    //scroll: true
205  });
206});
207
208/* ----------------------------------------------------------------------
209商品案内 もっと見るボタン
210---------------------------------------------------------------------- */
211const defaultDispCnt = 15; // 初期表示件数
212const addDispCnt = 3;     // 追加表示件数
213
214(function ($) {
215  $(function () {
216    let maxDispCnt = 0;     // 最大表示件数
217    let currentDispCnt = 0; // 現在の表示件数
218    let in_cont_01 = $('#in_cont_01').children('.item'); // 一覧のli子要素をすべて取得
219    // 一覧の初期表示
220    $(in_cont_01).each(function (i, elem) {
221      // 初期表示件数のみ表示
222      if (i < defaultDispCnt) {
223        $(this).show();
224        currentDispCnt++;
225      }
226      maxDispCnt++;
227      // もっと見るボタンを表示
228      let displayed = 0;
229      if (maxDispCnt > currentDispCnt && !displayed) {
230        $('.readMoreBtn_01').show();
231        displayed = 1;
232      }
233    });
234    // もっと見るボタンクリックイベント
235    $('.readMoreBtn_01').click(function () {
236      let newCount = currentDispCnt + addDispCnt; // 新しく表示する件数
237      // 新しく表示する件数のみ表示
238      $(in_cont_01).each(function (i, elem) {
239        if (currentDispCnt <= i && i < newCount) {
240          $(this).show();
241          currentDispCnt++;
242        }
243      });
244      // もっと見るボタンを非表示
245      if (maxDispCnt <= newCount) {
246        $(this).hide();
247      }
248      return false;
249    });
250  });
251}(jQuery));
252
253// 2つ目
254(function ($) {
255  $(function () {
256    let maxDispCnt_02 = 0;     // 最大表示件数
257    let currentDispCnt_02 = 0; // 現在の表示件数
258    let in_cont_02 = $('#in_cont_02').children('.item'); // 一覧のli子要素をすべて取得
259    // 一覧の初期表示
260    $(in_cont_02).each(function (i, elem) {
261      // 初期表示件数のみ表示
262      if (i < defaultDispCnt) {
263        $(this).show();
264        currentDispCnt_02++;
265      }
266      maxDispCnt_02++;
267      // もっと見るボタンを表示
268      let displayed_02 = 0;
269      if (maxDispCnt_02 > currentDispCnt_02 && !displayed_02) {
270        $('.readMoreBtn_02').show();
271        displayed_02 = 1;
272      }
273    });
274    // もっと見るボタンクリックイベント
275    $('.readMoreBtn_02').click(function () {
276      let newCount_02 = currentDispCnt_02 + addDispCnt; // 新しく表示する件数
277      // 新しく表示する件数のみ表示
278      $(in_cont_02).each(function (i, elem) {
279        if (currentDispCnt_02 <= i && i < newCount_02) {
280          $(this).show();
281          currentDispCnt_02++;
282        }
283      });
284      // もっと見るボタンを非表示
285      if (maxDispCnt_02 <= newCount_02) {
286        $(this).hide();
287      }
288      return false;
289    });
290  });
291}(jQuery));
292
293// 3つ目
294(function ($) {
295  $(function () {
296    let maxDispCnt_03 = 0;     // 最大表示件数
297    let currentDispCnt_03 = 0; // 現在の表示件数
298    let in_cont_03 = $('#in_cont_03').children('.item'); // 一覧のli子要素をすべて取得
299    // 一覧の初期表示
300    $(in_cont_03).each(function (i, elem) {
301      // 初期表示件数のみ表示
302      if (i < defaultDispCnt) {
303        $(this).show();
304        currentDispCnt_03++;
305      }
306      maxDispCnt_03++;
307      // もっと見るボタンを表示
308      let displayed_03 = 0;
309      if (maxDispCnt_03 > currentDispCnt_03 && !displayed_03) {
310        $('.readMoreBtn_03').show();
311        displayed_03 = 1;
312      }
313    });
314    // もっと見るボタンクリックイベント
315    $('.readMoreBtn_03').click(function () {
316      let newCount_03 = currentDispCnt_03 + addDispCnt; // 新しく表示する件数
317      // 新しく表示する件数のみ表示
318      $(in_cont_03).each(function (i, elem) {
319        if (currentDispCnt_03 <= i && i < newCount_03) {
320          $(this).show();
321          currentDispCnt_03++;
322        }
323      });
324      // もっと見るボタンを非表示
325      if (maxDispCnt_03 <= newCount_03) {
326        $(this).hide();
327      }
328      return false;
329    });
330  });
331}(jQuery));
332
333
334// 4つ目
335(function ($) {
336  $(function () {
337    let maxDispCnt_04 = 0;     // 最大表示件数
338    let currentDispCnt_04 = 0; // 現在の表示件数
339    let in_cont_04 = $('#in_cont_04').children('.item'); // 一覧のli子要素をすべて取得
340    // 一覧の初期表示
341    $(in_cont_04).each(function (i, elem) {
342      // 初期表示件数のみ表示
343      if (i < defaultDispCnt) {
344        $(this).show();
345        currentDispCnt_04++;
346      }
347      maxDispCnt_04++;
348      // もっと見るボタンを表示
349      let displayed_04 = 0;
350      if (maxDispCnt_04 > currentDispCnt_04 && !displayed_04) {
351        $('.readMoreBtn_04').show();
352        displayed_04 = 1;
353      }
354    });
355    // もっと見るボタンクリックイベント
356    $('.readMoreBtn_04').click(function () {
357      let newCount_04 = currentDispCnt_04 + addDispCnt; // 新しく表示する件数
358      // 新しく表示する件数のみ表示
359      $(in_cont_04).each(function (i, elem) {
360        if (currentDispCnt_04 <= i && i < newCount_04) {
361          $(this).show();
362          currentDispCnt_04++;
363        }
364      });
365      // もっと見るボタンを非表示
366      if (maxDispCnt_04 <= newCount_04) {
367        $(this).hide();
368      }
369      return false;
370    });
371  });
372}(jQuery));
373
374// 5つ目
375(function ($) {
376  $(function () {
377    let maxDispCnt_05 = 0;     // 最大表示件数
378    let currentDispCnt_05 = 0; // 現在の表示件数
379    let in_cont_05 = $('#in_cont_05').children('.item'); // 一覧のli子要素をすべて取得
380    // 一覧の初期表示
381    $(in_cont_05).each(function (i, elem) {
382      // 初期表示件数のみ表示
383      if (i < defaultDispCnt) {
384        $(this).show();
385        currentDispCnt_05++;
386      }
387      maxDispCnt_05++;
388      // もっと見るボタンを表示
389      let displayed_05 = 0;
390      if (maxDispCnt_05 > currentDispCnt_05 && !displayed_05) {
391        $('.readMoreBtn_05').show();
392        displayed_05 = 1;
393      }
394    });
395    // もっと見るボタンクリックイベント
396    $('.readMoreBtn_05').click(function () {
397      let newCount_05 = currentDispCnt_05 + addDispCnt; // 新しく表示する件数
398      // 新しく表示する件数のみ表示
399      $(in_cont_05).each(function (i, elem) {
400        if (currentDispCnt_05 <= i && i < newCount_05) {
401          $(this).show();
402          currentDispCnt_05++;
403        }
404      });
405      // もっと見るボタンを非表示
406      if (maxDispCnt_05 <= newCount_05) {
407        $(this).hide();
408      }
409      return false;
410    });
411  });
412}(jQuery));
413
414// 6つ目
415(function ($) {
416  $(function () {
417    let maxDispCnt_06 = 0;     // 最大表示件数
418    let currentDispCnt_06 = 0; // 現在の表示件数
419    let in_cont_06 = $('#in_cont_06').children('.item'); // 一覧のli子要素をすべて取得
420    // 一覧の初期表示
421    $(in_cont_06).each(function (i, elem) {
422      // 初期表示件数のみ表示
423      if (i < defaultDispCnt) {
424        $(this).show();
425        currentDispCnt_06++;
426      }
427      maxDispCnt_06++;
428      // もっと見るボタンを表示
429      let displayed_06 = 0;
430      if (maxDispCnt_06 > currentDispCnt_06 && !displayed_06) {
431        $('.readMoreBtn_06').show();
432        displayed_06 = 1;
433      }
434    });
435    // もっと見るボタンクリックイベント
436    $('.readMoreBtn_06').click(function () {
437      let newCount_06 = currentDispCnt_06 + addDispCnt; // 新しく表示する件数
438      // 新しく表示する件数のみ表示
439      $(in_cont_06).each(function (i, elem) {
440        if (currentDispCnt_06 <= i && i < newCount_06) {
441          $(this).show();
442          currentDispCnt_06++;
443        }
444      });
445      // もっと見るボタンを非表示
446      if (maxDispCnt_06 <= newCount_06) {
447        $(this).hide();
448      }
449      return false;
450    });
451  });
452}(jQuery));
453
454// 7つ目
455(function ($) {
456  $(function () {
457    let maxDispCnt_07 = 0;     // 最大表示件数
458    let currentDispCnt_07 = 0; // 現在の表示件数
459    let in_cont_07 = $('#in_cont_07').children('.item'); // 一覧のli子要素をすべて取得
460    // 一覧の初期表示
461    $(in_cont_07).each(function (i, elem) {
462      // 初期表示件数のみ表示
463      if (i < defaultDispCnt) {
464        $(this).show();
465        currentDispCnt_07++;
466      }
467      maxDispCnt_07++;
468      // もっと見るボタンを表示
469      let displayed_07 = 0;
470      if (maxDispCnt_07 > currentDispCnt_07 && !displayed_07) {
471        $('.readMoreBtn_07').show();
472        displayed_07 = 1;
473      }
474    });
475    // もっと見るボタンクリックイベント
476    $('.readMoreBtn_07').click(function () {
477      let newCount_07 = currentDispCnt_07 + addDispCnt; // 新しく表示する件数
478      // 新しく表示する件数のみ表示
479      $(in_cont_07).each(function (i, elem) {
480        if (currentDispCnt_07 <= i && i < newCount_07) {
481          $(this).show();
482          currentDispCnt_07++;
483        }
484      });
485      // もっと見るボタンを非表示
486      if (maxDispCnt_07 <= newCount_07) {
487        $(this).hide();
488      }
489      return false;
490    });
491  });
492}(jQuery));
493
494// 8つ目
495(function ($) {
496  $(function () {
497    let maxDispCnt_08 = 0;     // 最大表示件数
498    let currentDispCnt_08 = 0; // 現在の表示件数
499    let in_cont_08 = $('#in_cont_08').children('.item'); // 一覧のli子要素をすべて取得
500    // 一覧の初期表示
501    $(in_cont_08).each(function (i, elem) {
502      // 初期表示件数のみ表示
503      if (i < defaultDispCnt) {
504        $(this).show();
505        currentDispCnt_08++;
506      }
507      maxDispCnt_08++;
508      // もっと見るボタンを表示
509      let displayed_08 = 0;
510      if (maxDispCnt_08 > currentDispCnt_08 && !displayed_08) {
511        $('.readMoreBtn_08').show();
512        displayed_08 = 1;
513      }
514    });
515    // もっと見るボタンクリックイベント
516    $('.readMoreBtn_08').click(function () {
517      let newCount_08 = currentDispCnt_08 + addDispCnt; // 新しく表示する件数
518      // 新しく表示する件数のみ表示
519      $(in_cont_08).each(function (i, elem) {
520        if (currentDispCnt_08 <= i && i < newCount_08) {
521          $(this).show();
522          currentDispCnt_08++;
523        }
524      });
525      // もっと見るボタンを非表示
526      if (maxDispCnt_08 <= newCount_08) {
527        $(this).hide();
528      }
529      return false;
530    });
531  });
532}(jQuery));
533
534/* ----------------------------------------------------------------------
535つつじの楽しみ方ページ タブ切り替え
536---------------------------------------------------------------------- */
537$(function() {
538  let tabs = $(".enjoying_page .tab"); // tabのクラスを全て取得し、変数tabsに配列で定義
539  $(".enjoying_page .tab").on("click", function() { // tabをクリックしたらイベント発火
540    $(".tab_active").removeClass("tab_active"); // activeクラスを消す
541    $(this).addClass("tab_active"); // クリックした箇所にactiveクラスを追加
542    const index = tabs.index(this); // クリックした箇所がタブの何番目か判定し、定数indexとして定義
543    $(".content").removeClass("tab_show").eq(index).addClass("tab_show"); // showクラスを消して、contentクラスのindex番目にshowクラスを追加
544  })
545})
546
547

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.