网格线条背景动画效果
代码语言:html
所属分类:背景
代码描述:网格线条背景动画效果
下面为部分代码预览,完整代码请点击下载或在bfwstudio webide中打开
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<style>
body {
margin: 0;
background-color: #222;
color: #fff;
font-family: monospace;
user-select: none;
}
canvas {
display: block;
width: 100vw;
height: 100vh;
}
.config {
position: absolute;
top: 0;
left: 0;
width: 360px;
padding: 10px;
background: rgba(0, 0, 0, 0.7);
border-radius: 10px;
}
.config.collapsed .row {
display: none;
}
.config.collapsed .buttons {
margin-top: 0;
}
.config.collapsed #openText {
display: block;
}
.config.collapsed #closeText {
display: none;
}
.config:not(.collapsed) #openText {
display: none;
}
.config:not(.collapsed) #closeText {
display: block;
}
.row {
display: flex;
align-items: center;
padding: 2px 0;
}
label {
display: block;
width: 120px;
}
input[type='range'] {
display: block;
flex-grow: 1;
}
output {
display: block;
text-align: right;
width: 50px;
}
.buttons {
display: flex;
justify-content: center;
margin-top: 10px;
}
button {
border: 1px solid white;
border-radius: 5px;
background: transparent;
color: white;
outline: 0;
}
button:hover {
background: white;
color: black;
}
button:active {
background: darkgray;
}
</style>
</head>
<body translate="no">
<canvas id="canvas"></canvas>
<div class="config">
<div class="row">
<label for="cellWidth">Cell Width:</label>
<input type="range" id="cellWidth" min="10" max="100" step="1" value="24" />
<output id="cellWidthOutput">24</output>
</div>
<div class="row">
<label for="cellHeight">Cell Height:</label>
<input type="range" id="cellHeight" min="10" max="100" step="1" value="24" />
<output id="cellHeightOutput">24</output>
</div>
<div class="row">
<label for="lineWidth">Line Width:</label>
<input type="range" id="lineWidth" min="1".........完整代码请登录后点击上方下载按钮下载查看
















网友评论0