css实现可打开的抽屉里面隐藏立体水晶动画代码
代码语言:html
所属分类:动画
代码描述:css实现可打开的抽屉里面隐藏立体水晶动画代码
代码标签: css 打开 抽屉 里面 隐藏 立体 水晶 动画 代码
下面为部分代码预览,完整代码请点击下载或在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: #cecece;
}
.box {
width: 20em; height: 12em;
background: #0f0f0f;
overflow: hidden;
border-radius: 1em;
cursor: not-allowed;
position: relative;
margin: 1em;
border: 0;
box-shadow:
0.1em 0.1em 0.2em 0 #fff3,
-0.1em -0.1em 0.2em 0 #0003;
}
.box .inset {
background: #cecece;
border-radius: 0.9em;
width: 100%; height: 100%;
position: relative;
box-shadow:
inset 0em 0em 0em 0em #0006,
inset 0.1em 0.1em 0.2em 0 #fff3,
inset -0.1em -0.1em 0.2em 0 #0003;
}
.box .inset::before {
content: ''; display: block;
width: 0.8em; height: 7em;
box-shadow:
inset -0.1em -0.1em 0.1em 0.1em #fff3,
inset 0.1em 0.1em 0.1em 0.1em #0003;
border-radius: 10px;
position: absolute;
top: 0; bottom: 0; margin: auto;
left: 1em;
}
.box.moving {
pointer-events: none;
}
.box.pushed .inset {
animation: pushed 2s ease-in-out forwards;
}
.box.reverse .inset {
animation: pushed 0.6s ease-in-out reverse forwards;
}
@keyframes pushed {
.........完整代码请登录后点击上方下载按钮下载查看
















网友评论0