mirror of
https://github.com/NeonGamerBot-QK/saahild.com.git
synced 2025-07-20 12:49:04 +00:00
footer
This commit is contained in:
parent
0675604d1a
commit
816d9dba30
6 changed files with 79 additions and 19 deletions
|
@ -20,7 +20,7 @@ class Char {
|
|||
draw() {
|
||||
const distToCursor = Math.hypot(
|
||||
this.x - cursor.value.x,
|
||||
this.y - cursor.value.y,
|
||||
this.y - cursor.value.y
|
||||
);
|
||||
|
||||
const highlight = Math.max(0, 0.5 - distToCursor / 250);
|
||||
|
@ -66,7 +66,7 @@ const init = () => {
|
|||
const minColumns = 15; // Ensure at least this many columns on mobile
|
||||
const columns = Math.max(
|
||||
minColumns,
|
||||
Math.floor(window.innerWidth / columnSpacing),
|
||||
Math.floor(window.innerWidth / columnSpacing)
|
||||
);
|
||||
|
||||
// Adjust rows based on screen height
|
||||
|
@ -75,7 +75,7 @@ const init = () => {
|
|||
const maxRows = 25; // Cap for performance on large screens
|
||||
const rows = Math.min(
|
||||
maxRows,
|
||||
Math.max(minRows, Math.floor(window.innerHeight / rowSpacing)),
|
||||
Math.max(minRows, Math.floor(window.innerHeight / rowSpacing))
|
||||
);
|
||||
|
||||
chars = [];
|
||||
|
@ -84,7 +84,7 @@ const init = () => {
|
|||
const x = i * (window.innerWidth / columns); // Evenly distribute columns
|
||||
const y = j * rowSpacing - Math.random() * window.innerHeight;
|
||||
const char = String.fromCharCode(
|
||||
0x2729 + Math.floor(Math.random() * 706),
|
||||
0x2729 + Math.floor(Math.random() * 706)
|
||||
);
|
||||
chars.push(new Char(x, y, char));
|
||||
}
|
||||
|
@ -130,6 +130,31 @@ const handleResize = () => {
|
|||
onMounted(() => {
|
||||
init();
|
||||
animate();
|
||||
// if im holding down shift how can i make it go faster? code it
|
||||
window.addEventListener("keydown", (e) => {
|
||||
if (e.key === "Shift") {
|
||||
chars.forEach((char) => {
|
||||
char.speed *= 10; // Double the speed when Shift is pressed
|
||||
});
|
||||
}
|
||||
if (e.ctrlKey) {
|
||||
chars.forEach((char) => {
|
||||
char.speed *= 1.1; // Halve the speed when Ctrl is pressed
|
||||
});
|
||||
}
|
||||
if (e.altKey) {
|
||||
chars.forEach((char) => {
|
||||
char.speed *= 0.9; // Halve the speed when Alt is pressed
|
||||
});
|
||||
}
|
||||
});
|
||||
window.addEventListener("keyup", (e) => {
|
||||
if (e.key === "Shift") {
|
||||
chars.forEach((char) => {
|
||||
char.speed /= 10; // Reset the speed when Shift is released
|
||||
});
|
||||
}
|
||||
});
|
||||
window.addEventListener("mousemove", handleMouseMove);
|
||||
window.addEventListener("resize", handleResize);
|
||||
});
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue