div+css实现鼠标悬浮频谱动画效果代码
代码语言:html
所属分类:悬停
代码描述:div+css实现鼠标悬浮频谱动画效果代码
下面为部分代码预览,完整代码请点击下载或在bfwstudio webide中打开
<!DOCTYPE html>
<html lang="en" >
<head>
<meta charset="UTF-8">
<style>
@import url("https://fonts.googleapis.com/css2?family=Josefin+Sans:ital,wght@1,700&display=swap");
* {
padding: 0;
margin: 0 auto;
box-sizing: border-box;
}
body {
background-image: radial-gradient(circle, #333, #000 800px);
min-height: 100vh;
display: grid;
place-items: center;
}
.noise {
position: relative;
width: 287px;
height: 36px;
border: none;
background: none;
font-family: "Josefin Sans", sans-serif;
font-size: 24px;
color: #fff;
cursor: pointer;
}
.noise::after {
content: "Hover for Noise";
opacity: var(--op, 1);
transition: opacity 0.4s;
}
.noise > i {
position: absolute;
left: var(--left, 0);
top: 50%;
width: 3px;
height: 72px;
transform: translateY(-50%) scaleY(var(--sy, 0));
z-index: -1;
transition: transform var(--duration) ease-out;
}
.noise > i::after {
content: "";
position: absolute;
inset: 0;
background-image: linear-gradient(#fff, hsl(var(--hue, 0), 75%, 75%));
border-radius: 50%;
-webkit-animation: noise var(--duration) infinite ease-in-out alternate;
animation: noise var(--duration) infinite ease-in-out alternate;
-webkit-animation-play-state: var(--aps, paused);
animation-play-state: var(--aps, paused);
}
@-webkit-keyframes noise {
0% {
transform: scaleY(calc(1 - (var(--size, 0))));
}
100% {
transform: scaleY(calc(1 + (var(--size, 0))));
}
}
@keyframes noise {
0% {
transform: scaleY(calc(1 - (var(--size, 0))));
}
100% {
transform: scaleY(calc(1 + (var(--size, 0))));
}
}
.noise > i:nth-child(1) {
--lef.........完整代码请登录后点击上方下载按钮下载查看
















网友评论0