there做个三维修建桥梁游戏代码
代码语言:html
所属分类:其他
代码由glm-5.3-flash ai生成,可能有错误,仅供参考:点击查看提示词
代码描述:三维修建桥梁游戏
下面为部分代码预览,完整代码请点击下载或在bfwstudio webide中打开
<!DOCTYPE html>
<html lang="zh-CN">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>跨江大桥建设</title>
<style>
* { margin: 0; padding: 0; box-sizing: border-box; font-family: 'Segoe UI', Tahoma, sans-serif; }
body { overflow: hidden; background: #f0f8ff; }
#app { position: relative; width: 100vw; height: 100vh; }
canvas { display: block; }
#toolbar {
position: absolute; top: 16px; left: 16px; z-index: 10;
background: rgba(255,255,255,.93); padding: 14px; width: 236px;
border-radius: 12px; box-shadow: 0 6px 24px rgba(0,0,0,.13);
}
#toolbar h2 { font-size: 1.05rem; color: #2c3e50; margin-bottom: 10px; }
.tool {
display: flex; justify-content: space-between; align-items: center; width: 100%;
padding: 9px 12px; margin-bottom: 7px; border: none; border-radius: 8px; cursor: pointer;
font-size: .92rem; font-weight: 600; color: #fff;
background: linear-gradient(135deg, #6a11cb, #2575fc); transition: .15s;
}
.tool:hover { transform: translateY(-1px); filter: brightness(1.1); }
.tool.active { background: linear-gradient(135deg, #e53935, #e35d5b); }
.tool .key { background: rgba(255,255,255,.25); border-radius: 4px; padding: 1px 7px; font-size: .75rem; }
#toolbar hr { border: none; border-top: 1px solid #e3e6ea; margin: 10px 0; }
.action {
width: 100%; padding: 9px 12px; margin-bottom: 7px; border: none; border-radius: 8px;
cursor: pointer; font-weight: 600; font-size: .9rem; background: #eef1f5; color: #2c3e50; transition: .15s;
}
.action:hover { background: #e2e7ee; }
.action:disabled { opacity: .45; cursor: not-allowed; }
.action.danger { background: #fdecea; color: #c0392b; }
.action.danger.active { background: #e74c3c; color: #fff; }
.action.cabled { background: #e8f8f0; color: #1e8e5a; }
.tips { font-size: .72rem; color: #95a5a6; margin-top: 6px; line-height: 1.6; }
#status {
position: absolute; top: 16px; right: 16px; z-index: 10; min-width: 236px;
background: rgba(255,255,255,.93); padding: 14px 16px; border-radius: 12px;
box-shadow: 0 6px 24px rgba(0,0,0,.13);
}
.score-line { display: flex; justify-content: space-between; align-items: baseline; border-bottom: 1px solid #e3e6ea; padding-bottom: 8px; margin-bottom: 8px; }
.score-line span:first-child { font-size: .85rem; color: #7f8c8d; }
#score { font-size: 1.6rem; font-weight: 800; color: #2c3e50; }
.task { display: flex; align-items: center; gap: 8px; padding: 6px 8px; border-radius: 7px; font-size: .88rem; color: #95a5a6; margin-bottom: 2px; }
.task .tprog { margin-left: auto; font-size: .78rem; font-weight: 700; }
.task.current { background: #fff7e0; color: #b07d0a; font-weight: 700; box-shadow: inset 0 0 0 1.5px #f5c542; }
.task.done { color: #27ae60; }
#guide {
position: absolute; bottom: 18px; left: 50%; transform: translateX(-50%); z-index: 10;
background: rgba(20,30,45,.84); color: #fff; padding: 11px 22px; border-radius: 12px;
max-width: min(900px, 92vw); font-size: .88rem; line-height: 1.55; backdrop-filter: blur(4px);
}
#guide .g-step { display: block; font-weight: 800; color: #ffd54f; margin-bottom: 2px; font-size: .92rem; }
#guide b { color: #ffd54f; }
#message {
position: absolute; top: 16%; left: 50%; transform: translate(-50%,-50%) scale(.9); z-index: 30;
background: rgba(46,204,113,.95); color: #fff; padding: 12px 26px; border-radius: 10px;
font-size: 1.02rem; font-weight: 600; opacity: 0; pointer-events: none;
transition: opacity .25s, transform .25s; box-shadow: 0 8px 30px rgba(0,0,0,.25); white-space: nowrap;
}
#message.show { opacity: 1; transform: translate(-50%,-50%) scale(1); }
#message.error { background: rgba(231,76,60,.95); }
#message.info { background: rgba(52,152,219,.95); }
#victory { position: absolute; inset: 0; background: rgba(15,25,40,.55); display: none; align-items: center; justify-content: center; z-index: 50; backdrop-filter: blur(3px); }
#victory.show { display: flex; }
.v-card { background: #fff; border-radius: 18px; padding: 38px 52px; text-align: center; box-shadow: 0 20px 80px rgba(0,0,0,.4); animation: pop .5s cubic-bezier(.2,1.6,.4,1); }
@keyframes pop { from { transform: scale(.6); opacity: 0; } to { transform: scale(1); opacity: 1; } }
.v-emoji { font-size: 3.4rem; }
.v-card h1 { color: #2c3e50; margin: 8px 0 6px; }
.v-card p { color: #7f8c8d; font-size: .95rem; }
.v-score b { color: #e67e22; font-size: 1.5rem; }
#btn-close { margin-top: 18px; padding: 11px 30px; border: none; border-radius: 9px; background: linear-gradient(135deg,#6a11cb,#2575fc); color: #fff; font-weight: 700; cursor: pointer; }
</style>
</head>
<body>
<div id="app">
<div id="toolbar">
<h2>🌉 跨江大桥建设</h2>
<button class="tool" data-tool="tower"><span>🗼 主塔</span><span class="key">1</span></button>
<button class="tool" data-tool="pillar"><span>🧱 引桥墩</span><span class="key">2</span></button>
<button class="tool" data-tool="deck"><span>➖ 桥面</span><span class="key">3</span></button>
<button class="tool" data-tool="light"><span>💡 路灯</span><span class="key">4</span></button>
<hr>
<button class="action".........完整代码请登录后点击上方下载按钮下载查看















网友评论0