🌴 San Fernando Valley
  • Events
  • Groups
  • Newsletter
  • Submit
  • Advertise

Code

@December 26, 2025 Body JS

<script>
function makeLinksClickable() {
  var els = document.querySelectorAll('.notion-property__text');
  
  els.forEach(function(el) {
    if (el.getAttribute('data-linked')) return;
    
    var text = el.innerText.trim();
    
    // Check for address
    if (text.match(/^\d{1,5}\s+[\w\s]+(Ave|Blvd|St|Dr|Rd|Way|Ln)/i)) {
      var encoded = encodeURIComponent(text);
      el.innerHTML = '<a href="https://maps.google.com/?q=' + encoded + '" target="_blank" style="color:inherit;text-decoration:underline;text-decoration-style:dotted;">' + text + '</a>';
      el.setAttribute('data-linked', 'true');
    }
    
    // Check for phone number
    if (text.match(/^\(?\d{3}\)?[\s.\-]?\d{3}[\s.\-]?\d{4}$/)) {
      var phoneDigits = text.replace(/\D/g, '');
      el.innerHTML = '<a href="tel:' + phoneDigits + '" style="color:inherit;text-decoration:underline;text-decoration-style:dotted;">' + text + '</a>';
      el.setAttribute('data-linked', 'true');
    }
  });
}

// Run on initial load
var checkInterval = setInterval(function() {
  var els = document.querySelectorAll('.notion-property__text');
  if (els.length > 0) {
    makeLinksClickable();
    clearInterval(checkInterval);
  }
}, 500);

setTimeout(function() {
  clearInterval(checkInterval);
}, 10000);

// Re-run on back/forward navigation
window.addEventListener('popstate', function() {
  setTimeout(makeLinksClickable, 500);
});

// Re-run on any page navigation (SPA)
var observer = new MutationObserver(function() {
  makeLinksClickable();
});

observer.observe(document.body, {
  childList: true,
  subtree: true
});
</script>

<script>
function collapseAllToggles() {
  if (window.location.pathname !== '/local-favorites') return;
  
  document.querySelectorAll('.notion-collection-group__section.open').forEach(section => {
    section.classList.remove('open');
  });
}

window.addEventListener('load', () => setTimeout(collapseAllToggles, 500));
document.addEventListener('super:page-change', () => setTimeout(collapseAllToggles, 500));
</script>

@December 26, 2025 Header JS

🌴 San Fernando Valley

Neighborhoods

All Areas →

North Hollywood

Studio City

Sherman Oaks

Burbank

Van Nuys

Encino

San Fernando

Woodland Hills

Categories

All Categories →

Restaurants

Bars & Nightlife

Beauty & Care

Fitness

Home Services

Retail

Auto Services

Explore

About

Events

Groups

Newsletter

Submit a Business

Submit an Event

Submit a Group

Advertise

All Guides

© San Fernando Valley Business Directory.

<!-- Privacy-friendly analytics by Plausible -->
<script async src="https://plausible.io/js/pa-tqyMztfAA8XLnnXrDvg6r.js"></script>
<script>
  window.plausible=window.plausible||function(){(plausible.q=plausible.q||[]).push(arguments)},plausible.init=plausible.init||function(i){plausible.o=i||{}};
  plausible.init()
</script>

<script>
function makeLinksClickable() {
  var els = document.querySelectorAll('.notion-property__text');
  
  els.forEach(function(el) {
    if (el.getAttribute('data-linked')) return;
    
    var text = el.innerText.trim();
    
    // Check for address
    if (text.match(/^\d{1,5}\s+[\w\s]+(Ave|Blvd|St|Dr|Rd|Way|Ln)/i)) {
      var encoded = encodeURIComponent(text);
      el.innerHTML = '<a href="https://maps.google.com/?q=' + encoded + '" target="_blank" style="color:inherit;text-decoration:underline;text-decoration-style:dotted;">' + text + '</a>';
      el.setAttribute('data-linked', 'true');
    }
    
    // Check for phone number
    if (text.match(/^\(?\d{3}\)?[\s.\-]?\d{3}[\s.\-]?\d{4}$/)) {
      var phoneDigits = text.replace(/\D/g, '');
      el.innerHTML = '<a href="tel:' + phoneDigits + '" style="color:inherit;text-decoration:underline;text-decoration-style:dotted;">' + text + '</a>';
      el.setAttribute('data-linked', 'true');
    }
  });
}

// Run on initial load
var checkInterval = setInterval(function() {
  var els = document.querySelectorAll('.notion-property__text');
  if (els.length > 0) {
    makeLinksClickable();
    clearInterval(checkInterval);
  }
}, 500);

