// Check localStorage for the ad state when the page loads
window.addEventListener('DOMContentLoaded', () => {
const saved = localStorage.getItem('adsEnabled'); // Retrieve the ad state from localStorage
if (saved === 'true') {
// Ads are enabled, show them
document.querySelectorAll('.ad-spot').forEach(ad => {
ad.style.opacity = '1'; // Set opacity to 1 to show ads
});
} else {
// Ads are disabled, hide them
document.querySelectorAll('.ad-spot').forEach(ad => {
ad.style.opacity = '0.4'; // Dim the ads (opacity reduced)
});
}
});