canvas实现鼠标可交互的粒子黑洞动画效果代码
代码语言:html
所属分类:粒子
代码描述:canvas实现鼠标可交互的粒子黑洞动画效果代码
下面为部分代码预览,完整代码请点击下载或在bfwstudio webide中打开
<!DOCTYPE html>
<html lang="en" >
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<style>
body, html {
height: 100%;
margin: 0;
padding: 0;
}
body {
height: 100%;
background-color: rgba(25,25,25,1);
overflow: hidden;
}
#blackhole {
height: 100%;
width: 100%;
position: relative;
display: flex;
}
.centerHover {
width: 255px;
height: 255px;
background-color: transparent;
border-radius: 50%;
position: absolute;
left: 50%;
top: 50%;
margin-top: -128px;
margin-left: -128px;
z-index: 2;
cursor: pointer;
line-height: 255px;
text-align: center;
transition: all 500ms;
}
.centerHover.open {
opacity: 0;
pointer-events: none;
}
.centerHover:hover span {
color: #DDD;
}
.centerHover:hover span:before {
background-color: #DDD;
}
.centerHover:hover span:after {
background-color: #DDD;
}
.cente.........完整代码请登录后点击上方下载按钮下载查看
















网友评论0