open-props实现页面滚动卡片淡入效果代码
代码语言:html
所属分类:加载滚动
代码描述:open-props实现页面滚动卡片淡入效果代码
代码标签: open-props 页面 滚动 卡片 淡入
下面为部分代码预览,完整代码请点击下载或在bfwstudio webide中打开
<!DOCTYPE html> <html lang="en" > <head> <meta charset="UTF-8"> <meta name="viewport" content="width=device-width, initial-scale=1"> <style> @import "//repo.bfw.wiki/bfwrepo/css/open-props.css" layer(design.system); @import "//repo.bfw.wiki/bfwrepo/css/open-props.normalize.light.min.css" layer(demo.support); @keyframes slide-fade-in { from { opacity: 0; box-shadow: none; transform: scale(.8) translateY(15vh); } } @layer demo { .card { @media (prefers-reduced-motion: no-preference) { view-timeline-name: --item-timeline; animation: slide-fade-in both; animation-timeline: --item-timeline; animation-range: contain 0% contain 50%; } } } @layer demo.support { * { box-sizing: border-box; margin: 0; } html { block-size: 100%; background: var(--surface-3); } body { min-block-size: 100%; font-family: system-ui, sans-serif; display: grid; place-content: center; padding-block: 30dvh; } .cards { display: grid; gap: var(--size-3); grid-auto-flow: dense; grid-template-columns: repeat(3, var(--size-content-1)); & > .card { background: linear-gradient(#fff, #fff), var(--gradient-10); background-origin: border-box; background-clip: content-box, border-box; border-radius: var(--radius-3); box-shadow: var(--shadow-3); line-height: 3; padding-top: var(--size-1); font-size: var(--font-size-4); font-weight: var(--font-weight-6); font-family: var(--font-mono); display: grid; place-content: center; &:nth-of-type(4n) { grid-row: span 2; background-image: linear-gradient(#fff, #fff), var(--gradient-3); } &:nth-of-type(7n) { grid-row: span 3; background-image: linear-gradient(#fff, #fff), var(--gradient-5); } &:nth-of-type(5n) { grid-column: span 2; background-image: linear-gradient(#fff, #fff), var(--gradient-18); } } } } </style> </head> <body translate="no"> <div class="cards"> <div class="card"><html></div> <div class="card"><base></div> <div class="card"><head></div> <div class="card"><link></div> <div class="card"><meta></div> <div class="card"><script></div> <div class="card"><style></div> <div class="card"><title></div> <div class="card"><body></div> <div class="card"><address></div> <div class="card"><article></div> <div class="card"><aside></div> <div class="card"><footer></div> <div class="card"><header></div> <div class="card"><h1></div> <div class="card"><h2></div> <div class="card"><h3></div> <div class="card"><h4></div> <div class="card"><h5></div> <div class="card"><h6></div> <div class="card"><hgroup></div> <div class="card"><main></div> <div class="card"><nav></div> <div class="card"><section></div> <div class="card"><blockquote></div> <div class="card"><cite></div> <div class="card"><dd></div> <div class="card"><dt></div> <div class="card"><dl></div> <div class="card"><div></div> <div class="card"><figcaption></div> <div class="card"><figure></div> <div class="card"><hr></div> <div class="card"><li></div> <div class="card"><ol></div> <div class="card"><ul></div> <div class="card"><menu></div> <div class="card"><p></div> <div class="card"><pre></div> <div class="card"><a></div> <div class="card"><abbr></div> <div class="card"><b></div> <div class="card"><bdi></div> <div class="card"><bdo></div> <div class="card"><br></div> <div class="card"><code></div> <div class="card"><data></div> <div class="card"><dfn></div> <div class="card"><em></div> <div class="card"><i></div> <div class="card"><kbd></div> <div class="card"><mark></div> <div class="card"><q></div> <div.........完整代码请登录后点击上方下载按钮下载查看
网友评论0