css实现自适应图片相册滚动闪现入场动画效果代码
代码语言:html
所属分类:画廊相册
代码描述:css实现自适应图片相册滚动闪现入场动画效果代码,往下滚动鼠标试试。
代码标签: css 自适应 图片 相册 滚动 闪现 入场 动画
下面为部分代码预览,完整代码请点击下载或在bfwstudio webide中打开
<!DOCTYPE html>
<html lang="en" >
<head>
<meta charset="UTF-8">
<style>
@import url("https://fonts.googleapis.com/css2?family=Gochi+Hand&family=Handlee&display=swap");
@property --i0 {
syntax: "<number>";
initial-value: 0;
inherits: true;
}
@property --o0 {
syntax: "<number>";
initial-value: 0;
inherits: true;
}
@property --i1 {
syntax: "<number>";
initial-value: 0;
inherits: false;
}
@property --o1 {
syntax: "<number>";
initial-value: 0;
inherits: false;
}
* {
margin: 0;
}
html, body, header, main, figure, footer {
display: grid;
}
body {
background: #212121;
color: #ededed;
font: 1.25em handlee, cursive;
font-size: clamp(.75em, 1vw + 1vh, 1.25em);
}
header, main, footer {
grid-gap: 0.5em;
padding: 0.5em;
min-height: 100vh;
}
header, footer {
grid-template-columns: min(100%, 62em);
place-content: center;
text-align: center;
text-wrap: balance;
}
h1 {
font: 3em gochi hand, cursive;
}
main {
grid-template-columns: repeat(auto-fill, minmax(min(20em, 100%), 1fr));
/* limit width, avoid horizontal scrollbar??? */
width: min(96em, 100% - 2 * 0.5em);
}
figure {
/* avoid image making grid overflow figure */
grid-template: 100%/100%;
aspect-ratio: 3/2;
animation: a 1s both;
animation-name: i, o;
animation-timeline: view();
animation-range: entry 0% entry 0%, exit 100% exit 100%;
}
figure:hover {
--hov: 1 ;
}
@keyframes i {
to {
--i.........完整代码请登录后点击上方下载按钮下载查看
















网友评论0