PageSourceSearch

https://www.delta-singapore.com/js/products.js?v=24041201

js delta-singapore.com collected 2026-09-29 09:36:58 UTC 2,707 bytes, 89 lines download raw bytes

1import {
2  r as register
3} from "./swiper-element-bundle.js";
4import "./products_ver_2023_11.js";
5import {
6  c as createApp,
7  r as ref,
8  o as onMounted,
9  a as onUnmounted,
10  u as useElementBounding
11} from "./index.js";
12register();
13
14function getNodeListPosition(nodeList, node) {
15  for (let i = 0; i < nodeList.length; i++) {
16    if (nodeList[i] === node) {
17      return i;
18    }
19  }
20  return -1;
21}
22
23function findParent(element, selector) {
24  let parent = element.parentNode;
25  while (parent) {
26    if (parent.matches(selector)) {
27      return parent;
28    }
29    parent = parent.parentNode;
30  }
31  return null;
32}
33const PageNavApp = {
34  setup() {
35    const swiper = ref(null);
36    const swiperOptions = {
37      slidesPerView: "auto",
38      slidesPerGroupAuto: true,
39      navigation: {
40        nextEl: ".swiper--next",
41        prevEl: ".swiper--prev"
42      }
43    };
44    onMounted(async () => {
45      window.swiperIndex = 0;
46      if (swiper.value) {
47        Object.assign(swiper.value, swiperOptions);
48        swiper.value.initialize();
49      }
50      window.addEventListener("scroll", () => {
51        swiper.value.swiper.slideTo(window.swiperIndex);
52      });
53    });
54    onUnmounted(() => {});
55    return {
56      swiper
57    };
58  },
59  directives: {
60    focus: {
61      created(el, binding) {
62            window.addEventListener("scroll", () => {
63                var visibleWord = document.querySelector("#" + binding.value);
64              
65                    let y1 = useElementBounding(document.querySelector("#" + binding.value)).top.value;
66                    let y2 = useElementBounding(document.querySelector("#" + binding.value).nextElementSibling).top.value;
67                    let wh = window.innerHeight / 2;
68                    if (document.querySelector("#" + binding.value).nextElementSibling) {
69                        if (y1 < wh && y2 > wh) {
70                            el.classList.add("active");
71                            window.swiperIndex = getNodeListPosition(document.querySelectorAll("#PageNavApp .swiper-slide"), findParent(el, ".swiper-slide"));
72                        } else {
73                            el.classList.remove("active");
74                        }
75                    } else {
76                        if (y1 < wh) {
77                            el.classList.add("active");
78                            window.swiperIndex = getNodeListPosition(document.querySelectorAll("#PageNavApp .swiper-slide"), findParent(el, ".swiper-slide"));
79                        } else {
80                            el.classList.remove("active");
81                        }
82                    }
83               
84        });
85      }
86    }
87  }
88};
89createApp(PageNavApp).mount("#PageNavApp");

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.