PageSourceSearch

https://www.techmarcos.com/wp-content/themes/techmarcos/assets/js/modules/swiper/config.js

js techmarcos.com collected 2026-10-06 14:18:27 UTC 2,070 bytes, 77 lines download raw bytes

1/**
2 * Shared Swiper configuration presets.
3 *
4 * Centralises the option fragments that were duplicated across sliders (marquee
5 * autoplay, autoplay-loop, center mode). Each preset is a pure function that
6 * returns a fresh object so callers can spread + extend without mutating shared
7 * state:
8 *
9 *   createSwiper(el, marquee({ speed: 6000, slidesPerView: 3 }))
10 *
11 * @module swiper/config
12 */
13
14/**
15 * Autoplay block for a seamless, constant-velocity marquee: zero delay so the
16 * transition never pauses between slides (paired with a large `speed` and linear
17 * CSS timing). Never use `freeMode` with this — it stutters.
18 * @type {Readonly<Object>}
19 */
20export const MARQUEE_AUTOPLAY = Object.freeze({
21  delay: 0,
22  disableOnInteraction: false,
23  pauseOnMouseEnter: false,
24});
25
26/**
27 * Continuous marquee preset (text/logo/services sliders).
28 *
29 * @param {Object} [overrides] Extra Swiper options merged on top (e.g. `speed`,
30 *   `slidesPerView`, `spaceBetween`, `breakpoints`).
31 * @returns {Object}
32 */
33export function marquee(overrides = {}) {
34  return {
35    loop: true,
36    allowTouchMove: false,
37    autoplay: { ...MARQUEE_AUTOPLAY },
38    ...overrides,
39  };
40}
41
42/**
43 * Auto-advancing looped carousel that pauses on hover (review slider).
44 *
45 * @param {Object} [options]
46 * @param {number} [options.delay=3000] Delay between slides (ms).
47 * @param {number} [options.speed=500] Transition duration (ms).
48 * @param {Object} [options.overrides] Extra Swiper options.
49 * @returns {Object}
50 */
51export function autoplayLoop({ delay = 3000, speed = 500, overrides = {} } = {}) {
52  return {
53    loop: true,
54    speed,
55    autoplay: {
56      delay,
57      disableOnInteraction: false,
58      pauseOnMouseEnter: true,
59    },
60    ...overrides,
61  };
62}
63
64/**
65 * Center-mode preset (centred active slide, auto slide width set in CSS).
66 *
67 * @param {Object} [overrides] Extra Swiper options merged on top.
68 * @returns {Object}
69 */
70export function centerMode(overrides = {}) {
71  return {
72    slidesPerView: "auto",
73    centeredSlides: true,
74    loop: true,
75    ...overrides,
76  };
77}

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.