PageSourceSearch

https://www.teniscostatropical.com/layouts/xet_agency/js/main.js?t=1755588004

js teniscostatropical.com collected 2026-09-27 02:14:32 UTC 7,874 bytes, 291 lines download raw bytes

1// 메인 - 슬라이더 섹션
2function main_swiper() {
3	const main_visual_swiperID = document.querySelector('#js-main-visual-swiper');
4	if (!main_visual_swiperID) return;
5
6	const prop_effect = main_visual_swiperID.getAttribute('data-swiper-effect');
7	const prop_delay = main_visual_swiperID.getAttribute('data-swiper-delay');
8	const prop_autoplay = main_visual_swiperID.getAttribute('data-swiper-autoplay');
9	const prop_pagination = main_visual_swiperID.getAttribute('data-swiper-pagination');
10	const prop_height = main_visual_swiperID.getAttribute('data-swiper-height');
11	if (prop_height == 'true') {
12		prop_height_parm = {
13			autoHeight: true
14		}
15	} else {
16		prop_height_parm = {
17			autoHeight: false
18		}
19	}
20	const mainSwiperNavigations = main_visual_swiperID.querySelectorAll('.main-visual-swiper__navigation__next, .main-visual-swiper__navigation__prev');
21
22	// Line mainSwiperProgressBar
23	const mainSwiperProgressBar = main_visual_swiperID.querySelector('.main-visual-swiper__progress-line svg');
24
25	// Circle mainSwiperProgressBar
26	const mainSwiperProgressCircle = main_visual_swiperID.querySelector('.main-visual-swiper__progress-circle svg');
27
28	const mainSwiper = new Swiper('#js-main-visual-swiper', {
29		speed: 1000,
30		slidesPerView: 1,
31		loop: true,
32		loopedSlides: 1,
33		autoplay: {
34			disableOnInteraction: false, // 쓸어 넘기거나 버튼 클릭 시 자동 슬라이드 정지 = true
35			delay: parseInt(prop_delay)
36		},
37		prop_height_parm,
38		roundLengths: true,
39		parallax: true,
40		effect: prop_effect, //slide, fade, cube, coverflow, flip, cards
41		fadeEffect: {
42			crossFade: false
43		},
44		flipEffect: {
45			rotate: 30,
46			slideShadows: false,
47		},
48		cubeEffect: {
49			slideShadows: false,
50		},
51		pagination: {
52			el: '.main-visual-swiper__pagination',
53			clickable: true,
54			type: prop_pagination, //bullets, fraction
55			dynamicBullets: false
56		},
57		navigation: {
58			nextEl: '.main-visual-swiper__navigation__next',
59			prevEl: '.main-visual-swiper__navigation__prev',
60		},
61		keyboard: {
62			enabled: true,
63			onlyInViewport: false,
64		},
65		on: {
66			autoplayTimeLeft(s, time, progress) {
67				if (mainSwiperProgressBar) {
68					mainSwiperProgressBar.style.setProperty('--progress', 1 - progress);
69					// mainSwiperProgressBarContent.textContent = `${Math.ceil(time / 1000)}s`;
70				}
71				if (mainSwiperProgressCircle) {
72					mainSwiperProgressCircle.style.setProperty('--progress', 1 - progress);
73					// mainSwiperProgressCircleContent.textContent = `${Math.ceil(time / 1000)}s`;
74				}
75			},
76			slideChangeTransitionStart: function () {},
77			transitionEnd: function () {}
78		}
79	});
80
81	// autoplay 가 아니면
82	if (prop_autoplay == 'N') {
83		mainSwiper.autoplay.stop();
84	}
85
86	// Play/Stop control button
87	const controlBtn = main_visual_swiperID.querySelector('.play-button-control');
88	if (!controlBtn) return;
89	controlBtn.addEventListener('click', function () {
90		console.log(mainSwiper.progress);
91		if (this.getAttribute('aria-pressed') === 'false') {
92			mainSwiper.autoplay.stop();
93			mainSwiperProgressBar.style.setProperty('--progress', 0);
94			this.querySelector('.play-button-text>i').classList.remove('xi-pause');
95			this.querySelector('.play-button-text>i').classList.add('xi-play');
96			this.setAttribute('aria-pressed', 'true');
97		} else {
98			mainSwiper.autoplay.start();
99			this.querySelector('.play-button-text>i').classList.remove('xi-play');
100			this.querySelector('.play-button-text>i').classList.add('xi-pause');
101			this.setAttribute('aria-pressed', 'false');
102		}
103	});
104
105	// 슬라이더 섹션 parallaxScroll
106	if (deviceType != 'Desktop') {
107		// $(window).bind('scroll', function (e) {
108		// 	const scrolledY = $(window).scrollTop();
109		// 	$('#js-main-visual-swiper>.swiper-wrapper').css('top', '+' + ((scrolledY * 0.3)) + 'px');
110		// });
111	}
112}
113
114// 메인 - 서비스소개 섹션
115function main_service() {
116	const section = $('.main-service');
117	if (section.length === 0) return;
118	var serviceCount = document.querySelectorAll("#js-main-service .swiper-slide").length; // 슬라이드 개수 가져오기
119	if (serviceCount === 0) return;
120	section.waypoint({
121		handler: function (direction) {
122			if (direction === "down") {
123				var serviceSwiper = new Swiper("#js-main-service", {
124					autoplay: false,
125					loop: false,
126					effect: 'slide',
127					slidesPerView: 'auto',
128					spaceBetween: 16,
129					freeMode: false,
130					centeredSlides: false,
131					pagination: {
132						type: "progressbar",
133						el: ".main-swiper__pagination",
134						clickable: true,
135						dynamicBullets: true,
136					},
137					breakpoints: {
138						575: {
139							slidesPerView: Math.min(serviceCount, 2),
140						},
141						768: {
142							slidesPerView: Math.min(serviceCount, 3),
143							spaceBetween: 24,
144						},
145						992: {
146							slidesPerView: Math.min(serviceCount, 4),
147						},
148						1200: {
149							slidesPerView: Math.min(serviceCount, 4),
150							spaceBetween: 32,
151						},
152					},
153				});
154			}
155			// trigger once only
156			this.destroy();
157		},
158		offset: "90%"
159	});
160}
161
162// 메인 - 팀소개 섹션
163function main_team() {
164	const section = $('.main-team');
165	if (section.length === 0) return;
166	var teamCount = document.querySelectorAll("#js-main-team .swiper-slide").length;
166 // 슬라이드 개수 가져오기
167	if (teamCount === 0) return;
168	section.waypoint({
169		handler: function (direction) {
170			if (direction === "down") {
171				var teamSwiper = new Swiper("#js-main-team", {
172					autoplay: {
173						delay: 5000,
174						disableOnInteraction: false,
175						pauseOnMouseEnter: true
176					},
177					loop: false,
178					effect: 'slide',
179					slidesPerView: 'auto',
180					spaceBetween: 16,
181					freeMode: false,
182					centeredSlides: false,
183					pagination: {
184						type: "progressbar",
185						el: ".main-swiper__pagination",
186						clickable: true,
187						dynamicBullets: true,
188					},
189					navigation: {
190						nextEl: ".main-team-button-next",
191						prevEl: ".main-team-button-prev",
192					},
193					breakpoints: {
194						575: {
195							slidesPerView: Math.min(teamCount, 2),
196						},
197						768: {
198							slidesPerView: Math.min(teamCount, 3),
199							spaceBetween: 24,
200						},
201						992: {
202							slidesPerView: Math.min(teamCount, 4),
203						},
204						1200: {
205							slidesPerView: Math.min(teamCount, 4),
206							spaceBetween: 32,
207						},
208					},
209				});
210			}
211			// trigger once only
212			this.destroy();
213		},
214		offset: "90%"
215	});
216}
217
218// 메인 - 파트너사 섹션
219function main_partner() {
220	const section = $(".main-partner");
221	if (section.length === 0) return;
222	var partnerCount = document.querySelectorAll("#js-main-partner .swiper-slide").length; // 슬라이드 개수 가져오기
223	if (partnerCount === 0) return;
224	var partnerSwiper = new Swiper("#js-main-partner", {
225		autoplay: {
226			delay: 1000,
227			disableOnInteraction: false,
228			pauseOnMouseEnter: true
229		},
230		speed: 3000,
231		loop: true,
232		slidesPerView: 2,
233		spaceBetween: 16,
234		// pagination: {
235		// 	type: "bullets",
236		// 	el: ".main-swiper__pagination",
237		// 	clickable: true,
238		// },
239		breakpoints: {
240			768: {
241				slidesPerView: Math.min(partnerCount, 3),
242				spaceBetween: 24,
243			},
244			992: {
245				slidesPerView: Math.min(partnerCount, 4),
246			},
247			1200: {
248				slidesPerView: Math.min(partnerCount, 6),
249				spaceBetween: 32,
250			},
251			1400: {
252				slidesPerView: Math.min(partnerCount, 7),
253			},
254		},
255	});
256}
257
258// 메인 - 섹션들 sorting
259function sortMainsection() {
260	var sections = $('.xet-layout .main-sections'),
261		section = sections.children('section');
262	section.detach().sort(function (a, b) {
263		var astts = $(a).data('sid');
264		var bstts = $(b).data('sid')
265		return (astts > bstts) ? (astts > bstts) ? 1 : 0 : -1;
266	});
267	sections.append(section);
268}
269
270(function ($) {
271	"use strict";
272
273	if ($('#js-preloader').length === 0) {
274		main_swiper();
275	} else {
276		setTimeout(main_swiper, 2000);
277	}
278
279	main_service();
280	main_team();
281	main_partner();
282
283	$(document).ready(function () {
284
285		if (main_section_sort=='Y')
286		{
287			sortMainsection();
288		}
289	});
290
291})(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.