div+css实现聚光灯照射悬空三维文字投影动画效果代码
代码语言:html
所属分类:三维
代码描述:div+css实现聚光灯照射悬空三维文字投影动画效果代码
下面为部分代码预览,完整代码请点击下载或在bfwstudio webide中打开
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<link href="https://fonts.googleapis.com/css2?family=Nunito+Sans:ital,wght@0,300;0,400;0,600;0,700;1,400&display=swap" rel="stylesheet">
<style>
*, *::before, *::after {
font-family: inherit;
box-sizing: inherit;
margin: 0;
padding: 0;
}
html {
box-sizing: border-box;
font-family: 'Nunito Sans', sans-serif;
font-size: 62.5%;
}
html body {
font-size: 1.6rem;
margin: 0;
}
ul {
list-style: none;
}
a, a:link, a:visited {
text-decoration: none;
}
</style>
<style>
@import url("https://fonts.googleapis.com/css2?family=Lobster&display=swap");
body {
height: 100vh;
background-color: #333;
font-family: Lobster, "Trebuchet MS", "Lucida Sans Unicode", "Lucida Grande", "Lucida Sans", Arial, sans-serif;
}
main {
--text: "Spotlight";
--hue1: 30deg;
--hue2: 350deg;
--spin: 20deg;
--light-color: #ffeab1;
--stripe: .25em;
--stripe-angle: -33deg;
--perspective: 80vmin;
width: 100%;
height: 100%;
overflow: hidden;
display: flex;
align-items: center;
justify-content: center;
position: relative;
background-image: linear-gradient(to bottom, #383838, #3c3c3c 50%, #2f2f2f 60%, #0b0e13);
font-size: 17.5vmin;
}
main .light {
display: block;
position: absolute;
top: 0;
left: 50%;
width: 90%;
height: 60%;
min-height: 6em;
transform: translateX(-50%) translateY(-1em);
z-index: 1;
mix-blend-mode: screen;
filter: blur(0.15em);
opacity: 0.6;
}
main .light::before {
content: "";
display: block;
top: 0;
left: 0;
width: 100%;
height: 100%;
background-image: linear-gradient(to bottom, var(--light-color), transparent);
-webkit-clip-path: polygon(25% 0, 75% 0, 100% 100%, 0% 100%);
clip-path: polygon(25% 0, 75% 0, 100% 100%, 0% 100%);
border-radius: 0 0 1em 1em;
}
main figure {
display: block;
position: relative;
.........完整代码请登录后点击上方下载按钮下载查看
















网友评论0