|
1 |
| -<main class="w-full relative min-h-screen w-full flex items-center justify-center"> |
| 1 | +<main class="w-full relative min-h-screen w-full flex items-center justify-center overflow-hidden"> |
2 | 2 | <div
|
3 |
| - class="w-90vw -z-10 h-80vw rounded-full absolute top-0 left-1/2 -translate-y-3/5 -translate-x-1/2 blur-300px scale-y-70%" |
4 |
| - style="background-image: radial-gradient(circle,#442464 0%, #9d53d6 50%, #5ee3f0 80%);"> |
| 3 | + class="-z-10 w-70 h-70 blur-150 -translate-y-1/2 lg:(w-90vw h-80vw -translate-y-3/5 -translate-x-1/2 blur-300px left-1/2) rounded-full absolute top-0 scale-y-70% bg-purple"></div> |
5 | 4 | </div>
|
6 | 5 |
|
7 | 6 | <div class="z-90 flex p-8 lg:p-0 flex-col gap-8 sm:(gap-12 text-center items-center justify-center) text-white">
|
|
15 | 14 | </div>
|
16 | 15 | </a>
|
17 | 16 | </div>
|
18 |
| - <div class="absolute w-full top-1/2 left-1/2 -translate-y-1/2 -translate-x-1/2 -z-11 overflow-hidden flex items-center justify-center opacity-50 sm:opacity-100"> |
| 17 | + <div |
| 18 | + class="absolute w-full top-1/2 left-1/2 -translate-y-1/2 -translate-x-1/2 -z-11 overflow-hidden flex items-center justify-center opacity-50 sm:opacity-100"> |
19 | 19 | <canvas width="1000" height="1000" id="herocanvas" class="w-1000px h-1000px" aria-hidden="true"> </canvas>
|
20 | 20 | </div>
|
21 | 21 | </main>
|
|
31 | 31 | const hWidth = width / 2;
|
32 | 32 | const hHeight = height / 2;
|
33 | 33 | const particles = [];
|
34 |
| - const particlesCount = 200; |
| 34 | + const particlesCount = Math.min(100, Math.floor(window.innerWidth / 10)); |
35 | 35 | const defaultPartSpeed = 0.005;
|
36 | 36 |
|
37 | 37 | let bgOpacity = 1;
|
|
75 | 75 | this.time -= this.speed;
|
76 | 76 |
|
77 | 77 | this.θ = 2 * Math.PI * this.u + this.time;
|
78 |
| - |
79 | 78 | this.φ = Math.acos(2 * this.v - 1) - Math.PI * 0.5;
|
80 | 79 |
|
81 | 80 | this.x = this.radius * Math.sin(this.θ) * Math.cos(this.φ);
|
|
99 | 98 | }
|
100 | 99 |
|
101 | 100 | render(ctx: CanvasRenderingContext2D) {
|
102 |
| - const hSize = this.size / 2; |
| 101 | + const x = this.x + hWidth; |
| 102 | + const y = this.y + hHeight; |
| 103 | + const radius = this.size / 2; |
103 | 104 |
|
104 | 105 | ctx.fillStyle = this.getColor(ctx);
|
105 |
| - |
106 |
| - ctx.fillRect(hWidth + this.x - hSize, hHeight + this.y - hSize, this.size, this.size); |
| 106 | + ctx.beginPath(); |
| 107 | + ctx.arc(x, y, radius, 0, Math.PI * 2); |
| 108 | + ctx.fill(); |
107 | 109 | }
|
108 | 110 |
|
109 | 111 | get data() {
|
|
0 commit comments