div+css点亮盒子灯光开关效果代码
代码语言:html
所属分类:布局界面
代码描述:div+css点亮盒子灯光开关效果代码
下面为部分代码预览,完整代码请点击下载或在bfwstudio webide中打开
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width,initial-scale=1.0,maximum=1.0,minimum=1.0,user-scalable=0" />
<style>
body{
background: black;
margin: 200px;
}
.container input {
position: absolute;
opacity: 0;
cursor: pointer;
height: 0;
width: 0;
}
.container {
display: flex;
flex-direction: column;
align-items: center;
position: relative;
cursor: pointer;
user-select: none;
}
.simple-text {
position: absolute;
bottom: -40px;
width: 120px;
text-align: center;
color: white;
font-size: 16pt;
font-weight: 800;
font-family: monospace;
}
.torch {
display: flex;
justify-content: center;
height: 150px;
}
.head,
.stick {
position: absolute;
width: 30px;
transform-style: preserve-3d;
transform: rotateX(-30deg) rotateY(45deg);
}
.stick {
position: relative;
height: 120px;
}
.face {
position: absolute;
transform-style: preserve-3d;
width: 30px;
height: 30px;
display: grid;
grid-template-columns: 50% 50%;
grid-template-rows: 50% 50%;
background-color: #000000;
}
.top {
transform: rotateX(90deg) translateZ(15px);
}
.left {
transform: rotateY(-90deg) translateZ(15px);
}
.right {
transform: rotateY(0deg) translateZ(15px);
}
.top div,
.left div,
.right div {
width: 102%;
height: 102%;
}
.top div:nth-child(1),
.left div:nth-child(3),
.right div:nth-child(3) {
background-color: #ffff9760;
}
.top div:nth-child(2),
.left div:nth-child(1),
.right div:nth-child(1) {
background-color: #ffd80060;
}
.top div:nth-child(3),
.left div:nth-child(4),
.right div:nth-child(4) {
background-color: #ffffff60;
}
.top div:nth-child(4),
.left div:nth-child(2),
.right div:nth-child(2) {
background-color: #ff8f0060;
}
.side {
position: absolute;
width: 30px;
height: 120px;
display: grid;
grid-template-columns: 50% 50%;
grid-template-rows: repeat(8, 12.5%);
cursor: pointer;
translate: 0 12px;
}
.side-left {
transform: rotateY(-90deg) translateZ(15px) translateY(8px);
}
.side-right {
transform: rotateY(0deg) translateZ(15px) translateY(8px);
}
.side-left div,
.side-right div {
width: 103%;
height: 103%;
}
.side div:nth-child(1) {
background-color: #443622;
}
.side div:nth-child(2),
.side div:nth-child(2) {
background-color: #2e2517;
}
.side div:nth-child(3),
.side div:nth-child(5) {
background-color: #4b3b23;
}
.side div:nth-child(4),
.side div:nth-child(10) {
background-color: #251e12;
}
.side div:nth-child(6) {
b.........完整代码请登录后点击上方下载按钮下载查看
网友评论0