three实现三维高山山顶跳山体验代码
代码语言:html
所属分类:三维
代码描述:three实现三维高山山顶跳山体验代码
下面为部分代码预览,完整代码请点击下载或在bfwstudio webide中打开
<!DOCTYPE html>
<html lang="zh-CN">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=no">
<title>云端漫步 · 云海日出跳伞</title>
<style>
* { margin:0; padding:0; box-sizing:border-box; }
html,body { width:100%; height:100%; overflow:hidden; touch-action:none;
font-family:"PingFang SC","Microsoft YaHei",system-ui,sans-serif; background:#ffe8cc; }
#app { position:fixed; inset:0; }
canvas { display:block; }
/* ---------- 暖色暗角 ---------- */
#vignette { position:fixed; inset:0; pointer-events:none; z-index:3;
background:radial-gradient(ellipse at center, transparent 55%, rgba(120,80,40,.16) 100%); }
/* ---------- 穿云白幕 ---------- */
#whiteout { position:fixed; inset:0; background:#fff6ea; opacity:0; pointer-events:none; z-index:4; }
/* ---------- 信息面板 ---------- */
#panel { position:fixed; top:14px; left:14px; z-index:10; max-width:270px;
background:rgba(255,252,246,.85); backdrop-filter:blur(10px); -webkit-backdrop-filter:blur(10px);
border:1px solid rgba(255,255,255,.7); border-radius:18px; padding:14px 16px;
box-shadow:0 8px 30px rgba(150,100,50,.18); color:#4a3f33; }
#panel h1 { font-size:17px; letter-spacing:1px; }
#panel .sub { font-size:11px; color:#9a8a72; margin:2px 0 10px; }
.chips { display:flex; gap:6px; flex-wrap:wrap; margin-bottom:10px; }
.chip { font-size:12px; background:#fff; border:1px solid #eadfce; border-radius:999px;
padding:4px 10px; color:#6b5b45; white-space:nowrap; }
.chip b { color:#e07a1f; }
#keys { font-size:11.5px; line-height:1.9; color:#7d6f5b; border-top:1px dashed #e5d8c4; padding-top:8px; }
#keys kbd { background:#f4ecdf; border:1px solid #e0d3bd; border-bottom-width:2px; border-radius:5px;
padding:0 5px; font-size:10.5px; font-family:inherit; color:#5b4c38; }
#panel.collapsed #keys { display:none; }
/* ---------- 右上按钮 ---------- */
#topbtns { position:fixed; top:14px; right:14px; z-index:10; display:flex; gap:8px; }
.tbtn { border:1px solid rgba(255,255,255,.7); background:rgba(255,252,246,.85);
backdrop-filter:blur(10px); border-radius:999px; padding:8px 14px; font-size:13px;
color:#6b5b45; cursor:pointer; box-shadow:0 4px 16px rgba(150,100,50,.15); user-select:none; }
.tbtn:active { transform:scale(.95); }
/* ---------- 提示气泡 ---------- */
#toast { position:fixed; top:76px; left:50%; transform:translateX(-50%) translateY(-8px); z-index:11;
background:rgba(70,52,35,.88); color:#fff4e2; font-size:14px; padding:10px 20px;
border-radius:999px; opacity:0; transition:all .35s ease; pointer-events:none;
box-shadow:0 6px 24px rgba(80,50,20,.3); white-space:nowrap; }
#toast.show { opacity:1; transform:translateX(-50%) translateY(0); }
/* ---------- 触屏摇杆 ---------- */
#joy { position:fixed; left:22px; bottom:26px; width:118px; height:118px; z-index:12;
border-radius:50%; background:rgba(255,252,246,.35); border:2px solid rgba(255,255,255,.6);
backdrop-filter:blur(6px); display:none; }
#knob { position:absolute; left:50%; top:50%; width:52px; height:52px; margin:-26px 0 0 -26px;
border-radius:50%; background:rgba(255,255,255,.9); box-shadow:0 4px 14px rgba(120,80,40,.3); }
#actbtn { position:fixed; right:24px; bottom:34px; z-index:12; width:86px; height:86px;
border-radius:50%; border:none; display:none; font-size:16px; font-weight:bold; color:#fff;
background:linear-gradient(160deg,#ffb054,#ff7a1a); box-shadow:0 8px 24px rgba(220,110,20,.45);
cursor:pointer; user-select:none; }
#actbtn:active { transform:scale(.93); }
body.touch #joy, body.touch #actbtn { display:block; }
/* ---------- 加载页 ---------- */
#loading { position:fixed; inset:0; z-index:50; display:flex; flex-direction:column;
align-items:center; justify-content:center; gap:14px;
background:linear-gradient(180deg,#a8cdf0 0%,#ffd9a8 70%,#fff3e0 100%);
color:#7a5a35; font-size:15px; letter-spacing:2px; transition:opacity .8s ease; }
#loading.hide { opacity:0; pointer-events:none; }
#loading .sun { width:64px; height:64px; border-radius:50%;
background:radial-gradient(circle,#fff6d8,#ffc46b); box-shadow:0 0 60px 20px rgba(255,190,100,.7);
animation:pulse 1.6s ease-in-out infinite; }
@keyframes pulse { 50% { transform:scale(1.15); } }
#credit { position:fixed; right:14px; bottom:10px; z-index:9; font-size:10px;
color:rgba(120,90,55,.55); pointer-events:none; }
</style>
</head>
<body>
<div id="app"></div>
<div id="vignette"></div>
<div id="whiteout"></div>
<div id="panel">
<h1>.........完整代码请登录后点击上方下载按钮下载查看















网友评论0