Koperization commited on
Commit
873b777
·
verified ·
1 Parent(s): f5f152d

Make the juniors and senior buttons useable where they act as a filter

Browse files
Files changed (1) hide show
  1. teams.html +80 -30
teams.html CHANGED
@@ -33,7 +33,12 @@
33
  color: #62c1cd;
34
  border-bottom: 3px solid #62c1cd;
35
  }
36
- .team-section {
 
 
 
 
 
37
  display: none;
38
  }
39
  .team-section.active {
@@ -112,24 +117,35 @@
112
  <!-- Volleyball Teams -->
113
  <div id="volleyball" class="team-section active">
114
  <h2 class="bebas text-4xl text-center text-[#62c1cd] mb-8">VOLLEYBALL TEAMS</h2>
115
-
116
  <!-- Team Navigation -->
 
 
 
 
 
 
 
 
 
 
 
 
 
117
  <div class="flex flex-wrap justify-center gap-2 mb-8">
118
- <button class="team-tab bg-[#1a1a1a] px-4 py-2 rounded montserrat text-sm active" data-team="volleyball-juniors-a">
119
  Juniors A
120
  </button>
121
- <button class="team-tab bg-[#1a1a1a] px-4 py-2 rounded montserrat text-sm" data-team="volleyball-juniors-b">
122
  Juniors B
123
  </button>
124
- <button class="team-tab bg-[#1a1a1a] px-4 py-2 rounded montserrat text-sm" data-team="volleyball-seniors-a">
125
  Seniors A
126
  </button>
127
- <button class="team-tab bg-[#1a1a1a] px-4 py-2 rounded montserrat text-sm" data-team="volleyball-seniors-b">
128
  Seniors B
129
  </button>
130
  </div>
131
-
132
- <!-- Juniors A Team -->
133
  <div id="volleyball-juniors-a" class="team-content active">
134
  <h3 class="bebas text-2xl text-[#62c1cd] mb-6">Juniors A Team</h3>
135
 
@@ -776,31 +792,65 @@
776
  document.getElementById(sport).classList.add('active');
777
  });
778
  });
779
-
780
- // Team tab switching
781
- const teamTabs = document.querySelectorAll('.team-tab');
782
- teamTabs.forEach(tab => {
783
- tab.addEventListener('click', function() {
784
- // Remove active class from all tabs in this group
785
- this.parentElement.querySelectorAll('.team-tab').forEach(t => {
786
- t.classList.remove('active');
787
- });
788
-
789
- // Add active class to clicked tab
790
- this.classList.add('active');
791
-
792
- // Hide all team content in this sport section
793
- const sportSection = this.closest('.team-section');
794
- sportSection.querySelectorAll('.team-content').forEach(content => {
795
- content.classList.remove('active');
796
- });
797
-
798
- // Show selected team content
799
- const team = this.getAttribute('data-team');
800
- document.getElementById(team).classList.add('active');
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
801
  });
 
 
 
 
 
 
 
 
 
 
 
 
 
802
  });
803
  });
 
804
 
805
  // Player modal functions
806
  function openPlayerModal(playerId) {
 
33
  color: #62c1cd;
34
  border-bottom: 3px solid #62c1cd;
35
  }
36
+ .active-filter {
37
+ background-color: #62c1cd !important;
38
+ color: #020202 !important;
39
+ box-shadow: 0 0 15px rgba(98, 193, 205, 0.5);
40
+ }
41
+ .team-section {
42
  display: none;
43
  }
