File size: 1,210 Bytes
0477c6d | 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 | document.addEventListener('DOMContentLoaded', () => {
// Simulate terminal typing effect
const terminal = document.querySelector('.terminal');
if (terminal) {
setTimeout(() => {
const cursor = document.createElement('span');
cursor.className = 'terminal-cursor';
terminal.appendChild(cursor);
}, 1000);
}
// Handle AI panel interactions
const aiInput = document.querySelector('.ai-input');
if (aiInput) {
aiInput.addEventListener('keypress', (e) => {
if (e.key === 'Enter') {
const message = e.target.value.trim();
if (message) {
// In a real app, this would send to an API
console.log('AI query:', message);
e.target.value = '';
}
}
});
}
// File explorer click handler
const fileItems = document.querySelectorAll('.file-item');
fileItems.forEach(item => {
item.addEventListener('click', () => {
// In a real app, this would open the file in the editor
console.log('Opening file:', item.textContent.trim());
});
});
}); |