Skip to content

Instantly share code, notes, and snippets.

@SanshooSenshi
Created July 19, 2022 19:03
Show Gist options
  • Save SanshooSenshi/22014ed679676af44974bdb9e15dc465 to your computer and use it in GitHub Desktop.
Save SanshooSenshi/22014ed679676af44974bdb9e15dc465 to your computer and use it in GitHub Desktop.
tsParticles - Make it rain πŸ’΅!! - Dollars confetti
<div id="tsparticles"></div>
(async () => {
await loadConfettiPreset(tsParticles);
await tsParticles.load("tsparticles", {
particles: {
shape: {
type: "character",
options: {
character: {
fill: true,
font: "Verdana",
value: "πŸ’΅",
style: "",
weight: 400
}
}
},
life: {
duration: {
value: 0
}
},
number: {
value: 200,
max: 0,
density: {
enable: true
}
},
move: {
gravity: {
enable: false
},
decay: 0,
direction: "bottom",
speed: 2,
outModes: {
default: "out",
left: "out",
right: "out",
bottom: "out",
top: "out"
}
},
size: {
value: 12
},
opacity: {
value: 1,
animation: {
enable: false
}
}
},
background: {
color: "#232323",
opacity: 0
},
emitters: [],
interactivity: {
events: {
onClick: {
enable: true,
mode: "repulse"
}
}
},
preset: "confetti"
});
})();
<script src="https://cdn.jsdelivr.net/npm/tsparticles@1.41.5/tsparticles.min.js"></script>
<script src="https://cdn.jsdelivr.net/npm/tsparticles-preset-confetti@1.41.5/tsparticles.preset.confetti.min.js"></script>
/* ---- reset ---- */
.github {
bottom: 10px;
right: 10px;
position: fixed;
border-radius: 10px;
background: #fff;
padding: 0 12px 6px 12px;
border: 1px solid #000;
z-index: 2000;
}
.github a:hover,
.github a:link,
.github a:visited,
.github a:active {
color: #000;
text-decoration: none;
}
.github img {
height: 30px;
}
.github #gh-project {
font-size: 20px;
padding-left: 5px;
font-weight: bold;
vertical-align: bottom;
}
<link href="https://cdnjs.cloudflare.com/ajax/libs/twitter-bootstrap/4.5.0/css/bootstrap.min.css" rel="stylesheet" />
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment