Skip to content

Commit 28ef64b

Browse files
committed
🔥 Cleans up the code
1 parent ece4d9e commit 28ef64b

2 files changed

Lines changed: 5 additions & 28 deletions

File tree

‎src/scripts/explain-code.ts‎

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,11 @@
11
const sheets = new Map<string, HTMLDivElement>();
2+
let isInitialized = false;
23

34
function initExplainCodeButtons() {
5+
// Prevent multiple initializations
6+
if (isInitialized) return;
7+
isInitialized = true;
8+
49
// Use event delegation on document body to catch all clicks
510
document.body.addEventListener("click", (e) => {
611
const target = e.target as HTMLElement;

‎src/styles/sheet.css‎

Lines changed: 0 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -1,31 +1,11 @@
1-
.sheet-overlay,
21
.sheet-content {
32
display: none;
43
}
54

6-
.sheet-overlay[data-state="open"],
75
.sheet-content[data-state="open"] {
86
display: block;
97
}
108

11-
@keyframes fade-in {
12-
from {
13-
opacity: 0;
14-
}
15-
to {
16-
opacity: 1;
17-
}
18-
}
19-
20-
@keyframes fade-out {
21-
from {
22-
opacity: 1;
23-
}
24-
to {
25-
opacity: 0;
26-
}
27-
}
28-
299
@keyframes slide-in-from-right {
3010
from {
3111
transform: translateX(100%);
@@ -106,14 +86,6 @@
10686
animation-fill-mode: forwards;
10787
}
10888

109-
.fade-in-0 {
110-
animation: fade-in 0.2s ease-in-out;
111-
}
112-
113-
.fade-out-0 {
114-
animation: fade-out 0.2s ease-in-out;
115-
}
116-
11789
.slide-in-from-right {
11890
animation: slide-in-from-right 0.5s ease-in-out;
11991
}

0 commit comments

Comments
 (0)