js+div实现照片相册堆叠文字描述效果代码
代码语言:html
所属分类:动画
代码描述:js+div实现照片相册堆叠文字描述效果代码
下面为部分代码预览,完整代码请点击下载或在bfwstudio webide中打开
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<style>
:root {
--bgc: #202124;
--fgc: #fff;
--time: 3s;
--ease: cubic-bezier(.3, .7, 0, 1);
--ease2: cubic-bezier(.3, .7, .2, 2);
font-family: Inter, sans-serif;
background: var(--bgc);
color: var(--fgc);
overflow: hidden;
font-size: 2.3vmin;
}
.container {
position: relative;
height: 100vh;
}
.color, .d {
text-decoration: none;
width: 30vmin;
--bg: var(--fgc);
background: var(--bg);
color: var(--bgc);
display: flex;
flex-direction: column;
padding: 2vmin;
position: absolute;
top: 50%;
left: 50%;
transform: translateY(-50%) translateX(-50%);
-webkit-animation: var(--time) goDown var(--ease);
animation: var(--time) goDown var(--ease);
-webkit-animation-fill-mode: forwards;
animation-fill-mode: forwards;
animation-count: 1;
opacity: 1;
transition: 300ms opacity;
}
.color.remove, .d.remove {
opacity: 0;
}
.color::after, .d::after {
content: "";
position: absolute;
z-index: -1;
inset: 0;
background: var(--bg);
}
.color::before, .d::before {
content: "";
position: absolute;
z-index: -2;
inset: -2vmin;
background: var(--color);
-webkit-animation.........完整代码请登录后点击上方下载按钮下载查看
















网友评论0