File tree Expand file tree Collapse file tree 2 files changed +31
-0
lines changed Expand file tree Collapse file tree 2 files changed +31
-0
lines changed Original file line number Diff line number Diff line change @@ -20,11 +20,19 @@ document.addEventListener("DOMContentLoaded", () => {
2020
2121        const  spotsLeft  =  details . max_participants  -  details . participants . length ; 
2222
23+         const  participantsList  =  details . participants . length 
24+           ? `<ul>${ details . participants . map ( participant  =>  `<li>${ participant }  </li>` ) . join ( "" ) }  </ul>` 
25+           : "<p>No participants yet.</p>" ; 
26+ 
2327        activityCard . innerHTML  =  ` 
2428          <h4>${ name }  </h4> 
2529          <p>${ details . description }  </p> 
2630          <p><strong>Schedule:</strong> ${ details . schedule }  </p> 
2731          <p><strong>Availability:</strong> ${ spotsLeft }   spots left</p> 
32+           <div class="participants"> 
33+             <h5>Participants:</h5> 
34+             ${ participantsList }  
35+           </div> 
2836        ` ; 
2937
3038        activitiesList . appendChild ( activityCard ) ; 
Original file line number Diff line number Diff line change @@ -136,6 +136,29 @@ button:hover {
136136  display :  none;
137137}
138138
139+ .participants  {
140+   margin-top :  15px  ;
141+   padding :  10px  ;
142+   border-top :  1px   solid # ddd ;
143+   background-color :  # f1f8e9 ;
144+   border-radius :  5px  ;
145+ }
146+ 
147+ .participants  h5  {
148+   margin-bottom :  10px  ;
149+   color :  # 2e7d32 ;
150+ }
151+ 
152+ .participants  ul  {
153+   list-style-type :  disc;
154+   padding-left :  20px  ;
155+ }
156+ 
157+ .participants  li  {
158+   margin-bottom :  5px  ;
159+   color :  # 333 ;
160+ }
161+ 
139162footer  {
140163  text-align :  center;
141164  margin-top :  30px  ;
    
 
   
 
     
   
   
          
     
  
    
     
 
    
      
     
 
     
    You can’t perform that action at this time.
  
 
    
  
     
    
      
        
     
 
       
      
     
   
 
    
    
  
 
  
 
     
    
0 commit comments