svg+gsap实现鼠标悬浮眼睛跟随软糖效果代码
代码语言:html
所属分类:悬停
代码描述:svg+gsap实现鼠标悬浮眼睛跟随软糖效果代码
下面为部分代码预览,完整代码请点击下载或在bfwstudio webide中打开
<!DOCTYPE html>
<html lang="en" >
<head>
<meta charset="UTF-8">
<style>
@import url('https://fonts.googleapis.com/css2?family=Nunito:wght@700&display=swap');
* {
margin: 0;
padding: 0;
box-sizing: border-box;
}
body {
position; relative;
height: 100vh;
display: grid;
place-items: center;
background: radial-gradient(
circle at center,
hsl(339, 92%, 99%),
hsl(339, 92%, 64%)
);
}
svg {
width: 90vmin;
height: 90vmin;
max-width: 640px;
}
.stars {
position: absolute;
top: 0;
left: 0;
width: 100%;
height: 100%;
z-index: -1;
opacity: 0;
}
.stars span {
position: absolute;
top: 50%;
left: 50%;
transform: translate(-50%, -50%);
}
.hover {
position: absolute;
bottom: 1rem;
right: 1rem;
font-size: 20px;
font-weight: 700;
color: #3B0216;
font-family: 'Nunito', system-ui, sans-serif;
}
</style>
</head>
<.........完整代码请登录后点击上方下载按钮下载查看
















网友评论0