PageSourceSearch

https://prodbydjsmalls.com/js/scripts.js

js prodbydjsmalls.com collected 2026-10-08 23:00:56 UTC 1,906 bytes, 46 lines download raw bytes

1/* DJ Smalls Music — Scripts */
2
3window.addEventListener('DOMContentLoaded', () => {
4
5  // Navbar: add shrink class once the user scrolls past the top
6  const nav = document.getElementById('mainNav');
7  const applyShrink = () => {
8    if (!nav) return;
9    nav.classList.toggle('navbar-shrink', window.scrollY > 20);
10  };
11  applyShrink();
12  document.addEventListener('scroll', applyShrink, { passive: true });
13
14  // Close mobile menu after clicking a link
15  const toggler = document.querySelector('.navbar-toggler');
16  document.querySelectorAll('#navbarResponsive .nav-link, #navbarResponsive .dropdown-item').forEach(link => {
17    link.addEventListener('click', () => {
18      if (toggler && window.getComputedStyle(toggler).display !== 'none') {
19        const collapse = document.getElementById('navbarResponsive');
20        if (collapse && collapse.classList.contains('show')) toggler.click();
21      }
22    });
23  });
24
25  // Mark the active nav link based on current page (helps on inner pages)
26  const path = window.location.pathname.split('/').pop() || 'index.html';
27  document.querySelectorAll('#navbarResponsive a').forEach(a => {
28    const href = a.getAttribute('href') || '';
29    if (href === path || (path === '' && href === 'index.html')) {
30      a.classList.add('active');
31    }
32  });
33
34  // Fade in BeatStars player once it has loaded
35  document.querySelectorAll('.player-wrap iframe').forEach(iframe => {
36    // If the iframe has already loaded by the time this runs (cached), mark it now
37    if (iframe.complete || (iframe.contentDocument && iframe.contentDocument.readyState === 'complete')) {
38      iframe.classList.add('loaded');
39    }
40    iframe.addEventListener('load', () => {
41      iframe.classList.add('loaded');
42    });
43    // Fallback: force fade-in after 3s even if 'load' never fires (cross-origin can be quirky)
44    setTimeout(() => iframe.classList.add('loaded'), 3000);
45  });
46});

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.