PageSourceSearch

https://www.nadiakadek.com/js/main.js

js nadiakadek.com collected 2026-10-04 22:08:10 UTC 3,583 bytes, 109 lines download raw bytes

1
2gsap.registerPlugin(SplitText);
3$(document).ready(function(){
4    const navLinks = document.querySelectorAll('nav a[href^="#"]');
5
6    navLinks.forEach(link => {
7        link.addEventListener("click", function (e) {
8            e.preventDefault(); // Prevent default jump
9
10            navclicked(this);
11        });
12   }); 
13    
14
15    // Active class with IntersectionObserver
16    const sections = document.querySelectorAll("section[id]");
17    const observerOptions = {
18        root: null,
19        rootMargin: "0px 0px -50% 0px", // trigger when section is 50% from top
20        threshold: 0
21    };
22
23    const observer = new IntersectionObserver((entries) => {
24        entries.forEach(entry => {
25            if (entry.isIntersecting) {
26                const id = entry.target.getAttribute("id");
27
28                // Remove active class from all links
29                navLinks.forEach(link => link.classList.remove("active"));
30
31                // Add to the current one
32                const activeLink = document.querySelector(`nav a[href="#${id}"]`);
33                if (activeLink) {
34                    activeLink.classList.add("active");
35                }
36            }
37        });
38    }, observerOptions);
39
40    sections.forEach(section => observer.observe(section));
41    
42    // if(window.location.hash!=""){
43    //     var deeplink = window.location.hash.split("#")[1];
44
45    //     navclicked("nav_"+deeplink);
46    // }
47
48    getDates(url);
49});
50
51var lastshown = "home";
52function navclicked(ele){
53    const target = document.querySelector(ele.getAttribute("href"));
54    if (target) {
55        gsap.to(window, .8, {
56            scrollTo: {
57                y: target,
58                offsetY: "50"
59            },
60            ease: "power1.in"
61        });
62    }
63}
64
65var urlPast = 'https://api.songkick.com/api/3.0/artists/8330143/gigography.json?apikey=io09K9l3ebJxmxe2&order=desc&jsoncallback=?';
66var url = 'https://api.songkick.com/api/3.0/artists/8330143/calendar.json?apikey=io09K9l3ebJxmxe2&jsoncallback=?';
67function getDates(url) {
68  
69
70  $.getJSON(url, function(data) {
71    var events = data.resultsPage.results.event;
72    // console.log(events);
73    if(events==undefined){
74        $('.events').append('<li class="nogigs">* No upcoming concerts *</li><li class="pastevents">Past events</li>');
75        getDates(urlPast);
76    } else {
77
78      events.forEach(function(item, index, array) {
79        var displayName = array[index].displayName;
80        
81        var event_day = array[index].start.date;
82        var day = moment(event_day).format('D');
83        var month = moment(event_day).format('MMM');
84        var year = moment(event_day).format('YYYY');
85        var event_city = array[index].location.city;
86        var event_venue = array[index].venue.displayName;
87        if(event_venue=="Unknown venue" || array[index].type=="Festival"){
88          event_venue=displayName;
89        }
90        
91        var row_class = "";
92        if(index % 2==0) {
93            row_class="alt";
94        }
95
96        var link = array[index].uri;
97
98        $('.events').append(
99            '<li class="'+row_class+'">' 
100            + '<a href="'+link+'" target="_blank" title="get tickets!">' 
101            + '<div class="date-box"><h4 class="month">'+month+'</h4><h3 class="date">' + day + '</h3><h5 class="year">' + year + '</h3></div>'
102            + '<div class="event-details"><span class="venue">' + event_venue + '</span><span class="city">' + event_city + '</span></div>'
103            + '<div class="ticket">Tickets ></div>'
104            + '</a>'
105            + '</li>');
106        });
107      }
108    });
109}

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.