From 4ee992e85501f185296a3117cf6ce9d75bf33a3a Mon Sep 17 00:00:00 2001 From: hmw1001 Date: Thu, 11 Jun 2026 19:46:39 +0900 Subject: [PATCH] =?UTF-8?q?js=20=EC=88=98=EC=A0=95=20=EB=82=B4=EC=9A=A9,?= =?UTF-8?q?=20dbconfig=20=EB=82=B4=EC=9A=A9=20=EC=88=98=EC=A0=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- data/dbconfig.php | 2 +- .../rb.layout/dnssash_main/js/products2.js | 44 ++++++++++++++++++- 2 files changed, 44 insertions(+), 2 deletions(-) diff --git a/data/dbconfig.php b/data/dbconfig.php index 623020b..6524251 100644 --- a/data/dbconfig.php +++ b/data/dbconfig.php @@ -1,6 +1,6 @@ { location.href = proLink; }; } + } else if(POPUP_MODE === 5 && imgElement) { + // [모드 2] 점선 연결선 정밀 계산 + const rect = this.getBoundingClientRect(); + const mainRect = mainArea.getBoundingClientRect(); + const targetX = mainRect.left + (mainRect.width * (parseFloat(x1) / 100)); + const targetY = mainRect.top + (mainRect.height * (parseFloat(y1) / 100)); + const isLeft = this.closest('.product-side').classList.contains('left'); + const startX = isLeft ? rect.right : rect.left; + const startY = rect.top + (rect.height / 2); + const dx = targetX - startX; + const dy = targetY - startY; + const dist = Math.sqrt(dx * dx + dy * dy); + let angle = Math.atan2(dy, dx) * 180 / Math.PI; + if (!isLeft) angle += 180; + + this.style.setProperty('--line-width', dist + 'px'); + this.style.setProperty('--line-angle', angle + 'deg'); + this.classList.add('show-connector'); + requestAnimationFrame(() => this.classList.add('active')); + if (imgElement) imgElement.style.transform = 'scale(1.2)'; + + if (imgElement && proLink) { + imgElement.style.cursor = 'pointer'; + imgElement.onclick = () => { location.href = proLink; }; + } + + var popupTimer = setTimeout(() => { + if (imgElement) { + const clone = imgElement.cloneNode(true); + clone.id = 'active-popup-img'; + clone.src = imgSrc; + if (proLink) { + clone.style.cursor = 'pointer'; + clone.style.pointerEvents = 'auto'; + clone.onclick = () => { location.href = proLink; }; + } + mainArea.appendChild(clone); + requestAnimationFrame(() => clone.classList.add('active')); + } + }, 1000); // 1000ms = 1초 대기 + } } });