-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathmain.js
More file actions
37 lines (30 loc) · 1.07 KB
/
main.js
File metadata and controls
37 lines (30 loc) · 1.07 KB
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
36
37
/**
* Scryft - Main UI logic
* Very minimal for the WIP homepage
*/
document.addEventListener('DOMContentLoaded', () => {
const disabledElements = document.querySelectorAll('.disabled');
const showBubble = (x, y) => {
const bubble = document.createElement('div');
bubble.className = 'toast-bubble';
bubble.textContent = "Still building this!";
bubble.style.left = `${x}px`;
bubble.style.top = `${y}px`;
document.body.appendChild(bubble);
// Cleanup
setTimeout(() => {
bubble.remove();
}, 1500);
};
disabledElements.forEach(el => {
el.addEventListener('click', (e) => {
e.preventDefault();
// Get click coordinates or element center
const rect = el.getBoundingClientRect();
const centerX = rect.left + rect.width / 2;
// Position at bottom for header/general elements
const centerY = rect.bottom;
showBubble(centerX, centerY);
});
});
});