leader-line+hammer实现图片区域标注提示效果代码
代码语言:html
所属分类:其他
代码描述:leader-line+hammer实现图片区域标注提示效果代码,鼠标放到深色区域试试。
代码标签: leader-line hammer 图片 区域 标注 提示
下面为部分代码预览,完整代码请点击下载或在bfwstudio webide中打开
<!DOCTYPE html> <html lang="en"> <head> <meta charset="UTF-8"> <meta name="viewport" content="user-scalable=no, width=device-width, initial-scale=1, maximum-scale=1"> <link rel='stylesheet' href='https://fonts.googleapis.com/css?family=Rubik+Mono+One&display=swap'> <style> * { margin: 0; padding: 0; box-sizing: border-box; } html { font-family: 'Rubik Mono One', sans-serif; font-size: 12px; } body { overflow: hidden; } .map { position: relative; width: 90%; height: 90vh; max-width: 1300px; margin: 1rem auto; border: 1rem solid #fff; border-radius: 1rem; box-shadow: 0 0 .5rem rgba(0, 0, 0, .3); } .map > svg { display: block; width: 100%; height: 100%; border-radius: .5rem; touch-action: none !important; } .map > .info { position: absolute; z-index: 1; bottom: -1px; left: 50%; -webkit-transform: translateX(-50%); transform: translateX(-50%); min-height: 3rem; width: 80%; padding: 0 1rem; border-radius: 1rem 1rem 0 0; line-height: 3rem; font-size: 1rem; text-align: center; background: #fff; pointer-events: none; } .building { transition: opacity .3s ease-in-out; } .building:hover { cursor: pointer; opacity: .8 !important; } .building.-available { fill: #0f0 !important; } .building.-reserved { fill: #f00 !important; } .building.-service { fill: #fff !important; } </style> </head> <body> <!-- partial:index.partial.html --> <div class='map' id='my-map'> <svg xmlns='http://www.w3.org/2000/svg' version='1.1' width='2400' height='1600' preserveAspectRatio='xMinYMin slice' viewBox='0 0 2400 1600'> <g class='buildings_layer'> <image xlink:href='//repo.bfw.wiki/bfwrepo/image/631170edf3174.png' y='0' x='0' preserveAspectRatio='none' height='1600' width='2400' /> <rect width='2400' height='1600' style='fill:rgb(255,255,255);stroke-width:0;opacity:0' /> <path style='opacity:0.3;fill:#ffffff;fill-opacity:1;fill-rule:evenodd;stroke:none;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1' d='m 755.85612,1434.204 2.172,5.792 70.95201,52.852 63.71202,-19.548 -3.62001,-97.74 135.38806,-78.192 53.576,6.516 -3.62,-112.2201 60.816,-18.824 -217.20005,-169.416 -157.83203,-43.44 -123.08002,99.912 -42.716,12.308 57.19601,49.232 4.344,85.432 39.82,16.652 62.98801,104.2561 z' class='building' data-building-id='0' /> <path style='opacity:0.3;fill:#ffffff;fill-opacity:1;fill-rule:evenodd;stroke:none;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1' d='m 1002.7402,1025.1439 2.896,49.956 129.596,97.74 -61.54,18.824 3.62,76.02 21.72,17.376 10.136,-12.308 44.164,26.0641 106.428,-29.6841 44.164,36.9241 42.716,-12.308 -44.888,-36.9241 48.508,-10.86 74.572,-59.368 -0.724,-93.396 60.816,-14.48 -233.128,-157.83201 -135.388,-33.30401 -110.048,81.08802 -58.64405,13.032 z' class='building' data-building-id='1' /> <path style='opacity:0.3;fill:#ffffff;fill-opacity:1;fill-rule:evenodd;stroke:none;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1' d='m 1739.5904,772.1843 50.1707,26.62116 1.5358,29.18089 168.942,98.29351 -53.2423,16.8942 -2.5597,91.63824 28.157,15.3583 97.2696,-82.42.........完整代码请登录后点击上方下载按钮下载查看
网友评论0