css实现向下滚动网页文字填充式动画效果代码
代码语言:html
所属分类:加载滚动
代码描述:css实现向下滚动网页文字填充式动画效果代码,仅支持chorme浏览器。
下面为部分代码预览,完整代码请点击下载或在bfwstudio webide中打开
<!DOCTYPE html> <html lang="en" > <head> <meta charset="UTF-8"> <style> :root { --bg: hsl(0 0% 2%); --color: hsl(0 0% 100% / 0.1); --underline-width: 1lh; --underline-block-width: 200vmax; --underline-color: hsl(0 0% 50% / 0.05); --underline-transition: 5s; --finish-fill: hsl(0 0% 100%); --accent: hsl(0 0% 100%); --fill: hsl(0 0% 50%); } body { align-items: center; background-color: var(--bg); color: var(--color); display: flex; font-family: sans-serif; font-weight: bold; justify-content: center; min-height: 200vh; accent-color: red; } :root:has(#driver:checked) section { outline: 1rem dashed hsl(0 80% 50% / 0.5); background: hsl(0 80% 50% / 0.1); } .controls { position: fixed; top: 1rem; right: 1rem; padding: 1rem 2rem; border-radius: 100px; z-index: 2; display: flex; align-items: center; gap: 0.5rem; background: hsl(0 0% 90%); color: hsl(0 0% 10%); } p { width: 50vw; resize: both; max-width: 100vw; overflow: hidden; position: fixed; padding:10vmin; top: 50%; left: 50%; translate: -50% -50%; -webkit-animation: fill-up both linear; animation: fill-up both linear; animation-timeline: --section; animation-range: cover; margin: 0; } @property --progress { initial-value: 0; syntax: '<number>'; inherits: true; } p > span { outline-color: hsl(10 80% 50%); outline-offset: 1ch; font-size: clamp(3rem, 4vw + 1rem, 10rem); color: var(--color); text-decoration: none; background-image: /* First one is the highlight */ linear-gradient(90d.........完整代码请登录后点击上方下载按钮下载查看
网友评论0