cyvn commited on
Commit
e6569c8
·
verified ·
1 Parent(s): b5d03dd

make the animated particles visible

Browse files
Files changed (2) hide show
  1. components/particles.js +7 -7
  2. style.css +4 -4
components/particles.js CHANGED
@@ -15,17 +15,17 @@ class ParticlesBackground extends HTMLElement {
15
  }
16
  .particle {
17
  position: absolute;
18
- background-color: rgba(255, 255, 255, 0.05);
19
  border-radius: 50%;
20
  pointer-events: none;
21
- filter: blur(0.5px);
22
  }
23
  .particle:nth-child(3n) {
24
- background-color: rgba(100, 220, 255, 0.03);
25
  }
26
  .particle:nth-child(5n) {
27
- background-color: rgba(255, 100, 220, 0.03);
28
- }
29
  </style>
30
  <div id="particles-container"></div>
31
  `;
@@ -36,12 +36,12 @@ class ParticlesBackground extends HTMLElement {
36
 
37
  createParticles() {
38
  const container = this.shadowRoot.getElementById('particles-container');
39
- const particleCount = 30;
40
  for (let i = 0; i < particleCount; i++) {
41
  const particle = document.createElement('div');
42
  particle.classList.add('particle');
43
  // Random size between 0.5 and 2px
44
- const size = Math.random() * 1.5 + 0.5;
45
  particle.style.width = `${size}px`;
46
  particle.style.height = `${size}px`;
47
 
 
15
  }
16
  .particle {
17
  position: absolute;
18
+ background-color: rgba(255, 255, 255, 0.15);
19
  border-radius: 50%;
20
  pointer-events: none;
21
+ filter: blur(1px);
22
  }
23
  .particle:nth-child(3n) {
24
+ background-color: rgba(100, 220, 255, 0.15);
25
  }
26
  .particle:nth-child(5n) {
27
+ background-color: rgba(255, 100, 220, 0.15);
28
+ }
29
  </style>
30
  <div id="particles-container"></div>
31
  `;
 
36
 
37
  createParticles() {
38
  const container = this.shadowRoot.getElementById('particles-container');
39
+ const particleCount = 50;
40
  for (let i = 0; i < particleCount; i++) {
41
  const particle = document.createElement('div');
42
  particle.classList.add('particle');
43
  // Random size between 0.5 and 2px
44
+ const size = Math.random() * 2 + 1;
45
  particle.style.width = `${size}px`;
46
  particle.style.height = `${size}px`;
47
 
style.css CHANGED
@@ -49,9 +49,9 @@ body::before {
49
  left: 0;
50
  width: 100%;
51
  height: 100%;
52
- background:
53
- radial-gradient(circle at 20% 30%, rgba(40,40,40,0.1) 0%, transparent 30%),
54
- radial-gradient(circle at 80% 70%, rgba(40,40,40,0.1) 0%, transparent 30%);
55
- pointer-events: none;
56
  z-index: -2;
57
  }
 
49
  left: 0;
50
  width: 100%;
51
  height: 100%;
52
+ background:
53
+ radial-gradient(circle at 20% 30%, rgba(40,40,40,0.4) 0%, transparent 30%),
54
+ radial-gradient(circle at 80% 70%, rgba(40,40,40,0.4) 0%, transparent 30%);
55
+ pointer-events: none;
56
  z-index: -2;
57
  }