css+js实现楼梯下落打开向下通道视觉差异交互效果代码

代码语言:html

所属分类:视觉差异

代码描述:css+js实现楼梯下落打开向下通道视觉差异交互效果代码

代码标签: css js 楼梯 下落 打开 向下 通道 视觉 差异 交互

下面为部分代码预览,完整代码请点击下载或在bfwstudio webide中打开

<!DOCTYPE html>
<html lang="en" >
<head>
  <meta charset="UTF-8">
<style>
    *{ box-sizing: border-box; -webkit-font-smoothing: antialiased; text-rendering: optimizeLegibility; scroll-behavior: smooth;}
html, body { height: 100%; overflow: hidden;}

body {
    display: flex;
    flex-direction: row;
    flex-wrap: wrap;
    justify-content: center;
    align-items: center;
    margin: 0;
    background: #e1e1e1;
    font-family: monospace;
    transform-style: preserve-3d;
    perspective: 400px;
}


.descend {
    height: min(min(64vh,64vw), 400px); width: min(min(32vh,32vw), 200px);
    transform: rotateX(58deg) rotateY(0deg) rotateZ(40deg);
    user-select: none;
    display: flex;
    flex-direction: column;
    transform-style: preserve-3d;
    box-shadow: 
    0 0 0 max(200vh, 200vh) #e1e1e1;
    transition: transform 1s ease-out;
    cursor: pointer;
    border-radius: 8px;
    white-space: nowrap;

    --d1: #000;
    --d2: #222;
    --d3: #444;
}
.descend > span{
    content: ''; display: block;
    width: 400%; height: 400%;
    position: absolute;
    pointer-events: none;
}
.descend > span:nth-of-type(1) {
    transform-origin: 0% 50%;
    transform: rotateY(90deg);
    background: linear-gradient(90deg, var(--d3), var(--d1) 50%);
}
.descend > span:nth-of-type(2) {
    right: -2px;
    transform-origin: 100% 50%;
    transform: rotateY(-90deg);
    background: linear-gradient(-90deg, var(--d3), var(--d1) 50%);
}
.descend > span:nth-of-type(3) {
    background: var(--d2);
    left: -4px;
    transform-origin: 50% 0%;
    transform: rotateX(-90deg);
}
.descend > div {
    height: 100%; width: 100%;
    --bg:  #e1e1e1;
    background:  var(--bg);
    box-shadow: 0 0 0 1px var(--bg);
    z-index: 2;
    --delay: 0.2s;
    --depth: 1.4em;
    
    font-size: min(min(3vw, 3vh), 1.2em);
    font-weight: 1000;
    position: relative;
    display: flex; justify-content: center; align-items: center;
    transform: translate3d(0 ,0 , 0px);
    transition:.........完整代码请登录后点击上方下载按钮下载查看

网友评论0