AI update: שדרוג לדף הדמו של 'אורלי חן עיצוב שיער' (עיצוב שיער נשי):

1) תמונות: בכל מקום שיש placeholder או חוסר תמונה — הוסף תמונ
This commit is contained in:
2026-08-19 19:26:18 +00:00
parent 8e52421c18
commit 790021f85c
3 changed files with 592 additions and 203 deletions
+92
View File
@@ -140,4 +140,96 @@
});
});
// Demo Popup functionality
var popup = document.getElementById('demoPopup');
var popupCloseBtn = popup ? popup.querySelector('.popup-close') : null;
var popupBackdrop = popup ? popup.querySelector('.popup-backdrop') : null;
var POPUP_DELAY = 5000; // 5 seconds
var POPUP_STORAGE_KEY = 'demoPopupShown';
function showPopup() {
if (!popup) return;
popup.classList.add('active');
document.body.classList.add('popup-open');
// Focus the close button for accessibility
if (popupCloseBtn) {
popupCloseBtn.focus();
}
}
function hidePopup() {
if (!popup) return;
popup.classList.remove('active');
document.body.classList.remove('popup-open');
// Mark as shown in session storage
try {
sessionStorage.setItem(POPUP_STORAGE_KEY, 'true');
} catch (e) {
// Session storage not available
}
}
function initPopup() {
if (!popup) return;
// Check if popup was already shown this session
try {
if (sessionStorage.getItem(POPUP_STORAGE_KEY) === 'true') {
return;
}
} catch (e) {
// Session storage not available, continue
}
// Show popup after delay (only if motion is not reduced)
if (!prefersReducedMotion) {
setTimeout(showPopup, POPUP_DELAY);
} else {
showPopup();
}
}
// Close popup on close button click
if (popupCloseBtn) {
popupCloseBtn.addEventListener('click', hidePopup);
}
// Close popup on backdrop click
if (popupBackdrop) {
popupBackdrop.addEventListener('click', hidePopup);
}
// Close popup on Escape key
document.addEventListener('keydown', function(e) {
if (e.key === 'Escape' && popup && popup.classList.contains('active')) {
hidePopup();
}
});
// Trap focus inside popup when open
if (popup) {
popup.addEventListener('keydown', function(e) {
if (e.key !== 'Tab') return;
var focusableElements = popup.querySelectorAll('button, [href], input, select, textarea, [tabindex]:not([tabindex="-1"])');
var firstElement = focusableElements[0];
var lastElement = focusableElements[focusableElements.length - 1];
if (e.shiftKey) {
if (document.activeElement === firstElement) {
lastElement.focus();
e.preventDefault();
}
} else {
if (document.activeElement === lastElement) {
firstElement.focus();
e.preventDefault();
}
}
});
}
// Initialize popup
initPopup();
})();