svg+css实现视频全屏放大镜透镜背景效果代码
代码语言:html
所属分类:背景
代码描述:svg+css实现视频全屏放大镜透镜背景效果代码
下面为部分代码预览,完整代码请点击下载或在bfwstudio webide中打开
<!DOCTYPE html> <html lang="en" > <head> <meta charset="UTF-8"> <link type="text/css" rel="stylesheet" href="//repo.bfw.wiki/bfwrepo/css/reset.min.css"> <link rel='stylesheet' href='https://fonts.googleapis.com/css2?family=Urbanist:wght@800&display=swap'> <style> :root { --colorText: #192a56; --colorContrast: #f5f6fa; --colorAccent: #487eb0; } html { height: 100%; } body { background: var(--colorContrast); color: var(--colorText); height: 100%; font: 800 100%/1.3 "Urbanist", serif; } * { margin: 0; } *, *::before, *::after { box-sizing: border-box; } * * > * + * { margin-top: 1.25em; } .hero { min-height: 100vh; position: relative; display: grid; align-content: center; justify-items: stretch; padding: 4%; } .hero::after, .hero::before { content: ""; display: block; position: absolute; top: 0; left: 0; width: 100%; height: 100%; z-index: -1; } .hero::after { background: var(--colorContrast); opacity: 0.2; mix-blend-mode: lighten; } .hero::before { background: var(--colorText); opacity: 0.5; mix-blend-mode: color; } .hero__mask { opacity: 0; position: absolute; } .hero__content { max-width: 75ch; margin: 0 auto; text-align: center; } .hero__title { margin-top: 30px; font-size: clamp(3rem, 10vw, 6rem); line-height: 0.9; opacity: 0; transform: translateY(var(--translateAmount)); transition: opacity var(--ease) var(--durationM) var(--durationM), transform var(--ease) var(--durationM) var(--durationM); text-shadow: 0 0.1em 1em var(--colorContrast); } .hero--animated .hero__title { opacity: 1; transform: translateY(0); } .hero__title span { display: block; } .hero__arrow { display: inline-block; font-size: 2rem; color: inherit; position: relative; z-index: 1; bottom: -35px; -webkit-animation: float 1s ease-in-out infinite alternate both; animation: float 1s ease-in-out infinite alternate both; } .hero__figure { position: absolute; top: 0; left: 0; height: 100%; width: 100%; margin: 0; z-index: -2; transition: transform var(--ease) var(--durationL); overflow: hidden; } .hero__figure video { -o-object-fit: cover; object-fit: cover; width: 100%; min-height: 100%; height: auto; transition: transform var(--ease) var(--durationL), opacity var(--ease) var(--durationS); } .hero__figure--bg { transform: scale(1); } .hero__figure--bg::after { content: ""; display: block; background: white; position: absolute; inset: 0; opacity: 0.15; mix-blend-m.........完整代码请登录后点击上方下载按钮下载查看
网友评论0