js+css模拟自然界生态系统代码
代码语言:html
所属分类:其他
代码描述:模拟自然界生态系统网页
下面为部分代码预览,完整代码请点击下载或在bfwstudio webide中打开
<!DOCTYPE html>
<html lang="zh-CN">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0, user-scalable=no">
<title>生态系统模拟器:进化·捕食·遗传变异</title>
<style>
* {
box-sizing: border-box;
user-select: none;
}
body {
background: linear-gradient(145deg, #1a472a 0%, #0e2a1a 100%);
font-family: 'Segoe UI', 'Roboto', 'Courier New', monospace;
display: flex;
justify-content: center;
align-items: center;
min-height: 100vh;
margin: 0;
padding: 20px;
}
.sim-container {
background: rgba(30, 20, 15, 0.65);
backdrop-filter: blur(4px);
border-radius: 2rem;
padding: 1.2rem;
box-shadow: 0 20px 35px rgba(0,0,0,0.5), inset 0 1px 0 rgba(255,255,255,0.1);
border: 1px solid #6b8c5c;
}
canvas {
display: block;
margin: 0 auto;
border-radius: 1.2rem;
box-shadow: 0 10px 25px rgba(0,0,0,0.3);
cursor: crosshair;
background-color: #2d5e2c;
}
.panel {
margin-top: 1rem;
display: flex;
flex-wrap: wrap;
gap: 0.8rem;
justify-content: space-between;
align-items: center;
background: #1f2f1cbb;
backdrop-filter: blur(8px);
padding: 0.8rem 1.2rem;
border-radius: 2rem;
border: 1px solid #9bc48b;
}
.stats {
background: #0f1f0cee;
padding: 0.5rem 1rem;
border-radius: 2rem;
color: #eefde3;
font-weight: bold;
font-size: 0.85rem;
display: flex;
gap: 1.2rem;
flex-wrap: wrap;
font-family: monospace;
}
.stats span {
color: #f9e45b;
font-size: 1.1rem;
}
.controls {
display: flex;
flex-wrap: wrap;
gap: 0.8rem;
align-items: center;
}
.ctrl-group {
background: #2d4028;
padding: 0.3rem 0.8rem;
border-radius: 2rem;
display: inline-flex;
align-items: center;
gap: 0.6rem;
color: #f9f1cf;
font-size: 0.75rem;
font-weight: bold;
}
.ctrl-group label {
cursor: pointer;
}
input[type="range"] {
width: 130px;
height: 3px;
-webkit-appearance: none;
background: #d4e2c3;
border-radius: 5px;
outline: none;
}
input[type="range"]:focus {
outline: none;
}
input[type="range"]::-webkit-slider-thumb {
-webkit-appearance: none;
width: 12px;
height: 12px;
bac.........完整代码请登录后点击上方下载按钮下载查看















网友评论0