pug+scss实现三维迷宫俯视效果代码
代码语言:html
所属分类:布局界面
代码描述:pug+scss实现三维迷宫俯视效果代码
下面为部分代码预览,完整代码请点击下载或在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" />
<title>BFW NEW PAGE</title>
<style type = 'text/scss'>
// Custom param *** START
* {
transform-style: preserve-3d;
box-sizing: border-box;
}
body {
margin: 0;
padding-top: 400px;
width: 100vw;
height: 100vh;
overflow: hidden;
perspective: 250vmin;
background: radial-gradient(circle at 50% 0%, #333, #000);
background-color: #111;
}
.cam {
float: left;
width: 11.11%;
height: 11.11%;
z-index: 333;
position: relative;
@for $i from 1 through 9 {
@for $j from 1 through 9 {
$key: ($i - 1) * 9 + $j;
&:nth-child(#{$key}) {
&:hover ~ .content {
transform: rotateX(($i - 8) * -8deg + 8) rotateZ(($j - 8) * 10deg + 30);
}
}
}
}
&:hover ~ .content {
transition: all 0.5s ease 0s;
}
}
.content {
width: 98vmin;
height: 64vmin;
display: flex;
align-items: center;
justify-content: center;
position: absolute;
background: repeating-conic-gradient(
#0004 0.00001%,
transparent 0.00005%,
transparent 0.0005%,
transparent 0.00005%
),
repeating-conic-gradient(
#fff2 0.00002%,
transparent 0.00008%,
transparent 0.0008%,
transparent 0.00008%
),
#626262;
top: calc(50% - 32vmin);
left: calc(50% - 49vmin);
transform: rotateX(40deg);
}
.cuboid {
--height: 1.5;
--width: 93;
--depth: 10;
--hue: 100;
--sat: 60%;
--lum: 60%;
height: calc(var(--height) * 1vmin);
width: calc(var(--width) * 1vmin);
position: absolute;
transform: translate3d(0vmin, 29.3vmin, 0vmin);
box-shadow: 0 0 0.01vmin 0.5vmin #284705;
}
.cuboid .side {
position: absolute;
top: 50%;
left: 50%;
height: 100%;
width: 100%;
border-radius: 2px;
background: repeating-conic-gradient(
#0003 0%,
#fff0 0.0003%,
#fff0 0.0006%,
#fff0 0.0009%
),
repeating-conic-gradient(#fff2 0%, #fff0 0.0005%, #fff0 0.0015%, #fff0 0.019%),
hsl(var(--hue), var(--sat), var(--lum));
}
.cuboid .side:nth-of-type(1) {
transform: translate3d(-50%, -50%, calc(var(--depth) * 0.5vmin));
}
.cuboid .side:nth-of-type(2) {
transform: translate3d(-50%, -50%, calc(var(--depth) * -0.5vmin))
rotateY(180deg);
--lum: 25%;
opacity: 0;
}
.cuboid .side:nth-of-type(3) {
width: calc(var(--depth) * 1vmin);
transform: translate(-50%, -50%) rotateY(90deg)
translate3d(0, 0, calc(var(--width) * 0.5vmin));
--lum: 30%;
}
.cuboid .side:nth-of-type(4) {
width: calc(var(--depth) * 1vmin);
transform: translate(-50%, -50%) rotateY(-90deg)
translate3d(0, 0, calc(var(--width) * 0.5vmin));
--lum: 40%;
}
.cuboid .side:nth-of-type(5) {
height: calc(var(--depth) * 1vmin);
transform: translate(-50%, -50%) rotateX(90deg)
translate3d(0, 0, calc(var(--height) * 0.5vmin));
--lum: 35%;
}
.cuboid .side:nth-of-type(6) {
height: calc(var(--depth) * 1vmin);
transform: translate(-50%, -50%) rotateX(-90deg)
translate3d(0, 0, cal.........完整代码请登录后点击上方下载按钮下载查看
















网友评论0