@@ -608,22 +608,59 @@ function initMarkers() {
608608(function() {
609609 'use strict';
610610
611+ // 1. ์์น ์๋ ์์ ์ ๊ฑฐ
612+ // 1-1. ์ ๊ฑฐํ ์์ selector ๋ชฉ๋ก (๊ฐ๋ฐ์ ๋๊ตฌ์์ selector ๋ณต์ฌํด์ ์ถ๊ฐ)
613+ var selectors = [
614+ '#__nuxt > div > div > div.page-content > div > div > div.panel_right > div.user-layers-panel.mb-5.collapsed',
615+ '#__nuxt > div > div > div.page-content > div > div > div.panel_right > div.squad-panel.mb-5.collapsed',
616+ '#__nuxt > div > div > div.cookie-consent',
617+ '#__nuxt > div > div > div.footer-wrap',
618+ '#__nuxt > div > div > header'
619+ ];
620+
621+ // 1-2. ๋ฑ๋ก๋ selector ์์ ์ ๊ฑฐ + ์ค๋ฒ์คํฌ๋กค ์ฐจ๋จ
622+ function removeUnwantedElements() {
623+ for (var i = 0; i < selectors.length; i++) {
624+ var sel = selectors[i];
625+ try {
626+ document.querySelectorAll(sel).forEach(el => el.remove());
627+ } catch (e) {
628+ console.warn('[deadZoneAutoPan] Invalid selector:', sel, e);
629+ }
630+ }
631+ }
632+ removeUnwantedElements();
633+
634+ // 1-3. DOM ๋ณ๊ฒฝ ๊ฐ์ง ์ ์ฌ์คํ (debounced)
635+ var removeScheduled = false;
636+ var unwantedObserver = new MutationObserver(function() {
637+ if (removeScheduled) return;
638+ removeScheduled = true;
639+ requestAnimationFrame(function() {
640+ removeScheduled = false;
641+ removeUnwantedElements();
642+ });
643+ });
644+ if (document.body) {
645+ unwantedObserver.observe(document.body, { childList: true, subtree: true });
646+ }
647+
611648 window.__deadZoneAutoPan = function(deadZonePercent) {
612- // 1 . ๋ง์ปค ์ฐพ๊ธฐ
649+ // 2 . ๋ง์ปค ์ฐพ๊ธฐ
613650 var markers = document.querySelectorAll('.marker');
614651 if (markers.length === 0) return JSON.stringify({ panned: false, reason: 'no-marker' });
615652 var marker = markers[markers.length - 1];
616653 var markerRect = marker.getBoundingClientRect();
617654 var markerCX = markerRect.left + markerRect.width / 2;
618655 var markerCY = markerRect.top + markerRect.height / 2;
619656
620- // 2 . ๋ทฐํฌํธ ๊ณ์ฐ (#map์ ๋ถ๋ชจ ๋๋ #map ์์ฒด)
657+ // 3 . ๋ทฐํฌํธ ๊ณ์ฐ (#map์ ๋ถ๋ชจ ๋๋ #map ์์ฒด)
621658 var mapEl = document.querySelector('#map');
622659 if (!mapEl) return JSON.stringify({ panned: false, reason: 'no-map' });
623660 var viewportEl = mapEl.parentElement || mapEl;
624661 var viewportRect = viewportEl.getBoundingClientRect();
625662
626- // 3 . ํจ๋ ๊ฐ์ง (tarkov-market ์ฌ์ด๋ ํจ๋)
663+ // 4 . ํจ๋ ๊ฐ์ง (tarkov-market ์ฌ์ด๋ ํจ๋)
627664 var effectiveLeft = viewportRect.left;
628665 var effectiveRight = viewportRect.right;
629666 var effectiveTop = viewportRect.top;
@@ -645,7 +682,7 @@ function initMarkers() {
645682 }
646683 }
647684
648- // 4 . deadZonePercent ๊ธฐ๋ฐ ๋ด๋ถ ๊ฒฝ๊ณ ์ฌ๊ฐํ ๊ณ์ฐ
685+ // 5 . deadZonePercent ๊ธฐ๋ฐ ๋ด๋ถ ๊ฒฝ๊ณ ์ฌ๊ฐํ ๊ณ์ฐ
649686 var effectiveWidth = effectiveRight - effectiveLeft;
650687 var effectiveHeight = effectiveBottom - effectiveTop;
651688 var inset = (100 - deadZonePercent) / 200;
@@ -654,20 +691,20 @@ function initMarkers() {
654691 var boundTop = effectiveTop + effectiveHeight * inset;
655692 var boundBottom = effectiveBottom - effectiveHeight * inset;
656693
657- // 5 . ๋ง์ปค๊ฐ ๊ฒฝ๊ณ ์์ ์์ผ๋ฉด ํฌ ๋ถํ์
694+ // 6 . ๋ง์ปค๊ฐ ๊ฒฝ๊ณ ์์ ์์ผ๋ฉด ํฌ ๋ถํ์
658695 if (markerCX >= boundLeft && markerCX <= boundRight &&
659696 markerCY >= boundTop && markerCY <= boundBottom) {
660697 return JSON.stringify({ panned: false, reason: 'inside-boundary' });
661698 }
662699
663- // 6 . ์ด๋๋ ๊ณ์ฐ
700+ // 7 . ์ด๋๋ ๊ณ์ฐ
664701 var dx = 0, dy = 0;
665702 if (markerCX < boundLeft) dx = markerCX - boundLeft;
666703 else if (markerCX > boundRight) dx = markerCX - boundRight;
667704 if (markerCY < boundTop) dy = markerCY - boundTop;
668705 else if (markerCY > boundBottom) dy = markerCY - boundBottom;
669706
670- // 7 . pointer ์ด๋ฒคํธ ์๋ฎฌ๋ ์ด์
์ผ๋ก ๋งต ํฌ
707+ // 8 . pointer ์ด๋ฒคํธ ์๋ฎฌ๋ ์ด์
์ผ๋ก ๋งต ํฌ
671708 var panTarget = mapEl.parentElement || mapEl;
672709 var startX = effectiveLeft + effectiveWidth / 2;
673710 var startY = effectiveTop + effectiveHeight / 2;
0 commit comments