Konfetti Regen
Ein Voll funktionstüchtiges Script. Entpacken und starten. Läst Konffeti Regnen
Zum Download Archiv
Kommentar abgeben zu diesen Beitrag/Code ?Dann hier klicken
Der hier verwendete Code
<html>
<head>
<meta charset="UTF-8">
<title>Konfetti Regen</title>
<script src="https://cdnjs.cloudflare.com/ajax/libs/jquery/3.2.1/jquery.min.js"></script>">
<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1">
</head>
<body>
<canvas id="canvas" width="768" height="550"></canvas>
<script>
var canvas1, ctx, W, H;
if (screen.width >= 988) var mp = 150;
else mp = 75;
var deactivationTimerHandler, reactivationTimerHandler, animationHandler, particles = [],
angle = 0,
tiltAngle = 0,
confettiActive = !0,
animationComplete = !0,
particleColors = {
colorOptions: ["DodgerBlue", "OliveDrab", "Gold", "pink", "SlateBlue", "lightblue", "Violet", "PaleGreen", "SteelBlue", "SandyBrown", "Chocolate", "Crimson"],
colorIndex: 0,
colorIncrementer: 0,
colorThreshold: 10,
getColor: function() {
return this.colorIncrementer >= 10 && (this.colorIncrementer = 0, this.colorIndex++, this.colorIndex >= this.colorOptions.length && (this.colorIndex = 0)), this.colorIncrementer++, this.colorOptions[this.colorIndex]
}
};
function confettiParticle(t) {
this.x = Math.random() * W, this.y = Math.random() * H - H, this.r = RandomFromTo(10, 30), this.d = Math.random() * mp + 10, this.color = t, this.tilt = Math.floor(10 * Math.random()) - 10, this.tiltAngleIncremental = .07 * Math.random() + .05, this.tiltAngle = 0, this.draw = function() {
return ctx.beginPath(), ctx.lineWidth = this.r / 2, ctx.strokeStyle = this.color, ctx.moveTo(this.x + this.tilt + this.r / 4, this.y), ctx.lineTo(this.x + this.tilt, this.y + this.tilt + this.r / 4), ctx.stroke()
}
}
function InitializeButton() {
$("#stopButton").click(DeactivateConfetti), $("#startButton").click(RestartConfetti)
}
function SetGlobals() {