Update new year, Fix font
This commit is contained in:
parent
2d7c83cea1
commit
afca93e6cf
@ -5,6 +5,6 @@
|
||||
|
||||
@font-face {
|
||||
font-family: "Comic Mono";
|
||||
font-weight: boldM
|
||||
font-weight: bold;
|
||||
src: url('ComicMono-Bold.ttf') format('truetype');
|
||||
}
|
||||
|
@ -72,15 +72,15 @@ setInterval(() => {
|
||||
nextYear.setFullYear(theTime.getFullYear() + 1);
|
||||
const timeUntilMidnight = Math.floor((nextYear - theTime) / 1000);
|
||||
|
||||
if(timeUntilMidnight < 4 * 60 * 60) {
|
||||
if (timeUntilMidnight < 4 * 60 * 60) {
|
||||
state = STATE_COUNTDOWN;
|
||||
}else {
|
||||
} else {
|
||||
state = STATE_NONE;
|
||||
}
|
||||
}
|
||||
|
||||
if (state == STATE_FIREWORKS) {
|
||||
rockets.push({ x: Math.random() * canvas.width, y: canvas.height, life: (Math.random() * 0.75 + 0.25) * canvas.height, color: HSVtoRGB(Math.random(), 1, 1) });
|
||||
rockets.push({ x: Math.random() * canvas.width, y: canvas.height, life: (Math.random() * 0.75 + 0.25) * canvas.height, color: HSVtoRGB(Math.random(), 1, 1), rounds: Math.random() * 3 });
|
||||
return;
|
||||
} else {
|
||||
rockets = [];
|
||||
@ -123,10 +123,10 @@ setInterval(() => {
|
||||
ctx.font = "bold 30px Comic Mono";
|
||||
|
||||
let text = "The new year is approaching 👀";
|
||||
if(hours < 1) {
|
||||
if (hours < 1) {
|
||||
text = "The final hour has started ⏱️";
|
||||
|
||||
if(minutes == 0 && seconds < 60) {
|
||||
if (minutes == 0 && seconds < 60) {
|
||||
text = "It's the final countdown 😳";
|
||||
}
|
||||
}
|
||||
@ -150,15 +150,17 @@ setInterval(() => {
|
||||
const size = explosionTime * EXPLOSION_SIZE;
|
||||
|
||||
for (let i = 0; i < NUM_PARTICLES; i++) {
|
||||
const angle = i / NUM_PARTICLES * Math.PI * 2;
|
||||
const px = Math.cos(angle) * size;
|
||||
const py = Math.sin(angle) * size;
|
||||
for (let j = 0; j < rocket.rounds; j++) {
|
||||
const angle = i / NUM_PARTICLES * Math.PI * 2 + j * 5;
|
||||
const px = (j + 1) * Math.cos(angle) * size;
|
||||
const py = (j + 1) * Math.sin(angle) * size;
|
||||
|
||||
ctx.fillStyle = rocket.color;
|
||||
ctx.beginPath();
|
||||
ctx.arc(rocket.x + px, rocket.y + py, 5, 0, Math.PI * 2, true);
|
||||
ctx.fill();
|
||||
}
|
||||
}
|
||||
} else {
|
||||
rocket.y -= SPEED;
|
||||
ctx.fillStyle = "black";
|
||||
|
Loading…
x
Reference in New Issue
Block a user