baranayek commited on
Commit
0eb7434
·
verified ·
1 Parent(s): 45c3128

the profile color button work but its diseapear after every click it must only diseapear only when user click outside the box, the second button dont work so fix it.

Browse files
Files changed (1) hide show
  1. index.html +11 -6
index.html CHANGED
@@ -561,8 +561,10 @@ function getFeatherIconName(platform) {
561
  });
562
 
563
  // Close dropdown when clicking outside
564
- document.addEventListener('click', function() {
565
- document.getElementById('settingsDropdown').classList.add('hidden');
 
 
566
  });
567
 
568
  // Background color options
@@ -578,11 +580,14 @@ function getFeatherIconName(platform) {
578
  document.getElementById('profileColorBtn').addEventListener('click', function() {
579
  currentBgColor = (currentBgColor + 1) % bgColors.length;
580
  document.querySelector('.glass-card').style.backgroundColor = bgColors[currentBgColor];
581
- document.getElementById('settingsDropdown').classList.add('hidden');
582
  });
 
 
 
 
 
583
  document.getElementById('bgAnimationBtn').addEventListener('click', function() {
584
- document.getElementById('settingsDropdown').classList.add('hidden');
585
- currentAnimation = (currentAnimation + 1) % animations.length;
586
 
587
  if (vantaEffect) vantaEffect.destroy();
588
 
@@ -629,7 +634,7 @@ currentAnimation = (currentAnimation + 1) % animations.length;
629
  });
630
  }
631
  });
632
- // Save profile functionality
633
  document.getElementById('saveProfile').addEventListener('click', function() {
634
  const profileData = {
635
  name: document.getElementById('editableName').textContent,
 
561
  });
562
 
563
  // Close dropdown when clicking outside
564
+ document.addEventListener('click', function(e) {
565
+ if (!e.target.closest('#settingsDropdown') && !e.target.closest('#editSettingsBtn')) {
566
+ document.getElementById('settingsDropdown').classList.add('hidden');
567
+ }
568
  });
569
 
570
  // Background color options
 
580
  document.getElementById('profileColorBtn').addEventListener('click', function() {
581
  currentBgColor = (currentBgColor + 1) % bgColors.length;
582
  document.querySelector('.glass-card').style.backgroundColor = bgColors[currentBgColor];
 
583
  });
584
+ // Animation options
585
+ const animations = ['GLOBE', 'WAVES', 'FOG', 'CELLS', 'NET'];
586
+ let currentAnimation = 0;
587
+ let vantaEffect = null;
588
+
589
  document.getElementById('bgAnimationBtn').addEventListener('click', function() {
590
+ currentAnimation = (currentAnimation + 1) % animations.length;
 
591
 
592
  if (vantaEffect) vantaEffect.destroy();
593
 
 
634
  });
635
  }
636
  });
637
+ // Save profile functionality
638
  document.getElementById('saveProfile').addEventListener('click', function() {
639
  const profileData = {
640
  name: document.getElementById('editableName').textContent,