document.addEventListener('DOMContentLoaded', () => { loadBlogs(); }); function loadBlogs() { const blogsContainer = document.getElementById('blogsContainer'); const blogs = JSON.parse(localStorage.getItem('mubashra_blogs_v2')) || []; if (blogs.length > 0) { blogsContainer.innerHTML = ''; // Clear empty state blogs.forEach((blog, index) => { const card = document.createElement('div'); card.classList.add('blog-card'); // For this version, since the admin creates a free-form "canvas", // the safest way to "preview" it is to render the HTML structure. // However, to prevent styles from breaking the card, we might scale it or similar. // A simple approach: specific card layout. // But the user said "place it like canva". // So the blog is likely absolute positioned elements on a fixed size canvas. // We will render a mini version of that canvas. const previewScale = 0.3; // Scale down for card card.innerHTML = `
${new Date(blog.date).toLocaleDateString()}