Uncategorised

SCRATCH export dump

By MukhtarAashury·23 August 2026·7 min read
===FILE:main.js===
/* APNOR — interactions: sticky header, mobile menu, scroll reveal, active nav */
(function () {
  'use strict';

  /* Sticky header + mobile menu are wired by header.js once it injects the
     header markup (assets/js/header.js). This file no longer duplicates that. */

  /* ---- Scroll reveal ---- */
  var reduce = window.matchMedia('(prefers-reduced-motion: reduce)').matches;
  var revealEls = document.querySelectorAll('.reveal');
  if (reduce || !('IntersectionObserver' in window)) {
    revealEls.forEach(function (el) { el.classList.add('in'); });
  } else {
    var first = revealEls[0];
    if (first) first.classList.add('in');
    var io = new IntersectionObserver(function (entries) {
      entries.forEach(function (entry) {
        if (entry.isIntersecting) {
          entry.target.classList.add('in');
          io.unobserve(entry.target);
        }
      });
    }, { threshold: 0.12, rootMargin: '0px 0px -8% 0px' });
    revealEls.forEach(function (el) { if (el !== first) io.observe(el); });
  }

  /* ---- Testimonial carousel ---- */
  (function () {
    var root = document.getElementById('quoteCarousel');
    if (!root) return;
    var slides = Array.prototype.slice.call(root.querySelectorAll('.qc-slide'));
    var dotsWrap = document.getElementById('qcDots');
    var prev = document.getElementById('qcPrev');
    var next = document.getElementById('qcNext');
    if (!slides.length) return;
    var index = 0, timer = null, DELAY = 6500;

    var dots = slides.map(function (_, i) {
      var b = document.createElement('button');
      b.setAttribute('role', 'tab');
      b.setAttribute('aria-label', 'Testimonial ' + (i + 1));
      b.addEventListener('click', function () { go(i); restart(); });
      dotsWrap.appendChild(b);
      return b;
    });

    function render() {
      slides.forEach(function (s, i) { s.classList.toggle('active', i === index); });
      dots.forEach(function (d, i) {
        d.classList.toggle('active', i === index);
        d.setAttribute('aria-selected', i === index ? 'true' : 'false');
      });
    }
    function go(i) { index = (i + slides.length) % slides.length; render(); }
    function advance() { go(index + 1); }

    function start() { if (!reduce) timer = window.setInterval(advance, DELAY); }
    function stop() { if (timer) { window.clearInterval(timer); timer = null; } }
    function restart() { stop(); start(); }

    if (prev) prev.addEventListener('click', function () { go(index - 1); restart(); });
    if (next) next.addEventListener('click', function () { advance(); restart(); });
    root.addEventListener('mouseenter', stop);
    root.addEventListener('mouseleave', start);
    root.addEventListener('focusin', stop);
    root.addEventListener('focusout', start);

    render();
    start();
  })();

  /* Active nav state is set by header.js via aria-current, based on the
     current page — no same-page anchor scrollspy needed in the multi-page nav. */
})();

