AI update: שדרוג ויזואלי מקיף לאתר עמוס רוזמרין - מהנדס אריזה:
## 1. תמונות אמיתיות (הוסף מ-Unsplash/Pexels CDN): ### Hero Sectio
This commit is contained in:
@@ -47,7 +47,7 @@
|
||||
// Check for reduced motion preference
|
||||
const prefersReducedMotion = window.matchMedia('(prefers-reduced-motion: reduce)').matches;
|
||||
|
||||
// Scroll Reveal Animation with staggered delays
|
||||
// Scroll Reveal Animation
|
||||
const observerOptions = {
|
||||
root: null,
|
||||
rootMargin: '0px 0px -80px 0px',
|
||||
@@ -55,29 +55,16 @@
|
||||
};
|
||||
|
||||
const revealObserver = new IntersectionObserver(function(entries) {
|
||||
entries.forEach(function(entry, index) {
|
||||
entries.forEach(function(entry) {
|
||||
if (entry.isIntersecting) {
|
||||
// Add staggered delay for grid items
|
||||
const delay = entry.target.dataset.delay || 0;
|
||||
setTimeout(function() {
|
||||
entry.target.classList.add('revealed');
|
||||
}, delay * 100);
|
||||
entry.target.classList.add('revealed');
|
||||
revealObserver.unobserve(entry.target);
|
||||
}
|
||||
});
|
||||
}, observerOptions);
|
||||
|
||||
if (!prefersReducedMotion) {
|
||||
document.querySelectorAll('.reveal-fade, .reveal-slide').forEach(function(el, index) {
|
||||
// Add stagger delay to grid children
|
||||
const parent = el.parentElement;
|
||||
if (parent && (parent.classList.contains('expertise-grid') ||
|
||||
parent.classList.contains('products-grid') ||
|
||||
parent.classList.contains('advantages-grid') ||
|
||||
parent.classList.contains('industries-grid') ||
|
||||
parent.classList.contains('clients-logos-grid'))) {
|
||||
el.dataset.delay = index;
|
||||
}
|
||||
document.querySelectorAll('.reveal-fade, .reveal-slide').forEach(function(el) {
|
||||
revealObserver.observe(el);
|
||||
});
|
||||
} else {
|
||||
@@ -86,60 +73,45 @@
|
||||
});
|
||||
}
|
||||
|
||||
// Counter Animation
|
||||
function animateCounter(element) {
|
||||
const target = parseInt(element.dataset.count, 10);
|
||||
const duration = 2000;
|
||||
const start = 0;
|
||||
const startTime = performance.now();
|
||||
|
||||
function update(currentTime) {
|
||||
const elapsed = currentTime - startTime;
|
||||
const progress = Math.min(elapsed / duration, 1);
|
||||
|
||||
// Easing function for smooth animation
|
||||
const easeOutQuart = 1 - Math.pow(1 - progress, 4);
|
||||
const current = Math.floor(start + (target - start) * easeOutQuart);
|
||||
|
||||
element.textContent = current;
|
||||
|
||||
if (progress < 1) {
|
||||
requestAnimationFrame(update);
|
||||
} else {
|
||||
element.textContent = target;
|
||||
}
|
||||
// Count Up Animation for Stats
|
||||
function countUp(element, target, duration) {
|
||||
if (prefersReducedMotion) {
|
||||
element.textContent = target;
|
||||
return;
|
||||
}
|
||||
|
||||
requestAnimationFrame(update);
|
||||
let start = 0;
|
||||
const increment = target / (duration / 16);
|
||||
const timer = setInterval(function() {
|
||||
start += increment;
|
||||
if (start >= target) {
|
||||
element.textContent = target;
|
||||
clearInterval(timer);
|
||||
} else {
|
||||
element.textContent = Math.floor(start);
|
||||
}
|
||||
}, 16);
|
||||
}
|
||||
|
||||
// Observer for counter animation
|
||||
const counterObserver = new IntersectionObserver(function(entries) {
|
||||
const statsObserver = new IntersectionObserver(function(entries) {
|
||||
entries.forEach(function(entry) {
|
||||
if (entry.isIntersecting && !prefersReducedMotion) {
|
||||
const counters = entry.target.querySelectorAll('[data-count]');
|
||||
counters.forEach(function(counter) {
|
||||
if (!counter.classList.contains('counted')) {
|
||||
counter.classList.add('counted');
|
||||
animateCounter(counter);
|
||||
}
|
||||
if (entry.isIntersecting) {
|
||||
const statNumbers = entry.target.querySelectorAll('.stat-number[data-count]');
|
||||
statNumbers.forEach(function(stat) {
|
||||
const target = parseInt(stat.getAttribute('data-count'), 10);
|
||||
countUp(stat, target, 2000);
|
||||
});
|
||||
counterObserver.unobserve(entry.target);
|
||||
statsObserver.unobserve(entry.target);
|
||||
}
|
||||
});
|
||||
}, { threshold: 0.5 });
|
||||
|
||||
const statsSection = document.querySelector('.hero-stats');
|
||||
if (statsSection) {
|
||||
counterObserver.observe(statsSection);
|
||||
const heroStats = document.querySelector('.hero-stats');
|
||||
if (heroStats) {
|
||||
statsObserver.observe(heroStats);
|
||||
}
|
||||
|
||||
const experienceBadge = document.querySelector('.about-experience-badge');
|
||||
if (experienceBadge) {
|
||||
counterObserver.observe(experienceBadge);
|
||||
}
|
||||
|
||||
// Layer animation observer for tech section
|
||||
// Layer animation observer
|
||||
const layerObserver = new IntersectionObserver(function(entries) {
|
||||
entries.forEach(function(entry) {
|
||||
if (entry.isIntersecting) {
|
||||
@@ -154,24 +126,6 @@
|
||||
layerObserver.observe(layersVisual);
|
||||
}
|
||||
|
||||
// Progress bar animation
|
||||
const progressObserver = new IntersectionObserver(function(entries) {
|
||||
entries.forEach(function(entry) {
|
||||
if (entry.isIntersecting) {
|
||||
entry.target.classList.add('revealed');
|
||||
progressObserver.unobserve(entry.target);
|
||||
}
|
||||
});
|
||||
}, { threshold: 0.5 });
|
||||
|
||||
document.querySelectorAll('.tech-features li').forEach(function(li) {
|
||||
if (!prefersReducedMotion) {
|
||||
progressObserver.observe(li);
|
||||
} else {
|
||||
li.classList.add('revealed');
|
||||
}
|
||||
});
|
||||
|
||||
// Header scroll effect
|
||||
const header = document.querySelector('.site-header');
|
||||
let lastScrollY = 0;
|
||||
@@ -190,30 +144,15 @@
|
||||
|
||||
window.addEventListener('scroll', updateHeader, { passive: true });
|
||||
|
||||
// Parallax effect for particles
|
||||
if (!prefersReducedMotion) {
|
||||
window.addEventListener('scroll', function() {
|
||||
const scrollY = window.scrollY;
|
||||
const particles = document.querySelectorAll('.particle');
|
||||
|
||||
particles.forEach(function(particle, index) {
|
||||
const speed = 0.1 + (index * 0.02);
|
||||
particle.style.transform = `translateY(${scrollY * speed}px)`;
|
||||
});
|
||||
}, { passive: true });
|
||||
}
|
||||
|
||||
// 3D Tilt effect for cards
|
||||
// 3D Tilt Effect for Cards
|
||||
if (!prefersReducedMotion) {
|
||||
document.querySelectorAll('[data-tilt]').forEach(function(card) {
|
||||
card.addEventListener('mousemove', function(e) {
|
||||
const rect = card.getBoundingClientRect();
|
||||
const x = e.clientX - rect.left;
|
||||
const y = e.clientY - rect.top;
|
||||
|
||||
const centerX = rect.width / 2;
|
||||
const centerY = rect.height / 2;
|
||||
|
||||
const rotateX = (y - centerY) / 20;
|
||||
const rotateY = (centerX - x) / 20;
|
||||
|
||||
@@ -221,30 +160,35 @@
|
||||
});
|
||||
|
||||
card.addEventListener('mouseleave', function() {
|
||||
card.style.transform = '';
|
||||
card.style.transform = 'perspective(1000px) rotateX(0) rotateY(0) translateY(0)';
|
||||
});
|
||||
});
|
||||
}
|
||||
|
||||
// Ripple effect for buttons
|
||||
document.querySelectorAll('.btn-glow').forEach(function(btn) {
|
||||
btn.addEventListener('click', function(e) {
|
||||
const ripple = btn.querySelector('.btn-ripple');
|
||||
if (ripple) {
|
||||
ripple.style.transform = 'scale(0)';
|
||||
ripple.style.opacity = '0';
|
||||
|
||||
setTimeout(function() {
|
||||
ripple.style.transform = 'scale(2)';
|
||||
ripple.style.opacity = '1';
|
||||
}, 10);
|
||||
|
||||
setTimeout(function() {
|
||||
ripple.style.transform = 'scale(0)';
|
||||
ripple.style.opacity = '0';
|
||||
}, 500);
|
||||
// Parallax effect for particles
|
||||
if (!prefersReducedMotion) {
|
||||
window.addEventListener('scroll', function() {
|
||||
const particles = document.querySelectorAll('.particle');
|
||||
const scrollY = window.scrollY;
|
||||
|
||||
particles.forEach(function(particle, index) {
|
||||
const speed = 0.05 + (index * 0.02);
|
||||
particle.style.transform = `translateY(${scrollY * speed}px)`;
|
||||
});
|
||||
}, { passive: true });
|
||||
}
|
||||
|
||||
// Feature progress bars animation
|
||||
const featureObserver = new IntersectionObserver(function(entries) {
|
||||
entries.forEach(function(entry) {
|
||||
if (entry.isIntersecting) {
|
||||
entry.target.classList.add('revealed');
|
||||
}
|
||||
});
|
||||
}, { threshold: 0.5 });
|
||||
|
||||
document.querySelectorAll('.tech-features li').forEach(function(li) {
|
||||
featureObserver.observe(li);
|
||||
});
|
||||
|
||||
// Form handling
|
||||
@@ -277,10 +221,12 @@
|
||||
|
||||
submitBtn.textContent = 'שולח...';
|
||||
submitBtn.disabled = true;
|
||||
submitBtn.style.opacity = '0.7';
|
||||
|
||||
setTimeout(function() {
|
||||
submitBtn.textContent = 'נשלח בהצלחה! ✓';
|
||||
submitBtn.textContent = 'נשלח בהצלחה!';
|
||||
submitBtn.style.background = 'linear-gradient(135deg, #22c55e, #16a34a)';
|
||||
submitBtn.style.opacity = '1';
|
||||
|
||||
setTimeout(function() {
|
||||
submitBtn.textContent = originalText;
|
||||
@@ -296,14 +242,6 @@
|
||||
this.style.borderColor = '';
|
||||
this.style.boxShadow = '';
|
||||
});
|
||||
|
||||
field.addEventListener('focus', function() {
|
||||
this.parentElement.classList.add('focused');
|
||||
});
|
||||
|
||||
field.addEventListener('blur', function() {
|
||||
this.parentElement.classList.remove('focused');
|
||||
});
|
||||
});
|
||||
}
|
||||
|
||||
@@ -325,47 +263,36 @@
|
||||
});
|
||||
});
|
||||
|
||||
// Staggered animation for grid items
|
||||
// Ripple effect on buttons
|
||||
document.querySelectorAll('.btn-glow').forEach(function(btn) {
|
||||
btn.addEventListener('click', function(e) {
|
||||
const ripple = this.querySelector('.btn-ripple');
|
||||
if (ripple) {
|
||||
ripple.style.transform = 'scale(0)';
|
||||
ripple.style.opacity = '0';
|
||||
setTimeout(function() {
|
||||
ripple.style.transform = '';
|
||||
ripple.style.opacity = '';
|
||||
}, 10);
|
||||
}
|
||||
});
|
||||
});
|
||||
|
||||
// Add staggered animation delay to grid items
|
||||
if (!prefersReducedMotion) {
|
||||
const grids = [
|
||||
'.expertise-grid .expertise-card',
|
||||
'.products-grid .product-card',
|
||||
'.advantages-grid .advantage-item',
|
||||
'.industries-grid .industry-card',
|
||||
'.clients-logos-grid .client-logo-card'
|
||||
];
|
||||
|
||||
grids.forEach(function(selector) {
|
||||
document.querySelectorAll(selector).forEach(function(card, index) {
|
||||
card.style.transitionDelay = (index * 0.1) + 's';
|
||||
});
|
||||
document.querySelectorAll('.expertise-grid .expertise-card, .products-grid .product-card, .advantages-grid .advantage-item, .industries-grid .industry-card').forEach(function(card, index) {
|
||||
card.style.transitionDelay = (index * 0.1) + 's';
|
||||
});
|
||||
}
|
||||
|
||||
// Typewriter effect for hero title (optional enhancement)
|
||||
const typewriterElement = document.querySelector('.typewriter');
|
||||
if (typewriterElement && !prefersReducedMotion) {
|
||||
const text = typewriterElement.textContent;
|
||||
typewriterElement.textContent = '';
|
||||
typewriterElement.style.opacity = '1';
|
||||
|
||||
let i = 0;
|
||||
function typeWriter() {
|
||||
if (i < text.length) {
|
||||
typewriterElement.textContent += text.charAt(i);
|
||||
i++;
|
||||
setTimeout(typeWriter, 50);
|
||||
}
|
||||
}
|
||||
|
||||
// Start typewriter after page load
|
||||
setTimeout(typeWriter, 800);
|
||||
}
|
||||
|
||||
// Initialize on DOM ready
|
||||
document.addEventListener('DOMContentLoaded', function() {
|
||||
// Add loaded class to body for CSS animations
|
||||
document.body.classList.add('loaded');
|
||||
// Logo cards hover glow effect
|
||||
document.querySelectorAll('.client-logo-card').forEach(function(card) {
|
||||
card.addEventListener('mouseenter', function() {
|
||||
this.style.filter = 'brightness(1.1)';
|
||||
});
|
||||
card.addEventListener('mouseleave', function() {
|
||||
this.style.filter = '';
|
||||
});
|
||||
});
|
||||
|
||||
})();
|
||||
|
||||
Reference in New Issue
Block a user