css布局实现404页面走光动画效果代码
代码语言:html
所属分类:布局界面
代码描述:css布局实现404页面走光动画效果代码
下面为部分代码预览,完整代码请点击下载或在bfwstudio webide中打开
<!DOCTYPE html> <html lang="en" > <head> <meta charset="UTF-8"> <style> @import url("https://fonts.googleapis.com/css2?family=Open+Sans:wght@800&family=Roboto:wght@100;300&display=swap"); :root { --button: #b3b3b3; --button-color: #0a0a0a; --shadow: #000; --bg: #737373; --header: #7a7a7a; --color: #fafafa; --lit-header: #e6e6e6; --speed: 2s; } * { box-sizing: border-box; transform-style: preserve-3d; } @property --swing-x { initial-value: 0; inherits: false; syntax: '<integer>'; } @property --swing-y { initial-value: 0; inherits: false; syntax: '<integer>'; } body { min-height: 100vh; display: flex; font-family: 'Roboto', sans-serif; flex-direction: column; align-items: center; justify-content: center; background: var(--bg); color: var(--color); perspective: 1200px; } a { text-transform: uppercase; text-decoration: none; background: var(--button); color: var(--button-color); padding: 1rem 4rem; border-radius: 4rem; font-size: 0.875rem; letter-spacing: 0.05rem; } p { font-weight: 100; } h1 { -webkit-animation: swing var(--speed) infinite alternate ease-in-out; animation: swing var(--speed) infinite alternate ease-in-out; font-size: clamp(5rem, 40vmin, 20rem); font-family: 'Open Sans', sans-serif; margin: 0; margin-bottom: 1rem; letter-spacing: 1rem; transform: translate3d(0, 0, 0vmin); --x: calc(50% + (var(--swing-x) * 0.5) * 1%); background: radial-gradient(var(--lit-header), var(--header) 45%) var(--x) 100%/200% 200%; -webkit-background-clip: text; color: transparent; } h1:after { -webkit-animation: swing var(--speed) infinite alternate ease-in-out; animation: swing var(--speed) infinite alternate.........完整代码请登录后点击上方下载按钮下载查看
网友评论0