![]() Server : Apache/2 System : Linux server-15-235-50-60 5.15.0-164-generic #174-Ubuntu SMP Fri Nov 14 20:25:16 UTC 2025 x86_64 User : gositeme ( 1004) PHP Version : 8.2.29 Disable Function : exec,system,passthru,shell_exec,proc_close,proc_open,dl,popen,show_source,posix_kill,posix_mkfifo,posix_getpwuid,posix_setpgid,posix_setsid,posix_setuid,posix_setgid,posix_seteuid,posix_setegid,posix_uname Directory : /home/gositeme/domains/brickabois.com/public_html/assets/js/ |
/**
* Live Activity Feed - Real-time Updates
*/
class LiveActivityFeed {
constructor() {
this.updateInterval = 30000; // 30 seconds
this.init();
}
init() {
this.updateFeed();
setInterval(() => this.updateFeed(), this.updateInterval);
}
async updateFeed() {
try {
// Fetch latest posts
const response = await fetch('/api/commons/posts?limit=3');
const data = await response.json();
if (data.posts && data.posts.length > 0) {
this.animateNewPosts(data.posts);
}
} catch (error) {
console.log('Live feed update failed:', error);
}
}
animateNewPosts(posts) {
const feedContainer = document.querySelector('.posts-list');
if (!feedContainer) return;
// Add pulse animation to indicate new content
feedContainer.style.animation = 'pulse 0.5s ease';
setTimeout(() => {
feedContainer.style.animation = '';
}, 500);
}
}
// Initialize live feed
document.addEventListener('DOMContentLoaded', () => {
if (document.querySelector('.posts-list')) {
new LiveActivityFeed();
}
});