企业A:目录/栏杆机:修订间差异
来自鲁班出摊
无编辑摘要 标签:已被回退 |
无编辑摘要 标签:手工回退 |
||
| 第4行: | 第4行: | ||
<style> | <style> | ||
/* ========== | /* ======================================================== | ||
全局基础样式 | |||
======================================================== */ | |||
* { margin: 0; padding: 0; box-sizing: border-box; } | * { margin: 0; padding: 0; box-sizing: border-box; } | ||
body { | body { | ||
background: #eef2f7; | background: #eef2f7; | ||
padding: 20px; | padding: 20px; | ||
font-family: "Microsoft YaHei" | font-family: "Microsoft YaHei"; | ||
display: flex; | display: flex; | ||
justify-content: center; | |||
justify-content: center; | |||
} | } | ||
/* ======================================================== | |||
外层容器与图片样式 | |||
======================================================== */ | |||
.container { | .container { | ||
position: relative; | position: relative; | ||
width: 90%; | width: 90%; | ||
max-width: 900px; | max-width: 900px; | ||
} | } | ||
.image { | .image { | ||
width: 100%; | width: 100%; | ||
| 第26行: | 第31行: | ||
} | } | ||
/* ========== | /* ======================================================== | ||
标记点样式 | |||
======================================================== */ | |||
.marker { | .marker { | ||
position: absolute; | position: absolute; | ||
width: 0. | width: 0.3vw; | ||
height: 0. | height: 0.3vw; | ||
min-width: 4px; | min-width: 4px; | ||
min-height: 4px; | min-height: 4px; | ||
border-radius: 50%; | border-radius: 50%; | ||
background: rgba(255, | background: rgba(255, 255, 255, 1); | ||
cursor: pointer; | |||
transform: translate(-50%, -50%); | transform: translate(-50%, -50%); | ||
z-index: 10; | z-index: 10; | ||
| 第46行: | 第48行: | ||
} | } | ||
/* ========== | .marker:hover { | ||
transform: translate(-50%, -50%) scale(1.4); | |||
background: rgb(0,255,0); | |||
color: rgb(255,0,0); | |||
} | |||
/* ======================================================== | |||
文本框样式 | |||
======================================================== */ | |||
.text-note { | .text-note { | ||
position: absolute; | position: absolute; | ||
transform: translate(0, -50%); | transform: translate(0, -50%); | ||
background: rgba(255, 255, 255, 0.9); | background: rgba(255, 255, 255, 0.9); | ||
border: | border: 2px solid #3498db; | ||
padding: 0.6vw 1vw; | padding: 0.6vw 1vw; | ||
font-size: 1vw; | font-size: 1vw; | ||
min-font-size: 12px; | min-font-size: 12px; | ||
border-radius: | border-radius: 6px; | ||
z-index: 9; | |||
cursor: pointer; | |||
transition: 0.2s; | |||
font-weight: bold; | font-weight: bold; | ||
text-align: | text-align: center; | ||
color: # | } | ||
.text-note:hover { | |||
background: #3498db; | |||
color: #fff; | |||
} | |||
/* ======================================================== | |||
连线样式 | |||
======================================================== */ | |||
.connector { | |||
position: absolute; | |||
width: 100%; | |||
height: 100%; | |||
top: 0; left: 0; | |||
pointer-events: none; | |||
} | } | ||
.connector line { | |||
stroke: rgb(0, 255, 0); | |||
stroke-width: 1; | |||
stroke-dasharray: 2,2; | |||
} | |||
</style> | </style> | ||
</head> | </head> | ||
<body> | <body> | ||
<div class="container" id="box" style="position: relative;"> | |||
<div class="container" style="position: relative;"> | <img class="image" id="image" src="http://10.20.9.176:8080/images/6/6f/%E4%BB%BB%E5%8A%A1%E5%AF%BC%E8%88%AA-%E6%A0%8F%E6%9D%86%E6%9C%BA.jpg"> | ||
<img class="image" src="http://10.20.9.176:8080/images/ | |||
<div class="marker" style="top: | <div class="marker" style="top:64.59%; left:26.24%;" data-link="http://10.20.9.176:8080/index.php/企业A:目录/栏杆机/车检器拆除/车检器"></div> | ||
<div class=" | <div class="text-note" style="top:62.94%; left:50.04%;" data-link="http://10.20.9.176:8080/index.php/企业A:目录/栏杆机/车检器拆除/车检器"> 栏杆机<br>点击跳转 </div> | ||
< | <svg class="connector" id="connector" ></svg> | ||
</div> | </div> | ||
<script> | |||
/* ======================================================== | |||
点击跳转脚本 | |||
========================================================= */ | |||
document.querySelectorAll(".marker, .text-note").forEach(el => { | |||
el.onclick = () => window.location.href = el.dataset.link; | |||
}); | |||
/* ======================================================== | |||
连线自动计算脚本 | |||
========================================================= */ | |||
function updateLines() { | |||
const svg = document.getElementById("connector"); | |||
svg.innerHTML = ""; | |||
const markers = document.querySelectorAll(".marker"); | |||
const texts = document.querySelectorAll(".text-note"); | |||
const box = document.getElementById("box").getBoundingClientRect(); | |||
const count = Math.min(markers.length, texts.length); | |||
for (let i = 0; i < count; i++) { | |||
const a = markers[i].getBoundingClientRect(); | |||
const b = texts[i].getBoundingClientRect(); | |||
const x1 = a.left - box.left + a.width / 2; | |||
const y1 = a.top - box.top + a.height / 2; | |||
const x2 = b.left - box.left; | |||
const y2 = b.top - box.top + b.height / 2; | |||
const line = document.createElementNS("http://www.w3.org/2000/svg", "line"); | |||
line.setAttribute("x1", x1); | |||
line.setAttribute("y1", y1); | |||
line.setAttribute("x2", x2); | |||
line.setAttribute("y2", y2); | |||
svg.appendChild(line); | |||
} | |||
} | |||
window.addEventListener("load", updateLines); | |||
window.addEventListener("resize", updateLines); | |||
</script> | |||
</body> | </body> | ||
</html> | </html> | ||
2026年5月26日 (二) 17:10的版本
栏杆机
点击跳转
点击跳转
