Skip to content

Commit 566dd0e

Browse files
authored
Update script.js
1 parent 952b968 commit 566dd0e

1 file changed

Lines changed: 3 additions & 18 deletions

File tree

hacker-lang/script.js

Lines changed: 3 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
// ─── Sidebar active link tracking ────────────────────────────────────────────
21
const sections = document.querySelectorAll('section[id]');
32
const links = document.querySelectorAll('.sidebar a');
43

@@ -29,18 +28,13 @@ document.querySelectorAll('.code-block').forEach(block => {
2928
cursor: pointer; text-transform: uppercase; transition: all 0.15s;
3029
`;
3130

32-
btn.addEventListener('mouseenter', () => {
33-
btn.style.background = 'rgba(168,85,247,0.22)';
34-
});
35-
btn.addEventListener('mouseleave', () => {
36-
btn.style.background = 'rgba(168,85,247,0.12)';
37-
});
31+
btn.addEventListener('mouseenter', () => { btn.style.background = 'rgba(168,85,247,0.22)'; });
32+
btn.addEventListener('mouseleave', () => { btn.style.background = 'rgba(168,85,247,0.12)'; });
3833

3934
btn.addEventListener('click', () => {
4035
const pre = block.querySelector('pre');
4136
if (!pre) return;
42-
const text = pre.innerText;
43-
navigator.clipboard.writeText(text).then(() => {
37+
navigator.clipboard.writeText(pre.innerText).then(() => {
4438
btn.textContent = 'SKOPIOWANO';
4539
btn.style.color = '#34d399';
4640
btn.style.borderColor = 'rgba(52,211,153,0.3)';
@@ -54,12 +48,3 @@ document.querySelectorAll('.code-block').forEach(block => {
5448

5549
header.appendChild(btn);
5650
});
57-
58-
// ─── Keyboard shortcut: '/' focuses search (if present) ──────────────────────
59-
document.addEventListener('keydown', e => {
60-
if (e.key === '/' && document.activeElement.tagName !== 'INPUT') {
61-
e.preventDefault();
62-
const first = document.querySelector('.sidebar a');
63-
if (first) first.focus();
64-
}
65-
});

0 commit comments

Comments
 (0)