feat: Initialize Angular SSR application with core pages, components, and server setup.
This commit is contained in:
@@ -59,12 +59,6 @@ export class HomeComponent {
|
||||
showInput: boolean = true;
|
||||
tooltipTargetBeta = 'tooltipTargetBeta';
|
||||
|
||||
// Counter animation
|
||||
activeListingsCount = 0;
|
||||
successfulSalesCount = 0;
|
||||
brokersCount = 0;
|
||||
hasAnimated = false;
|
||||
|
||||
// FAQ data optimized for AEO (Answer Engine Optimization) and Featured Snippets
|
||||
faqItems: FAQItem[] = [
|
||||
{
|
||||
@@ -200,47 +194,6 @@ export class HomeComponent {
|
||||
this.user = map2User(token);
|
||||
this.loadCities();
|
||||
this.setTotalNumberOfResults();
|
||||
|
||||
// Setup intersection observer for counter animation
|
||||
this.setupCounterAnimation();
|
||||
}
|
||||
|
||||
setupCounterAnimation() {
|
||||
const observer = new IntersectionObserver(
|
||||
(entries) => {
|
||||
entries.forEach((entry) => {
|
||||
if (entry.isIntersecting && !this.hasAnimated) {
|
||||
this.hasAnimated = true;
|
||||
this.animateCounter('activeListingsCount', 1000, 2000);
|
||||
this.animateCounter('successfulSalesCount', 500, 2000);
|
||||
this.animateCounter('brokersCount', 50, 2000);
|
||||
}
|
||||
});
|
||||
},
|
||||
{ threshold: 0.3 }
|
||||
);
|
||||
|
||||
// Wait for the element to be available
|
||||
setTimeout(() => {
|
||||
const statsElement = document.querySelector('.stats-section');
|
||||
if (statsElement) {
|
||||
observer.observe(statsElement);
|
||||
}
|
||||
}, 100);
|
||||
}
|
||||
|
||||
animateCounter(property: 'activeListingsCount' | 'successfulSalesCount' | 'brokersCount', target: number, duration: number) {
|
||||
const start = 0;
|
||||
const increment = target / (duration / 16); // 60fps
|
||||
const step = () => {
|
||||
this[property] += increment;
|
||||
if (this[property] < target) {
|
||||
requestAnimationFrame(step);
|
||||
} else {
|
||||
this[property] = target;
|
||||
}
|
||||
};
|
||||
requestAnimationFrame(step);
|
||||
}
|
||||
|
||||
changeTab(tabname: 'business' | 'commercialProperty' | 'broker') {
|
||||
|
||||
Reference in New Issue
Block a user