APmanageur Wi-Fi V1.0
This commit is contained in:
1 parent
33cf355785
commit
f78e380236
3 files changed
+159
-19
No files matched your search
+24
-9
@@ -285,17 +285,21 @@
|
||||
/* SVG overlay for path */
|
||||
.path-svg {
|
||||
position: absolute;
|
||||
inset: 8px;
|
||||
top: 8px;
|
||||
left: 8px;
|
||||
width: calc(100% - 16px);
|
||||
height: calc(100% - 16px);
|
||||
pointer-events: none;
|
||||
z-index: 5;
|
||||
z-index: 10;
|
||||
overflow: visible !important;
|
||||
}
|
||||
.path-line {
|
||||
fill: none;
|
||||
stroke: var(--path-stroke);
|
||||
stroke-width: 6;
|
||||
stroke: var(--path-stroke, #5ca7ff);
|
||||
stroke-width: 7;
|
||||
stroke-linecap: round;
|
||||
stroke-linejoin: round;
|
||||
filter: drop-shadow(0 0 6px var(--path-stroke));
|
||||
filter: drop-shadow(0 0 6px var(--path-stroke, #5ca7ff));
|
||||
}
|
||||
|
||||
.bottom-actions {
|
||||
@@ -747,15 +751,25 @@
|
||||
|
||||
// Draw SVG polyline
|
||||
const svg = document.getElementById('pathSvg');
|
||||
const grid = document.getElementById('gridEl');
|
||||
if (!svg || !grid) return;
|
||||
svg.innerHTML = '';
|
||||
|
||||
const w = grid.offsetWidth;
|
||||
const h = grid.offsetHeight;
|
||||
svg.setAttribute('width', w);
|
||||
svg.setAttribute('height', h);
|
||||
svg.setAttribute('viewBox', `0 0 ${w} ${h}`);
|
||||
svg.style.width = w + 'px';
|
||||
svg.style.height = h + 'px';
|
||||
|
||||
if (path.length < 2) return;
|
||||
|
||||
const gridRect = document.getElementById('gridEl').getBoundingClientRect();
|
||||
const points = path.map(p => {
|
||||
const c = document.querySelector(`.cell[data-x="${p.x}"][data-y="${p.y}"]`);
|
||||
const r = c.getBoundingClientRect();
|
||||
const cx = r.left - gridRect.left + r.width / 2;
|
||||
const cy = r.top - gridRect.top + r.height / 2;
|
||||
if (!c) return '0,0';
|
||||
const cx = c.offsetLeft + c.offsetWidth / 2;
|
||||
const cy = c.offsetTop + c.offsetHeight / 2;
|
||||
return `${cx},${cy}`;
|
||||
}).join(' ');
|
||||
|
||||
@@ -909,6 +923,7 @@
|
||||
}
|
||||
});
|
||||
|
||||
window.addEventListener('resize', () => { renderPath(); });
|
||||
initLevel(LEVELS[1]);
|
||||
</script>
|
||||
</body>
|
||||
|
||||
Reference in new issue
Block a user