Javascript particle alternatives
This commit is contained in:
parent
ff3d4e4d04
commit
b9f830a23b
6 changed files with 2172 additions and 7 deletions
2103
static/jquery.js
vendored
2103
static/jquery.js
vendored
File diff suppressed because it is too large
Load diff
34
static/themes/magic/script.js
Normal file
34
static/themes/magic/script.js
Normal file
|
@ -0,0 +1,34 @@
|
|||
$(document).ready(() => {
|
||||
function particle() {
|
||||
var particle = $("<div></div>")
|
||||
particle.addClass("particle")
|
||||
particle.css("left", (Math.random() * 100).toString() + "%")
|
||||
particle.css("visibility", "visible")
|
||||
particle.css("top", "100%")
|
||||
var anim = "sway 4s infinite cubic-bezier(0.445, 0.05, 0.55, 0.95)"
|
||||
if (Math.round(Math.random()) == 1) {
|
||||
anim += " alternate"
|
||||
} else {
|
||||
anim += " alternate-reverse"
|
||||
}
|
||||
particle.css("animation", anim)
|
||||
|
||||
particle.animate({
|
||||
"top": "-5%"
|
||||
}, (((Math.round(Math.random() * 10) / 10) * 0.3) + 20) * 1000, () => {
|
||||
particle.remove()
|
||||
})
|
||||
|
||||
$(".magicContainer").append(particle)
|
||||
}
|
||||
|
||||
$(".magicContainer > *").remove()
|
||||
|
||||
function loop() {
|
||||
particle()
|
||||
setTimeout(() => {
|
||||
loop()
|
||||
}, 1000);
|
||||
}
|
||||
loop()
|
||||
})
|
28
static/themes/rain/script.js
Normal file
28
static/themes/rain/script.js
Normal file
|
@ -0,0 +1,28 @@
|
|||
$(document).ready(() => {
|
||||
function particle() {
|
||||
var particle = $("<div></div>")
|
||||
particle.addClass("rainDrop")
|
||||
particle.css("left", (Math.random() * 100).toString() + "%")
|
||||
particle.css("visibility", "visible")
|
||||
particle.css("top", "-10%")
|
||||
|
||||
particle.animate({
|
||||
"top": "110%",
|
||||
"easing": "linear"
|
||||
}, 600, () => {
|
||||
particle.remove()
|
||||
})
|
||||
|
||||
$(".rainContainer").append(particle)
|
||||
}
|
||||
|
||||
$(".rainContainer > *").remove()
|
||||
|
||||
function loop() {
|
||||
particle()
|
||||
setTimeout(() => {
|
||||
loop()
|
||||
}, 100 * (Math.random() + 0.25));
|
||||
}
|
||||
loop()
|
||||
})
|
Loading…
Add table
Add a link
Reference in a new issue