리펙토링: Node.js 프로젝트 폴더 구조 적용

This commit is contained in:
2026-05-14 11:01:11 +09:00
parent 65ac35929a
commit dcd3c9a6e9
13 changed files with 4 additions and 4 deletions
+29
View File
@@ -0,0 +1,29 @@
const THUMB_MIN = 150;
const THUMB_MAX = 400;
let _thumbSizeHint;
let thumbSize = 250;
let thumbHintTimer = null;
export function init({ gridContainer, thumbSizeHint }) {
_thumbSizeHint = thumbSizeHint;
gridContainer.addEventListener('wheel', (e) => {
if (!e.ctrlKey) return;
e.preventDefault();
setThumbSize(thumbSize + (-e.deltaY * 0.8));
}, { passive: false });
}
export function setThumbSize(size) {
thumbSize = Math.round(Math.max(THUMB_MIN, Math.min(THUMB_MAX, size)));
document.documentElement.style.setProperty('--thumb-size', thumbSize + 'px');
_showHint(thumbSize);
}
function _showHint(size) {
_thumbSizeHint.textContent = `${size}px`;
_thumbSizeHint.classList.add('show');
clearTimeout(thumbHintTimer);
thumbHintTimer = setTimeout(() => _thumbSizeHint.classList.remove('show'), 1000);
}