setTimeout(function() {
  clearInterval(checkInterval);
}, 10000);

// Re-run on back/forward navigation
window.addEventListener('popstate', function() {
  setTimeout(makeLinksClickable, 500);
});

// Re-run on any page navigation (SPA)
var observer = new MutationObserver(function() {
  makeLinksClickable();
});

observer.observe(document.body, {
  childList: true,
  subtree: true
});
</script>

<script>
function collapseAllToggles() {
  if (window.location.pathname !== '/local-favorites') return;
  
  document.querySelectorAll('.notion-collection-group__section.open').forEach(section => {
    section.classList.remove('open');
  });
}

window.addEventListener('load', () => setTimeout(collapseAllToggles, 500));
document.addEventListener('super:page-change', () => setTimeout(collapseAllToggles, 500));
</script>
<script>
/* ============================================
   PROMOTE PHOTO PROPERTY TO HERO IMAGE
   ============================================ */

(function() {
  function promotePhotoToHero() {
    // Don't run twice on same page
    if (document.querySelector('.sfv-hero-image')) return;
    
    // Find the Photo property label
    var photoProperty = null;
    var allLabels = document.querySelectorAll('.notion-page__property-name span');
    
    for (var i = 0; i < allLabels.length; i++) {
      var labelText = allLabels[i].textContent.trim().toLowerCase();
      if (labelText === 'photo' || labelText === 'photos' || labelText === 'image') {
        photoProperty = allLabels[i];
        break;
      }
    }
    
    if (!photoProperty) return;
    
    // Find the parent property row
    var propertyRow = photoProperty.closest('.notion-page__property');
    if (!propertyRow) return;
    
    // Find the image within this property
    var img = propertyRow.querySelector('img');
    if (!img) return;
    
    // Get the image source (handle lazy loading)
    var imgSrc = img.src || img.dataset.src;
    if (!imgSrc || imgSrc.includes('data:image')) {
      // Image not loaded yet, wait and retry
      setTimeout(promotePhotoToHero, 300);
      return;
    }
    
    // Get business name for alt text
    var businessName = document.querySelector('h1')?.textContent?.trim() || 'Business';
    
    // Create hero container
    var hero = document.createElement('div');
    hero.className = 'sfv-hero-image';
    
    var heroImg = document.createElement('img');
    heroImg.src = imgSrc;
    heroImg.alt = 'Photo of ' + businessName;
    heroImg.loading = 'eager';
    
    // Handle load errors gracefully
    heroImg.onerror = function() {
      hero.remove();
      propertyRow.classList.remove('sfv-photo-hidden');
    };
    
    hero.appendChild(heroImg);
    
    // Find where to insert - before the properties
    var insertTarget = document.querySelector('.notion-page__properties') || 
                       document.querySelector('.notion-page__title-properties');
    
    if (insertTarget) {
      insertTarget.parentNode.insertBefore(hero, insertTarget);
    }
    
    // Hide the original property row
    propertyRow.classList.add('sfv-photo-hidden');
  }
  
  // Run after page loads
  function init() {
    setTimeout(promotePhotoToHero, 500);
  }
  
  // Initial load
  if (document.readyState === 'loading') {
    document.addEventListener('DOMContentLoaded', init);
  } else {
    init();
  }
  
  // SPA navigation
  document.addEventListener('super:page-change', function() {
    var oldHero = document.querySelector('.sfv-hero-image');
    if (oldHero) oldHero.remove();
    
    var oldHidden = document.querySelectorAll('.sfv-photo-hidden');
    oldHidden.forEach(function(el) {
      el.classList.remove('sfv-photo-hidden');
    });
    
    setTimeout(promotePhotoToHero, 500);
  });
  
  // Observer for late-loading images
  var heroObserver = new MutationObserver(function() {
    if (!document.querySelector('.sfv-hero-image') && 
        document.querySelector('.notion-page__properties')) {
      promotePhotoToHero();
    }
  });
  
  heroObserver.observe(document.body, { 
    childList: true, 
    subtree: true
  });
})();
</script>

<script async src="https://js.stripe.com/v3/pricing-table.js"></script>

<script>// Load full-res hero image on business pages
document.addEventListener('DOMContentLoaded', function() {
  const bizPage = document.querySelector('.parent-page__biz');
  if (!bizPage) return;
  
  const img = bizPage.querySelector('.notion-property__file img');
  if (!img) return;
  
  // Get the original URL from href (full res)
  const link = img.closest('a');
  if (link && link.href) {
    img.src = link.href;
    img.srcset = '';
    img.sizes = '';
  }
});</script>