canvas实现粒子鼠标交互动画效果代码
代码语言:html
所属分类:粒子
代码描述:canvas实现粒子鼠标交互动画效果代码,鼠标放上去,粒子会躲避。
下面为部分代码预览,完整代码请点击下载或在bfwstudio webide中打开
<!DOCTYPE html>
<html lang="en" >
<head>
<meta charset="UTF-8">
<style>
html, body {
background: #111;
}
#container {
background: #111;
position: absolute;
left: 50%;
top: 50%;
}
/*
#stats {
position: absolute;
right: 10px;
top: 10px;
}
*/
/* Info */
@keyframes show-info {
0% {
transform: rotateY(120deg);
}
100% {
transform: rotateY(0deg);
}
}
.info {
transition: all 180ms ease-out;
transform-style: preserve-3d;
transform: perspective(800px);
font-family: "Lucida Console", Monaco, monospace;
position: absolute;
font-size: 12px;
opacity: 0.8;
color: #fff;
width: 220px;
left: 0px;
top: 20px;
}
.info:hover {
box-shadow: 0 0 0 4px rgba(255, 255, 255, 0.05);
opacity: 1;
}
.info h1, .info h2, .info h3 {
line-height: 1;
margin: 5px 0;
}
.info a {
.........完整代码请登录后点击上方下载按钮下载查看
















网友评论0