===ENDFILE===
===FILE:footer.js===
/* APNOR — shared footer injected into #footer-slot (single source of truth) */
(function () {
  var slot = document.getElementById('footer-slot');
  if (!slot) return;
  slot.outerHTML = [
    '<footer class="site-footer">',
    '  <div class="container">',
    '    <div class="footer-top">',
    '      <div class="footer-brand">',
    '        <img src="' + APNOR_ASSETS_URL + 'logo/apnor-logo-white.png" alt="Asia Pacific Network of Refugees" />',
    '        <p>A refugee-led network building a world where refugees shape their futures — by refugees, for refugees.</p>',
    '        <div class="foot-social">',
    '          <a href="https://www.facebook.com/APNORefugees/" target="_blank" rel="noopener" aria-label="Facebook"><svg viewBox="0 0 24 24" fill="currentColor"><path d="M22 12a10 10 0 1 0-11.6 9.9v-7H7.9V12h2.5V9.8c0-2.5 1.5-3.9 3.8-3.9 1.1 0 2.2.2 2.2.2v2.5h-1.2c-1.2 0-1.6.8-1.6 1.6V12h2.7l-.4 2.9h-2.3v7A10 10 0 0 0 22 12z"/></svg></a>',
    '          <a href="https://twitter.com/APNORefugees" target="_blank" rel="noopener" aria-label="X (Twitter)"><svg viewBox="0 0 24 24" fill="currentColor"><path d="M18.9 2H22l-7.1 8.1L23 22h-6.6l-5.2-6.8L5.3 22H2.2l7.6-8.7L1.7 2h6.8l4.7 6.2L18.9 2zm-1.2 18h1.8L7.1 3.9H5.2L17.7 20z"/></svg></a>',
    '          <a href="https://www.linkedin.com/company/asia-pacific-network-of-refugees/" target="_blank" rel="noopener" aria-label="LinkedIn"><svg viewBox="0 0 24 24" fill="currentColor"><path d="M4.98 3.5A2.5 2.5 0 1 0 5 8.5a2.5 2.5 0 0 0-.02-5zM3 9h4v12H3zM9 9h3.8v1.7h.05c.53-1 1.8-2 3.7-2 4 0 4.7 2.6 4.7 6V21h-4v-5.3c0-1.3 0-3-1.8-3s-2.1 1.4-2.1 2.9V21H9z"/></svg></a>',
    '          <a href="https://www.instagram.com/apnor.refugees/" target="_blank" rel="noopener" aria-label="Instagram"><svg viewBox="0 0 24 24" fill="currentColor"><path d="M12 2.2c3.2 0 3.6 0 4.9.1 1.2.1 1.8.3 2.2.4.6.2 1 .5 1.4.9.4.4.7.8.9 1.4.2.4.4 1 .4 2.2.1 1.3.1 1.7.1 4.9s0 3.6-.1 4.9c-.1 1.2-.3 1.8-.4 2.2-.2.6-.5 1-.9 1.4-.4.4-.8.7-1.4.9-.4.2-1 .4-2.2.4-1.3.1-1.7.1-4.9.1s-3.6 0-4.9-.1c-1.2-.1-1.8-.3-2.2-.4a3.8 3.8 0 0 1-1.4-.9 3.8 3.8 0 0 1-.9-1.4c-.2-.4-.4-1-.4-2.2C2.2 15.6 2.2 15.2 2.2 12s0-3.6.1-4.9c.1-1.2.3-1.8.4-2.2.2-.6.5-1 .9-1.4.4-.4.8-.7 1.4-.9.4-.2 1-.4 2.2-.4C8.4 2.2 8.8 2.2 12 2.2zm0 3.2A6.6 6.6 0 1 0 18.6 12 6.6 6.6 0 0 0 12 5.4zm0 10.9A4.3 4.3 0 1 1 16.3 12 4.3 4.3 0 0 1 12 16.3zm6.8-11.2a1.5 1.5 0 1 0 1.5 1.5 1.5 1.5 0 0 0-1.5-1.5z"/></svg></a>',
    '          <a href="https://www.youtube.com/@asiapacificnetworkofrefuge6286" target="_blank" rel="noopener" aria-label="YouTube"><svg viewBox="0 0 24 24" fill="currentColor"><path d="M23.5 6.2a3 3 0 0 0-2.1-2.1C19.5 3.5 12 3.5 12 3.5s-7.5 0-9.4.6A3 3 0 0 0 .5 6.2 31 31 0 0 0 0 12a31 31 0 0 0 .5 5.8 3 3 0 0 0 2.1 2.1c1.9.6 9.4.6 9.4.6s7.5 0 9.4-.6a3 3 0 0 0 2.1-2.1A31 31 0 0 0 24 12a31 31 0 0 0-.5-5.8zM9.6 15.5V8.5L15.8 12z"/></svg></a>',
    '        </div>',
    '      </div>',
    '      <div class="footer-col"><h5>Who We Are</h5><ul>',
    '        <li><a href="/about-us/">About Us</a></li>',
    '        <li><a href="/meet-our-team/">Meet Our Team</a></li>',
    '        <li><a href="/campaigns/">Campaigns</a></li>',
    '        <li><a href="/our-network/">Our Network</a></li>',
    '        <li><a href="/careers/">Careers</a></li>',
    '      </ul></div>',
    '      <div class="footer-col"><h5>What We Do</h5><ul>',
    '        <li><a href="/programs/">All Programs</a></li>',
    '        <li><a href="/pillar-grassroots/">Grassroots Engagement</a></li>',
    '        <li><a href="/pillar-resource-mobilisation/">Resource Mobilisation</a></li>',
    '        <li><a href="/pillar-life-saving-support/">Life-Saving Support</a></li>',
    '        <li><a href="/pillar-advocacy-research/">Advocacy &amp; Research</a></li>',
    '        <li><a href="/pillar-empowerment-leadership/">Empowerment &amp; Leadership</a></li>',
    '      </ul></div>',
    '      <div class="footer-col"><h5>Media &amp; Get Involved</h5><ul>',
    '        <li><a href="/publications/">Publications</a></li>',
    '        <li><a href="/blog/">Blog</a></li>',
    '        <li><a href="/media-gallery/">Media Gallery</a></li>',
    '        <li><a href="/donate/">Donate</a></li>',
    '        <li><a href="/membership/">Membership</a></li>',
    '        <li><a href="/volunteer/">Volunteer</a></li>',
    '      </ul></div>',
    '      <div class="footer-col"><h5>Contact</h5><ul class="foot-contact">',
    '        <li><svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><path d="M21 10c0 7-9 13-9 13s-9-6-9-13a9 9 0 0 1 18 0z"/><circle cx="12" cy="10" r="3"/></svg>1 Desmond St, Merrylands NSW 2160, Australia</li>',
    '        <li><svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><path d="M22 16.9v3a2 2 0 0 1-2.2 2 19.8 19.8 0 0 1-8.6-3 19.5 19.5 0 0 1-6-6 19.8 19.8 0 0 1-3-8.6A2 2 0 0 1 4.1 2h3a2 2 0 0 1 2 1.7c.1.9.4 1.8.7 2.7a2 2 0 0 1-.5 2.1L8.1 9.9a16 16 0 0 0 6 6l1.4-1.2a2 2 0 0 1 2.1-.5c.9.3 1.8.6 2.7.7a2 2 0 0 1 1.7 2z"/></svg><a href="tel:+61469054312">+61 469 054 312</a></li>',
    '        <li><svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><path d="M4 4h16v16H4z"/><path d="M22 6l-10 7L2 6"/></svg><a href="mailto:info@apnor.org">info@apnor.org</a></li>',
    '      </ul></div>',
    '    </div>',
    '    <div class="rainbow" aria-hidden="true"></div>',
    '    <div class="footer-bottom">',
    '      <span class="foot-copy">&copy; 2026 Asia Pacific Network of Refugees. All rights reserved. Registered as NGO in Australia. Design by <a href="https://mukhtar-design.com/" target="_blank" rel="noopener" class="credit-link">Mukhtar-Design</a>.</span>',
    '      <span class="foot-tagline">By refugees, for refugees.</span>',
    '      <span class="foot-legal"><a href="/privacy-policy/">Privacy Policy</a><a href="/terms-of-service/">Terms of Service</a></span>',
    '    </div>',
    '  </div>',
    '</footer>'
  ].join('');
})();

===ENDFILE===
Written by

MukhtarAashury

← Back to blog Join the network