44
  .team-section.active {
 
117
  <!-- Volleyball Teams -->
118
  <div id="volleyball" class="team-section active">
119
  <h2 class="bebas text-4xl text-center text-[#62c1cd] mb-8">VOLLEYBALL TEAMS</h2>
 
120
  <!-- Team Navigation -->
121
+ <div class="flex flex-wrap justify-center gap-4 mb-8">
122
+ <button class="team-filter bg-[#62c1cd] text-[#020202] px-6 py-2 rounded-lg montserrat font-bold active-filter" data-filter="juniors">
123
+ Juniors Teams
124
+ </button>
125
+ <button class="team-filter bg-[#1a1a1a] hover:bg-[#2a2a2a] text-[#fcfdfd] px-6 py-2 rounded-lg montserrat font-bold" data-filter="seniors">
126
+ Seniors Teams
127
+ </button>
128
+ <button class="team-filter bg-[#1a1a1a] hover:bg-[#2a2a2a] text-[#fcfdfd] px-6 py-2 rounded-lg montserrat font-bold" data-filter="all">
129
+ All Teams
130
+ </button>
131
+ </div>
132
+
133
+ <!-- Team Tabs -->
134
  <div class="flex flex-wrap justify-center gap-2 mb-8">
135
+ <button class="team-tab bg-[#1a1a1a] px-4 py-2 rounded montserrat text-sm active" data-team="volleyball-juniors-a" data-category="juniors">
136
  Juniors A
137
  </button>
138
+ <button class="team-tab bg-[#1a1a1a] px-4 py-2 rounded montserrat text-sm" data-team="volleyball-juniors-b" data-category="juniors">
139
  Juniors B
140
  </button>
141
+ <button class="team-tab bg-[#1a1a1a] px-4 py-2 rounded montserrat text-sm" data-team="volleyball-seniors-a" data-category="seniors">
142
  Seniors A
143
  </button>
144
+ <button class="team-tab bg-[#1a1a1a] px-4 py-2 rounded montserrat text-sm" data-team="volleyball-seniors-b" data-category="seniors">
145
  Seniors B
146
  </button>
147
  </div>
148
+ <!-- Juniors A Team -->
 
149
  <div id="volleyball-juniors-a" class="team-content active">
150
  <h3 class="bebas text-2xl text-[#62c1cd] mb-6">Juniors A Team</h3>
151
 
 
792
  document.getElementById(sport).classList.add('active');
793
  });
794
  });
795
+ // Team filter functionality
796
+ const teamFilters = document.querySelectorAll('.team-filter');
797
+ const teamTabs = document.querySelectorAll('.team-tab');
798
+
799
+ teamFilters.forEach(filter => {
800
+ filter.addEventListener('click', function() {
801
+ // Remove active class from all filters
802
+ teamFilters.forEach(f => f.classList.remove('active-filter'));
803
+ // Add active class to clicked filter
804
+ this.classList.add('active-filter');
805
+
806
+ const filterType = this.getAttribute('data-filter');
807
+
808
+ // Show/hide team tabs based on filter
809
+ teamTabs.forEach(tab => {
810
+ const category = tab.getAttribute('data-category');
811
+ if (filterType === 'all' || category === filterType) {
812
+ tab.style.display = 'inline-block';
813
+ } else {
814
+ tab.style.display = 'none';
815
+ }
816
+ });
817
+
818
+ // If current active tab is hidden, switch to first visible tab
819
+ const activeTab = document.querySelector('.team-tab.active');
820
+ if (activeTab && activeTab.style.display === 'none') {
821
+ const firstVisibleTab = document.querySelector('.team-tab[style="display: inline-block;"]') ||
822
+ document.querySelector('.team-tab:not([style*="none"])');
823
+ if (firstVisibleTab) {
824
+ firstVisibleTab.click();
825
+ }
826
+ }
827
+ });
828
+ });
829
+
830
+ // Team tab switching
831
+ const teamTabs = document.querySelectorAll('.team-tab');
832
+ teamTabs.forEach(tab => {
833
+ tab.addEventListener('click', function() {
834
+ // Remove active class from all tabs in this group
835
+ this.parentElement.querySelectorAll('.team-tab').forEach(t => {
836
+ t.classList.remove('active');
837
  });
838
+
839
+ // Add active class to clicked tab
840
+ this.classList.add('active');
841
+
842
+ // Hide all team content in this sport section
843
+ const sportSection = this.closest('.team-section');
844
+ sportSection.querySelectorAll('.team-content').forEach(content => {
845
+ content.classList.remove('active');
846
+ });
847
+
848
+ // Show selected team content
849
+ const team = this.getAttribute('data-team');
850
+ document.getElementById(team).classList.add('active');
851
  });
852
  });
853
+ });
854
 
855
  // Player modal functions
856
  function openPlayerModal(playerId) {