codecraft-ai-studio / script.js
Abmacode12's picture
<!DOCTYPE html>
a7f24ff verified
document.addEventListener('DOMContentLoaded', () => {
console.log('CodeCraft AI Studio loaded');
// Initialize tooltips
const tooltipTriggerList = [].slice.call(document.querySelectorAll('[data-bs-toggle="tooltip"]'));
tooltipTriggerList.map(function (tooltipTriggerEl) {
return new bootstrap.Tooltip(tooltipTriggerEl);
});
// Handle theme switcher
const themeSwitcher = document.getElementById('themeSwitcher');
if (themeSwitcher) {
themeSwitcher.addEventListener('click', () => {
document.documentElement.classList.toggle('dark');
localStorage.setItem('darkMode', document.documentElement.classList.contains('dark'));
});
}
// Initialize feather icons
feather.replace();
});
// Sample function to handle project creation
function createNewProject() {
console.log('Creating new project...');
// Implementation would go here
}
// Sample function to handle file upload
function handleFileUpload(event) {
const file = event.target.files[0];
if (file) {
console.log('Uploading file:', file.name);
// Implementation would go here
}
}