forked from homo-developer/rathell
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathindex.js
24 lines (22 loc) · 1.24 KB
/
index.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
const terminal = document.getElementById('terminal');
function showNotification(type, message) {
const notification = document.createElement('div');
notification.className = `notification ${type}`;
notification.innerHTML = `<i class="fas fa-${type === 'success' ? 'check-circle' : type === 'error' ? 'exclamation-circle' : 'exclamation-triangle'}"></i> ${message}`;
document.body.appendChild(notification);
setTimeout(() => {
notification.style.animation = 'fadeInUp 0.5s ease reverse';
setTimeout(() => notification.remove(), 500);
}, 3000);
}
document.querySelectorAll('.tool-button').forEach(button => {
button.addEventListener('click', () => {
const toolName = button.parentElement.querySelector('h3').textContent;
const line = document.createElement('div');
line.className = 'terminal-line info';
line.textContent = `> Launching ${toolName}...`;
terminal.appendChild(line);
terminal.scrollTop = terminal.scrollHeight;
showNotification('success', `${toolName} launched successfully!`);
});
});