threejs实现三维山峦山峰标注沙盘图效果代码
代码语言:html
所属分类:三维
代码描述:threejs实现三维山峦山峰标注沙盘图效果代码画效果代码,可设置明暗度、线框数量等参数。
下面为部分代码预览,完整代码请点击下载或在bfwstudio webide中打开
<!DOCTYPE html> <html lang="en"> <head> <meta charset="UTF-8"> <meta name="viewport" content="width=device-width, initial-scale=1.0, viewport-fit=cover"> <link href="https://fonts.googleapis.com/css2?family=Oswald:wght@400&display=swap" rel="stylesheet"> <style> * { box-sizing: border-box; } body { margin: 0; overflow: hidden; background: #112B3C; height: 100%; overflow: hidden; } body:after { content: ""; position: absolute; top: 0; left: 0; width: 100%; height: 100%; z-index: 100; box-shadow: 0 0 50px rgba(0, 0, 0, 0.3) inset; pointer-events: none; } @media (min-width: 750px) { body:after { box-shadow: 0 0 100px rgba(0, 0, 0, 0.3) inset; } } canvas { position: absolute; touch-action: none; } .ui { position: absolute; top: 10px; right: 10px; z-index: 105; display: flex; flex-direction: column; align-items: flex-end; } .ui label { display: flex; align-items: center; background: #EFEFEF; border-radius: 10px; padding: 8px; width: 36px; overflow: hidden; transition: 0.15s ease-in-out; font-size: 0; } .ui label + label { margin-top: 5px; } .ui label:focus-within, .ui label:hover { width: 146px; } .ui label:focus-within input, .ui label:hover input { margin-left: 10px; opacity: 1; } .ui input { width: 100px; opacity: 0; } .ui svg { flex-shrink: 0; width: 20px; } .tooltip { position: absolute; top: 0; left: 0; height: 0; width: 0; z-index: 1; } .tooltip path:first-child { transition: 0.05s ease-out; } .tooltip:focus-within, .tooltip:hover { z-index: 2; } .tooltip:focus-within path:first-child, .tooltip:hover path:first-child { fill: #f48f4b; } p { white-space: nowrap; color: white; background: #EFEFEF; color: #112B3C; position: absolute; top: 0; left: 50%; transform: translate(-50%, -90px); border-radius: 3px; padding: 5px 8px; pointer-events: none; opacity: 0; transition: 0.15s ease-out; font-weight: 400; font-family: "Oswald", sans-serif; } button:focus + p, button:hover + p { opacity: 1; .........完整代码请登录后点击上方下载按钮下载查看
网友评论0