PageSourceSearch

https://produce101.jp/static/original/assets/js/common_v2_SdnGYv9A.js?=20261003013944

js produce101.jp collected 2026-10-02 16:39:57 UTC 4,957 bytes, 211 lines download raw bytes

1function loaded() {
2  $(function(){
3    setTimeout(function () {
4      $('body').addClass('loaded');
5    }, 10);
6  });
7}
8function drawer() {
9  window.onpageshow = function(event) {
10    if (event.persisted) {
11      document.querySelector('body').classList.remove('drawer-visible');
12    }
13  };
14  $('.drawer__btn').on('click', function () {
15    $('body').toggleClass('drawer-visible');
16    if($('body').hasClass('drawer-visible')) {
17      $('.drawer__btn').text("CLOSE");
18    } else {
19      $('.drawer__btn').text("MENU");
20    }
21  });
22}
23
24
25function anchor() {
26	$('a[href^="#"]').click(function(){
27		var Hash = $(this.hash), $Hash = $(Hash);
28		if ($Hash.length > 0) {
29			var HashOffset = $Hash.offset().top;
30			$('html,body').animate({
31				scrollTop: HashOffset - 20
32			}, 600);
33		}
34		return false;
35	});
36}
37function scroll() {
38  $(window).on('scroll', function () {
39    if ($(this).scrollTop() > 10) {
40      $('body').addClass('scrolling');
41    }else{
42      $('body').removeClass('scrolling');
43    }
44  });
45}
46function accordion() {
47$('.list--accordion dt').on('click', function () {
48  $(this).toggleClass('open');
49  $(this).next().slideToggle();
50});
51}
52function columnCheck() {
53  $('.content--main .inner').has('.block--right').addClass('has--right');
54}
55
56const mobileQuery = window.matchMedia("(min-width: 961px)");
57
58function footer(e) {
59  var height = $('#footer').innerHeight();
60  if(e.matches) {
61    $('.wrap').css({'padding-bottom' : height + 'px'});
62  } else {
63    $('.wrap').css({'padding-bottom' : 0});
64  }
65}
66mobileQuery.addEventListener("change", footer);
67
68
69// バナー言語切り替え
70(() => {
71  const ROOT_SELECTOR = ".block--right .banner";
72
73  function withEnSuffix(filename) {
74    return filename.replace(/_en(?=\.[^.]+$)/, "").replace(/(\.[^.]+)$/, "_en$1");
75  }
76
77  function withoutEnSuffix(filename) {
78    return filename.replace(/_en(?=\.[^.]+$)/, "");
79  }
80
81  function updateBanners() {
82    const root = document.querySelector(ROOT_SELECTOR);
83    if (!root) return;
84
85    const lang = document.documentElement.lang || "ja";
86    const isJa = lang === "ja";
87
88    root.querySelectorAll("img").forEach((img) => {
89      if (!img.dataset.srcBase) {
90        img.dataset.srcBase = img.getAttribute("src") || "";
91      }
92
93      const baseSrc = img.dataset.srcBase;
94      if (!baseSrc) return;
95
96      const url = new URL(baseSrc, location.origin);
97      const filename = url.pathname.split("/").pop();
98      if (!filename) return;
99
100      const newFilename = isJa ? withoutEnSuffix(filename) : withEnSuffix(filename);
101      url.pathname = url.pathname.replace(/[^/]+$/, newFilename);
102
103      img.setAttribute("src", url.pathname);
104    });
105  }
106
107  const originalPushState = history.pushState;
108  const originalReplaceState = history.replaceState;
109
110  function triggerUpdate() {
111    queueMicrotask(updateBanners);
112  }
113
114  history.pushState = function (...args) {
115    originalPushState.apply(this, args);
116    triggerUpdate();
117  };
118
119  history.replaceState = function (...args) {
120    originalReplaceState.apply(this, args);
121    triggerUpdate();
122  };
123
124  window.addEventListener("popstate", triggerUpdate);
125
126  const mo = new MutationObserver((mutations) => {
127    for (const m of mutations) {
128      if (m.type === "attributes" && m.attributeName === "lang") {
129        triggerUpdate();
130        break;
131      }
132    }
133  });
134  mo.observe(document.documentElement, { attributes: true });
135
136  updateBanners();
137	window.addEventListener("load", updateBanners);
138})();
139
140
141$(function () {
142  loaded();
143  columnCheck();
144  drawer();
145  anchor();
146  scroll();
147  accordion();
148  
149  let bnrImg = $("#block--banner--swiper li").length;
150  if(bnrImg > 1){
151    var mySwiper = new Swiper ('#block--banner--swiper', {
152      loop: true,
153      slidesPerView:1,
154      speed: 800,
155      autoplay: {
156        delay: 2000,
157      },
158    });
159  }
160
161  let fxbnrImg = $("#block--banner-fixed--swiper li").length;
162  if(fxbnrImg > 1){
163    var mySwiper = new Swiper ('#block--banner-fixed--swiper', {
164      loop: true,
165      slidesPerView:1,
166      speed: 800,
167      autoplay: {
168        delay: 2000,
169      },
170    });
171  }
172  if ($('body').hasClass('page--home')) {
173    setTimeout(function () {
174      $('body').addClass('animate-finish');
175    }, 900);
176    setTimeout(function () {
177      $('body').addClass('animate-clear');
178    }, 3000);
179
180    const swiperEl = document.querySelector('#swiper_tranees');
181    if (swiperEl) {
182      const mySwiper = new Swiper(swiperEl, {
183        loop: true,
184        slidesPerView: 5,
185        speed: 500,
186        autoplay: {
187          delay: 3000,
188        },
189        pagination: {
190          el: '.swiper-pagination',
191          type: 'bullets',
192          clickable: true,
193        },
194        navigation: {
195          nextEl: '.swiper-button-next',
196          prevEl: '.swiper-button-prev',
197        },
198        breakpoints: {
199          768: {
200            loop: true,
201            slidesPerView: 7,
202          }
203        }
204      });
205    }
206  }
207});
208
209window.onload = function() {
210	footer(mobileQuery);
211}

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.