温馨提示:本文最后更新于
2024-10-04 13:51:49
,某些文章具有时效性,若有错误或已失效,请联系星雨站长!前言
今天在扒洪哥关于页面的时候,看到anzhiyu主题里的鼠标跟踪文字动画挺有意思的,顺手扒下来写进了本站的关于页面里,这里单独拿出来写篇教程分享一下!!
演示效果
Hello there!
部署教程
HTML代码
CSS代码
:root {
--style-border-always: 1px solid #e3e8f7;;
}
.hello-about {
margin: 0px auto;
position: relative;
overflow: hidden;
-webkit-user-select: none;
-moz-user-select: none;
-ms-user-select: none;
user-select: none
}
.shapes {
position: relative;
height: 315px;
width: 100%;
background: #2128bd;
overflow: hidden
}
.shape {
will-change: transform;
position: absolute;
border-radius: 50%
}
.shape.shape-1 {
background: #005ffe;
width: 650px;
height: 650px;
margin: -325px 0 0 -325px
}
.shape.shape-2 {
background: #ffe5e3;
width: 440px;
height: 440px;
margin: -220px 0 0 -220px
}
.shape.shape-3 {
background: #ffcc57;
width: 270px;
height: 270px;
margin: -135px 0 0 -135px
}
.hello-about .content {
top: 0;
left: 0;
position: absolute;
display: -webkit-box;
display: -moz-box;
display: -webkit-flex;
display: -ms-flexbox;
display: box;
-webkit-box-pack: center;
-moz-box-pack: center;
-o-box-pack: center;
-ms-flex-pack: center;
-webkit-justify-content: center;
justify-content: center;
-webkit-box-align: center;
-moz-box-align: center;
-o-box-align: center;
-ms-flex-align: center;
-webkit-align-items: center;
align-items: center;
height: 315px;
width: 100%;
background: #fff;
mix-blend-mode: screen
}
.hello-about h1 {
color: #000;
margin: 0;
text-align: center;
font: inherit;
vertical-align: baseline;
line-height: 1;
font-size: calc(.0989119683 * 100vw + 58.5558852621px);
width: 100%;
height: 100%;
display: -webkit-box;
display: -moz-box;
display: -webkit-flex;
display: -ms-flexbox;
display: box;
-webkit-box-align: center;
-moz-box-align: center;
-o-box-align: center;
-ms-flex-align: center;
-webkit-align-items: center;
align-items: center;
-webkit-box-pack: center;
-moz-box-pack: center;
-o-box-pack: center;
-ms-flex-pack: center;
-webkit-justify-content: center;
justify-content: center
}
@media (min-width:419px) {
.hello-about h1 {
font-size: calc(.0989119683 * 100vw + 58.5558852621px)
}
}
@media (max-width:768px) {
.hello-about {
margin: 20px 0 auto
}
}
.cursor {
position: absolute;
background: #2128bd;
width: 20px;
height: 20px;
margin: -10px 0 0 -10px;
border-radius: 50%;
will-change: transform;
-webkit-user-select: none;
-moz-user-select: none;
-ms-user-select: none;
user-select: none;
pointer-events: none;
z-index: 3
}
© 版权声明
本文是原创文章,采用CC BY-NC-SA 4.0协议,完整转载请注明来自星雨の博客
THE END