PageSourceSearch

https://taka8rie.com/themes/taka8rie/_assets/js/common.js?25052601

js taka8rie.com collected 2026-09-25 05:21:44 UTC 13,641 bytes, 419 lines download raw bytes

1/*
2 * morimiharu-official.com
3 * update 2023.7.6 release
4 */
5jQuery.noConflict();
6(function ($) {
7  $(function () {
8    //pagetop
9    $('a[href^="#"]:not(.notanc)').click(function () {
10      var speed = 500;
11      var href = $(this).attr("href");
12      var target = $(href == "#" || href == "" ? "html" : href);
13      var position = target.offset().top;
14      $("body,html").animate({ scrollTop: position }, speed, "swing");
15      return false;
16    });
17    //main slick
18    $(".tr__main--slider").slick({
19      autoplay: true,
20      autoplaySpeed: 5000,
21      speed: 1200,
22      dots: false,
23      slidesToShow: 1,
24      slidesToScroll: 1,
25      arrows: false,
26      fade: true,
27    });
28    //banner slick
29    $(".tr__banner--slider").slick({
30      autoplay: true,
31      autoplaySpeed: 5000,
32      speed: 1200,
33      dots: true,
34      slidesToShow: 3,
35      slidesToScroll: 1,
36      // centerMode: true,
37      // centerPadding: "25%",
38      arrows: false,
39      fade: false,
40      responsive: [
41        {
42          breakpoint: 768, //767px以下のサイズに適用
43          settings: {
44            // slidesToShow: 1,
45            slidesToShow: 1,
46            slidesToScroll: 1,
47            centerMode: true,
48            centerPadding: "10%",
49          },
50        },
51      ],
52    });
53    //fc slick
54    $(".tr__archive--slider").each(function (index) {
55      // console.log($(this).find('li').length);
56      if ($(this).find("li").length > 1) {
57        $(this).slick({
58          autoplay: true,
59          autoplaySpeed: 10000,
60          speed: 750,
61          dots: false,
62          slidesToShow: 1,
63          slidesToScroll: 1,
64          centerMode: false,
65          arrows: true,
66          fade: false,
67          adaptiveHeight: true,
68        });
69      }
70      // $(this).text("リスト" + index);
71    });
72    // if ($(".tr__archive--slider").length > 1) {
73    //   console.log($(".tr__archive--slider").length);
74
75    // }
76    //menu
77    var state = false;
78    var pos;
79    $("#jsmenu").on("click", function () {
80      if (state == false) {
81        pos = $(window).scrollTop();
82        $(this).addClass("open");
83        $("body").addClass("open");
84        $("body").addClass("scroll-prevent");
85        // $(".tr__spmenu").addClass("open");
86        state = true;
87      } else {
88        $(this).removeClass("open");
89        $("body").removeClass("open");
90        $("body").removeClass("scroll-prevent");
91        // $(".tr__spmenu").removeClass("open");
92        window.scrollTo(0, pos);
93        state = false;
94      }
95    });
96    $("#fcmenu").on("mouseover click", function () {
97      $(this).parent().toggleClass("is-active");
98      $(".tr__header--fcmenu").toggleClass("is-active");
99    });
100    $("#fcmenucontents").on("mouseleave click", function () {
101      $("#fcmenu").parent().removeClass("is-active");
102      $(".tr__header--fcmenu").removeClass("is-active");
103    });
104    // $(".tr__spmenu a").on("click", function () {
105    //   $("#jsmenu").removeClass("open");
106
107    //   $("body").removeClass("open");
108    //   $(".tr__spmenu").removeClass("open");
109    // });
110
111    // $("#fcopen").on("mouseover", function () {
112    //   $(this).next().addClass("open");
113    // });
114    // $(".tr__header--navFc-menu").on("mouseleave", function () {
115    //   $(this).removeClass("open");
116    // });
117
118    //table sp調整用
119    if ($(".table-type-sp").length > 0) {
120      var tharrayAll = [];
121      $(".table-type-sp").each(function (i, e) {
122        var tharray = [];
123        $(this)
124          .find("thead tr th")
125          .each(function (j, e) {
126            tharray[j] = $(this).text();
127          });
128        tharrayAll[i] = tharray;
129        // console.log(tharrayAll[i]);
130        $(this)
131          .find("tbody tr")
132          .each(function (k, e) {
133            $(this)
134              .find("td")
135              .each(function (l, e) {
136                // console.log($(this).html());
137                var _v = $(this).html();
138                $(this).html('<span class="th">' + tharrayAll[i][l] + '</span><span class="td">' + _v + "</span>");
139              });
140          });
141      });
142    }
143
144    //addclass
145    $(window).scroll(function () {
146      $(".fc__effect").each(function () {
147        var hit = $(this).offset().top;
148        var scroll = $(window).scrollTop();
149        var wHeight = $(window).height();
150        var customTop = wHeight - 100;
151
152        let stateid = "";
153        if (typeof $(this).attr("id") !== "undefined") {
154          // data-effect="任意の値" が設定されている場合
155          // customTop = $(this).data('effect');
156        }
157        if (hit + customTop < wHeight + scroll) {
158          // console.log($(this).attr('id'));
159          stateid = $(this).attr("data-idnum");
160          $(".tr__layout--right--menu").attr("data-state", stateid);
161        }
162      });
163    });
164
165    //load
166    $(window).on("load", function () {
167      $("body,html").animate({ scrollTop: 0 }, 0, "swing");
168      $("body").removeClass("preload");
169
170      // $('.tr__loading').delay(20000).addClass('loadok');
171
172      //hash
173      let hash = location.hash;
174      console.log(hash);
175      if (hash) {
176        var speed = 0;
177        var href = hash;
178        var target = $(href == "#" || href == "" ? "html" : href);
179        var position = target.offset().top - 180;
180        $("body,html").animate({ scrollTop: position }, speed, "swing");
181      }
182
183      //submitをwrap
184      $('form input[type="submit"]').each(function (index) {
185        $(this).wrap('<div class="btn-submit">');
186      });
187
188      //マウスストーカー
189      let mouse = $(".tr__archive--listItem--pcimage");
190      $(document).on("mousemove", function (e) {
191        const x = e.clientX + 30;
192        const y = e.clientY + 30;
193        mouse.css({
194          transform: "translate(" + x + "px," + y + "px)",
195        });
196      });
197
198      //adobe font ready
199      setTimeout(function () {
200        if (document.getElementsByTagName("html")[0].classList.contains("wf-active") != true) {
201          document.getElementsByTagName("html")[0].classList.add("loading-delay");
202        }
203      }, 5000);
204    });
205  });
206
207  //formcheck confirm for form_check
208  let $form = $("#form_check");
209  let formcheckflag = false;
210  let formremodal = $("[data-remodal-id=formmodal]").remodal();
211  $("#form_check").on("submit", function (e) {
212    e.preventDefault();
213    if (!formcheckflag) {
214      let query = $form.serialize();
215      let param = $form.serializeArray();
216      var _html = "";
217      $.each(param, function (i, v) {
218        if (v.name != "access_token" && v.name != "ETBR_ID" && v.name != "email") {
219          _html += "<dl><dt>" + v.name + "</dt><dd>" + v.value.replace(/\n/g, "<br>") + "</dd></dl>";
220        }
221      });
222      $(".confirm_check").html(_html);
223      $("#form_send")
224        .off("click")
225        .on("click", function () {
226          formcheckflag = true;
227          $("#form_check").submit();
228        });
229      formremodal.open();
230    } else {
231      let query = $form.serialize();
232      $.ajax({
233        type: "POST",
234        url: "/mailsend/",
235        data: query,
236        success: function (data) {
237          console.log("success:" + data);
238        },
239        error: function (xhr, status, error) {
240          console.log("error:" + error);
241        },
242      });
243    }
244  });
245
246  // formcheck confirm for form_check2
247  let $form2 = $("#form_check2");
248  let formcheckflag2 = false;
249  let formremodal2 = $("[data-remodal-id=formmodal2]").remodal();
250
251  $("#form_check2").on("submit", function (e) {
252    if (!formcheckflag2) {
253      e.preventDefault();
254
255      // 前回追加した hidden を一旦削除(重複防止)
256      $('#form_check2 input[data-auto-added="true"]').remove();
257
258      // 昼・夜のバリデーション設定
259      const radioGroups = [
260        { name: "昼公演Tシャツサイズ", condition: "昼公演チケット有無", label: "昼公演のTシャツサイズ" },
261        { name: "夜公演Tシャツサイズ", condition: "夜公演チケット有無", label: "夜公演のTシャツサイズ" },
262      ];
263
264      let errorFlag = false;
265
266      radioGroups.forEach(function (group) {
267        const conditionChecked = document.querySelector(`input[name="${group.condition}"]:checked`);
268        const sizeChecked = document.querySelector(`input[name="${group.name}"]:checked`);
269
270        if (conditionChecked && conditionChecked.value === "はい") {
271          if (!sizeChecked) {
272            alert(group.label + " を選択してください。");
273            errorFlag = true;
274          }
275        } else {
276          // チケットなし → サイズは空欄を送信(hidden 追加)
277          if (!sizeChecked) {
278            const hiddenField = document.createElement("input");
279            hiddenField.type = "hidden";
280            hiddenField.name = group.name;
281            hiddenField.value = "入力なし";
282            hiddenField.setAttribute("data-auto-added", "true");
283
284            // 元の input があればその直前に挿入、なければ末尾に追加
285            const originalInput = document.querySelector(`#form_check2 input[name="${group.name}"]`);
286            if (originalInput) {
287              originalInput.parentNode.insertBefore(hiddenField, originalInput);
288            } else {
289              document.getElementById("form_check2").appendChild(hiddenField);
290            }
291          }
292        }
293      });
294
295      if (errorFlag) return false;
296
297      const param = $form2.serializeArray();
298      const paramMap = {};
299      $.each(param, function (i, v) {
300        if (v.name !== "access_token" && v.name !== "ETBR_ID") {
301          paramMap[v.name] = v.value;
302        }
303      });
304
305      const order = ["昼公演チケット有無", "昼公演Tシャツサイズ", "夜公演チケット有無", "夜公演Tシャツサイズ", "お名前", "メールアドレス"];
306
307      let _html = "";
308      order.forEach(function (key) {
309        if (key in paramMap) {
310          const val = paramMap[key] || "入力なし";
311          _html += "<dl><dt>" + key + "</dt><dd>" + val + "</dd></dl>";
312        }
313      });
314
315      $(".confirm_check2").html(_html);
316
317      // 「上記の内容で送信する」クリックで本送信(多重バインド防止)
318      $("#form_send2")
319        .off("click.confirm")
320        .on("click.confirm", function () {
321          formcheckflag2 = true;
322          $("#form_check2").trigger("submit");
323        });
324
325      formremodal2.open();
326      return false;
327    } else {
328      // 実送信(必要ならメール送信等)
329      e.preventDefault(); // 一旦デフォルト送信を止める
330      const query = $form2.serialize();
331
332      $.ajax({
333        type: "POST",
334        url: "/mailsend_form/",
335        data: query,
336        success: function (data) {
337          console.log("success:" + data);
338          // Ajax完了後にフォームの本来の送信を実行
339          $form2.off("submit"); // イベントハンドラを一旦削除
340          $form2[0].submit(); // フォームのデフォルト送信を実行
341        },
342        error: function (xhr, status, error) {
343          console.log("error:" + error);
344          // エラー時もフォーム送信を続行するか、エラー処理をするか選択
345          $form2.off("submit");
346          $form2[0].submit();
347        },
348      });
349      return false;
350    }
351  });
352
353  // formcheck confirm for form_check3 (no mail send)
354  let $form3 = $("#form_check3");
355  let formcheckflag3 = false;
356  let formremodal3 = $("[data-remodal-id=formmodal3]").remodal();
357
358  $("#form_check3").on("submit", function (e) {
359    e.preventDefault();
360    if (!formcheckflag3) {
361      let param = $form3.serializeArray();
362      var _html = "";
363      $.each(param, function (i, v) {
364        if (v.name != "access_token" && v.name != "ETBR_ID" && v.name != "email") {
365          _html += "<dl><dt>" + v.name + "</dt><dd>" + v.value.replace(/\n/g, "<br>") + "</dd></dl>";
366        }
367      });
368      $(".confirm_check3").html(_html);
369      $("#form_send3")
370        .off("click")
371        .on("click", function () {
372          formcheckflag3 = true;
373          $("#form_check3").submit();
374        });
375      formremodal3.open();
376    } else {
377      // メール送信なし:フォームをそのままサブミット
378      $form3[0].submit();
379    }
380  });
381
382  //文字数チェック
383  $("#count_area").on("input keyup", function () {
384    let text = $(this).val();
385    text = text.replace(new RegExp("\r\n", "g"), "");
386    text = text.replace(new RegExp("\n", "g"), "");
387    let _count = text.length;
388    let _limit = $(this).attr("data-limit");
389    $("#text_num").text(_limit - _count);
390    if (_count == 0) {
391      $("#text_num").text(_limit);
392      $("#form_confirm").prop("disabled", false);
393    } else if (_count > _limit) {
394      $("#text_num").css("color", "red");
395      $("#form_confirm").prop("disabled", true);
396    } else {
397      $("#text_num").css("color", "");
398      $("#form_confirm").prop("disabled", false);
399    }
400  });
401
402  //recaptcha v3 20240307
403  if (document.getElementById("recaptchaform") != null) {
404    document.getElementById("recaptchaform").addEventListener("submit", onSubmitCheck);
405  }
406  function onSubmitCheck(e) {
407    e.preventDefault();
408    var actionCont = document.getElementById("recaptchaform").getAttribute("data-cont");
409    console.log(actionCont);
410
411    grecaptcha.ready(function () {
412      grecaptcha.execute("6LdQ69ghAAAAAPlj3FJ10MRgUqhMsXGXQrMwjaEW", { action: "taka8rie_" + actionCont }).then(function (token) {
413        var recaptchaToken = document.getElementById("g-recaptcha-response");
414        recaptchaToken.value = token;
415        document.getElementById("recaptchaform").submit();
416      });
417    });
418  }
419})(jQuery);

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.