PageSourceSearch

https://prevent-waste.net/wp-content/themes/glow_custom_v1.2/js/projectsmap.js?ver=1.2.0

js prevent-waste.net collected 2026-10-02 04:50:34 UTC 2,878 bytes, 93 lines download raw bytes

1jQuery(document).ready(function ($) {
2  //SWIPER INIT
3  var swiper2 = new Swiper(".mySwiper", {
4    initialSlide: 0,
5    slidesPerView: 1,
6    spaceBetween: 30,
7    loop: true,
8    navigation: {
9      nextEl: ".swiper-button-next",
10      prevEl: ".swiper-button-prev",
11    },
12    pagination: {
13      el: ".mySwiper-pagination",
14      type: "custom",
15      renderCustom: function (swiper, current, total) {
16        return ("0" + current).slice(-2) + " of " + ("0" + total).slice(-2);
17      },
18    },
19  });
20
21  //BUTTON FUNC & OPEN/CLOSE
22  function openProjects() {
23    $(".world-map .project-wrap").fadeIn(function () {
24      if (!$(".world-map .project-wrap").is(":visible")) {
25        $(".world-map").show();
26        $(".world-map").addClass("world-map-big");
27      } else {
28        $(".world-map").removeClass("world-map-big");
29      }
30    });
31  }
32
33  //PILOT PROJECTS BUTTON
34  $("#pilot-projects").on("click", () => {
35    //RESET SLIDER --> first project
36    setTimeout(() => {
37      swiper2.slideToLoop(0);
38    }, 300);
39    $("#world path.fill-country").removeClass("fill-country");
40    $(allC[0].join(", ")).addClass("fill-country");
41    //SHOW WORLD MAP + ADD ACTIVE BUTTON
42    $(".world-map").show();
43    $("#pilot-projects").addClass("active-btn");
44    //HIDE WORLD MAP 2 + REMOVE ACTIVE BUTTON
45    $("#prevent-projects").removeClass("active-btn");
46    $(".world-map2, .world-map2 .project-wrap").hide();
47    openProjects();
48  });
49
50  //------------------------
51  //MAP FUNCTIONALITY
52  //------------------------
53
54  //CLICK HANDLER FUNCTION - EACH COUNTRY
55  function countryHandler(arr, sliderIndex) {
56    $(arr.join(", ")).on("click", (e) => {
57      //SWIPE TO NEW PROJECT + ADD/REMOVE CLASS: fill-country
58      for (let i = 0; i < arr.length; i++) {
59        $("#world path.fill-country").removeClass("fill-country");
60        swiper2.slideToLoop(sliderIndex);
61        //console.log("arr[i]: " + arr[i]);
62        setTimeout(() => {
63          $(arr[i]).not(".fill-country").addClass("fill-country");
64        }, 150);
65      }
66    });
67  }
68
69  //EACH COUNTRY HANDLER - TAKEN FROM ACF FIELD countriesids
70  //create arrays lists of country ids and push all country ids inside array
71  let cIds = [...document.querySelectorAll(".countriesids")];
72  let allC = [];
73  for (let c = 0; c < cIds.length; c++) {
74    let cArr = cIds[c].firstChild.nodeValue;
75    allC.push(cArr.split(" "));
76  }
77
78  //ON COUNTRY CLICK HANDLER LOOP THROUGH ARRAY FROM ABOVE
79  for (let x = 0; x < allC.length; x++) {
80    //console.log("allC[x]: ", allC[x], x);
81    countryHandler(allC[x], x);
82  }
83
84  //ON SWIPER SLIDE / ARROWS CLICK
85  swiper2.on("slideChangeTransitionEnd", function (d) {
86    for (let i = 0; i < allC.length; i++) {
87      if (d.realIndex === i) {
88        $("#world path.fill-country").removeClass("fill-country");
89        $(allC[i].join(", ")).addClass("fill-country");
90      }
91    }
92  });
93});

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.