CSS
语言:
CSSSCSS
确定
html,
body {
margin: 0;
padding: 0;
background: #000;
width: 100%;
height: 100%;
position: relative;
}
.digit {
position: absolute;
top: 50%;
left: 50%;
width: 200px;
height: 300px;
margin-top: -150px;
margin-left: -100px;
background: #000;
}
.digit .segment {
background: #c00;
border-radius: 5px;
position: absolute;
opacity: 0.3;
-webkit-transition: opacity 0.2s;
}
.digit .segment.on {
opacity: 1;
box-shadow: 0 0 100px #f00;
-webkit-transition: opacity 0s;
}
.digit .segment:nth-child(1) {
top: 10px;
left: 20px;
right: 20px;
height: 10px;
}
.digit .segment:nth-child(2) {
top: 20px;
right: 10px;
width: 10px;
height: calc(50% - 25px);
}
.digit .segment:nth-child(3) {
bottom: 20px;
right: 10px;
width: 10px;
height: calc(50% - 25px);
}
.digit .segment:nth-child(4) {
bottom: 10px;
right: 20px;
height: 10px;
left: 20px;
}
.digit .segment:nth-child(5) {
bottom: 20px;
left: 10px;
width: 10px;
height: calc(50% - 25px);
}
.digit .segment:nth-child(6) {
top: 20px;
left: 10px;
width: 10px;
height: calc(50% - 25px);
}
.digit .segment:nth-child(7) {
bottom: calc(50% - 5px);
right: 20px;
left: 20px;
height: 10px;
}