bigpappic's picture
Let's deploy this
1f36718 verified
raw
history blame
1.33 kB
// Initialize tooltips
document.addEventListener('DOMContentLoaded', function() {
// Any shared JavaScript functionality can go here
console.log('The Ultimate Blank Canvas App is ready!');
// Example: Add a simple fade-in animation to all pages
document.body.style.opacity = '0';
setTimeout(() => {
document.body.style.transition = 'opacity 0.5s ease-in';
document.body.style.opacity = '1';
}, 100);
// Load projects if on projects page
if (window.location.pathname.includes('projects.html')) {
loadProjects();
}
});
async function loadProjects() {
try {
const response = await axios.get('https://jsonplaceholder.typicode.com/posts?_limit=6');
const projectsContainer = document.getElementById('projects-container');
projectsContainer.innerHTML = response.data.map(project => `
<div class="bg-white p-4 rounded-lg shadow border hover:shadow-md transition">
<h3 class="font-medium mb-2">${project.title}</h3>
<p class="text-sm text-gray-600 mb-2">Created: ${new Date().toLocaleDateString()}</p>
<a href="#" class="text-blue-600 text-sm">Open β†’</a>
</div>
`).join('');
} catch (error) {
console.error('Failed to load projects:', error);
}
}