Skip to content

Commit

Permalink
Try fixing the schedule display
Browse files Browse the repository at this point in the history
  • Loading branch information
juchiyu committed May 3, 2024
1 parent ad6f179 commit 9166a9b
Showing 1 changed file with 39 additions and 40 deletions.
79 changes: 39 additions & 40 deletions schedule.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,45 @@
layout: page
title: Schedule
---
<script>
const ALL_DAYS = ["06-24", "06-25", "06-26", "06-27"];

function setupActiveDayTab(activeDay) {
/* First, remove the "active" classname for all tabs */
ALL_DAYS.forEach(day => {
let divDay = document.getElementById(`day-${day}`);
divDay.className = divDay.className.replace("active", "");
});

/* Then add it to the appropriate day */
let divDay = document.getElementById(`day-${activeDay}`);
divDay.className = `${divDay.className} active`;
}

function setupActiveDaySchedule(activeDay) {
/* First, hide all the schedule blocks */
ALL_DAYS.forEach(day => {
let divDay = document.getElementById(`schedule-${day}`);
divDay.className = divDay.className.replace("active", "");
});

/* Then display:block to show the appropriate one */
let divDay = document.getElementById(`schedule-${activeDay}`);
divDay.className = `${divDay.className} active`;
}

function showScheduleForDay(day) {
setupActiveDayTab(day);
setupActiveDaySchedule(day);
}

// Run the script after the entire document is loaded
document.addEventListener("DOMContentLoaded", function() {
// Call showScheduleForDay with the default day
showScheduleForDay('06-24');
});

</script>

<div class="schedule-days">
<div id="day-06-24" class="schedule-day active" onclick="showScheduleForDay('06-24')">June 24</div>
Expand Down Expand Up @@ -184,46 +223,6 @@ Meanwhile, please find the information in the following sections:
<div class="schedule-leave-space-before-footer">
</div>

<script>
const ALL_DAYS = ["06-24", "06-25", "06-26", "06-27"];

function setupActiveDayTab(activeDay) {
/* First, remove the "active" classname for all tabs */
ALL_DAYS.forEach(day => {
let divDay = document.getElementById(`day-${day}`);
divDay.className = divDay.className.replace("active", "");
});

/* Then add it to the appropriate day */
let divDay = document.getElementById(`day-${activeDay}`);
divDay.className = `${divDay.className} active`;
}

function setupActiveDaySchedule(activeDay) {
/* First, hide all the schedule blocks */
ALL_DAYS.forEach(day => {
let divDay = document.getElementById(`schedule-${day}`);
divDay.className = divDay.className.replace("active", "");
});

/* Then display:block to show the appropriate one */
let divDay = document.getElementById(`schedule-${activeDay}`);
divDay.className = `${divDay.className} active`;
}

function showScheduleForDay(day) {
setupActiveDayTab(day);
setupActiveDaySchedule(day);
}

// Run the script after the entire document is loaded
document.addEventListener("DOMContentLoaded", function() {
// Call showScheduleForDay with the default day
showScheduleForDay('06-24');
});

</script>

<script>
!function(d,s,id){var js,fjs=d.getElementsByTagName(s)[0];if(!d.getElementById(id)){js=d.createElement(s);js.id=id;js.src='https://plugins.eventable.com/eventable.js';fjs.parentNode.insertBefore(js,fjs);}}(document,'script', 'eventable-script');
</script>

0 comments on commit 9166a9b

Please sign in to comment.