Compare commits
2 Commits
f9b4054571
...
010520f722
| Author | SHA1 | Date | |
|---|---|---|---|
| 010520f722 | |||
| 66a8bacbe8 |
@@ -6,4 +6,6 @@ canvas {
|
|||||||
|
|
||||||
width: 100vw;
|
width: 100vw;
|
||||||
height: 100vh;
|
height: 100vh;
|
||||||
|
width: 100lvw;
|
||||||
|
height: 100lvh;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -119,6 +119,12 @@ export class DotBackground implements OnDestroy {
|
|||||||
if (speed > 0.3) {
|
if (speed > 0.3) {
|
||||||
dot.vx *= 0.98;
|
dot.vx *= 0.98;
|
||||||
dot.vy *= 0.98;
|
dot.vy *= 0.98;
|
||||||
|
} else if (speed <= 0.3) {
|
||||||
|
dot.vx *= 1.02;
|
||||||
|
dot.vy *= 1.02;
|
||||||
|
} else if (speed === 0) {
|
||||||
|
dot.vx = Math.random() * 0.2 - 0.1;
|
||||||
|
dot.vy = Math.random() * 0.2 - 0.1;
|
||||||
}
|
}
|
||||||
|
|
||||||
// Bounce off edges (accounting for radius)
|
// Bounce off edges (accounting for radius)
|
||||||
|
|||||||
Reference in New Issue
Block a user