js+css实现按钮点击粒子扩散发射动画效果代码
代码语言:html
所属分类:粒子
代码描述:js+css实现按钮点击粒子扩散发射动画效果代码
代码标签: js css 按钮 点击 粒子 扩散 发射 动画
下面为部分代码预览,完整代码请点击下载或在bfwstudio webide中打开
<!DOCTYPE html>
<html lang="en" >
<head>
<meta charset="UTF-8">
<style>
/* Ensure the page fills the window */
html, body {
margin: 0;
padding: 0;
overflow: hidden;
height: 100%;
background: #222;
}
/* Centered button with a smooth scale transition */
#explosion-button {
position: absolute;
top: 50%;
left: 50%;
transform: translate(-50%, -50%);
padding: 15px 30px;
font-size: 18px;
font-family: sans-serif;
color: #fff;
background-color: #3498db;
border: none;
border-radius: 5px;
cursor: pointer;
transition: transform 0.2s ease-out;
}
/* Scale-up effect when active */
#explosion-button.active {
transform: translate(-50%, -50%) scale(1.2);
}
/* The canvas covers the entire window and doesn’t interfere with clicks */
#particle-canvas {
position: fixed;
top:.........完整代码请登录后点击上方下载按钮下载查看
















网友评论0