particles+svg实现圣诞下雪鼠标跟随轮廓绘制圣诞树效果代码
代码语言:html
所属分类:其他
代码描述:particles+svg实现圣诞下雪鼠标跟随轮廓绘制圣诞树效果代码
代码标签: particles svg 圣诞 下雪 鼠标 跟随 轮廓 绘制 圣诞树
下面为部分代码预览,完整代码请点击下载或在bfwstudio webide中打开
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<style>
body {
display: flex;
justify-content: center;
align-items: center;
height: 100vh;
margin: 0;
background-color: #000;
}
.container {
position: relative;
width: 100%;
max-width: 1000px;
aspect-ratio: 1 / 1;
cursor: none;
}
.base-image {
position: absolute;
top: 0;
left: 0;
width: 100%;
height: 100%;
z-index: 1;
object-fit: cover;
}
.final-image {
position: absolute;
top: 0;
left: 0;
width: 100%;
height: 100%;
z-index: 2;
clip-path: circle(0px at var(--x, 0px) var(--y, 0px));
will-change: clip-path;
}
.container:hover .final-image {
clip-path: circle(10% at var(--x, 0px) var(--y, 0px));
}
#particles-js {
position: fixed;
top: 0;
left: 0;
z-index: 3;
width: 100vw;
height: 100vh;
overflow: hidden;
}
@media (max-width: 768px) {
.container {
max-width: 90%;
}
.container:hover .final-image {
clip-path: circle(15% at var(--x, 0px) var(--y, 0px));
}
}
@media (max-width: 480px) {
.container {
max-width: 100%;
}
.container:hover .final-image {
clip-path: circle(20% at var(--x, 0px) var(--y, 0px));
}
}
</style>
</head>
<body translate="no">
<div class="container">
<div id="particles-js"></div>
<!-- Animated using SVGANIMA - https://svganima.com -->
<svg width="100%" height="100%" viewBox="0 0 900 900" version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" xml:space="preserve" xmlns:serif="http://www.serif.com/" style="fill-rule: evenodd; clip-rule: evenodd; stroke-linecap: round; stroke-linejoin: round; stroke-miterlimit: 1.5; fill: rgb(0, 0, 0); stroke: none; stroke-width: 1px; opacity: 1; filter: none;" id="svg4571" preserveAspectRatio="xMidYMid" class="base-image">
<defs id="defs2515"></defs>
<g id="LINES" style="fill: rgb(0, 0, 0); stroke: none; stroke-width: 1px; stroke-linejoin: round; stroke-linecap: round; stroke-miterlimit: 1.5; opacity: 1; filter: none;">
<g id="Sly-right" transform="matrix(0.76769,0,0,0.76769,104.039,2.48585)">
<path d="M 450 0 C 698.362 0 900 201.638 900 450 C 900 510.617 887.989 568.451 866.218 621.249" style="fill: none; stroke: rgb(66, 138, 171); stroke-width: 3.91px; stroke-linejoin: round; stroke-linecap: round; stroke-miterlimit: 1.5; opacity: 1; filter: none; stroke-dasharray: 883px; stroke-dashoffset: 883px;" id="path6355">
<animate attributeType="auto" attributeName="stroke-dashoffset" values="-883;-883;0;0" calcMode="spline" keyTimes="0; 0.008862530818951156; 0.026717531818484706; 1" key.........完整代码请登录后点击上方下载按钮下载查看
















网友评论0