Skip to content

Commit 57dfca5

Browse files
committed
Update event.md
1 parent a317b3c commit 57dfca5

File tree

1 file changed

+49
-21
lines changed

1 file changed

+49
-21
lines changed

_pages/event.md

Lines changed: 49 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -381,8 +381,8 @@ body {
381381
{% for speaker in site.data.winter_school_speakers %}
382382
{% assign speaker_name = speaker.name | remove: "Prof. Dr. " %}
383383
{% if item contains speaker_name %}
384-
{% assign processed_item = processed_item | replace: speaker_name, '<a class="speaker-link" data-speaker-id="' | append: forloop.index | append: '">' | append: speaker_name | append: '</a>' %}
385-
{% endif %}
384+
{% assign processed_item = processed_item | replace: speaker_name, '<a href="javascript:void(0)" class="speaker-link" data-speaker-id="' | append: forloop.index | append: '">' | append: speaker_name | append: '</a>' %}
385+
{% endif %}
386386
{% endfor %}
387387
{{ processed_item }}
388388
</p>
@@ -401,43 +401,71 @@ body {
401401

402402
<script>
403403
document.addEventListener('DOMContentLoaded', function() {
404-
// Schedule day toggle functionality
405-
const dayHeaders = document.querySelectorAll('.schedule-day-header');
406-
dayHeaders.forEach(header => {
407-
header.addEventListener('click', function() {
408-
this.classList.toggle('active');
409-
const content = this.nextElementSibling;
410-
content.classList.toggle('show');
411-
const icon = this.querySelector('.expand-icon');
412-
icon.textContent = icon.textContent === '' ? '' : '';
404+
const dayHeaders = document.querySelectorAll('.schedule-day-header');
405+
406+
dayHeaders.forEach(header => {
407+
header.addEventListener('click', function() {
408+
this.classList.toggle('active');
409+
const content = this.nextElementSibling;
410+
content.classList.toggle('show');
411+
const icon = this.querySelector('.expand-icon');
412+
icon.textContent = icon.textContent === '' ? '' : '';
413+
});
414+
});
415+
});
416+
document.addEventListener('DOMContentLoaded', function() {
417+
const speakerCards = document.querySelectorAll('.custom-card');
418+
419+
speakerCards.forEach(card => {
420+
card.addEventListener('click', function() {
421+
const speakerId = this.dataset.speakerId;
422+
423+
// Remove active state from all cards
424+
speakerCards.forEach(c => c.classList.remove('active'));
425+
426+
// Hide all speaker details
427+
document.querySelectorAll('.speaker-details').forEach(detail => {
428+
detail.classList.remove('show');
429+
});
430+
431+
// Show selected speaker details
432+
const speakerDetails = document.getElementById(`speaker-details-${speakerId}`);
433+
if (speakerDetails) {
434+
this.classList.add('active');
435+
speakerDetails.classList.add('show');
436+
speakerDetails.scrollIntoView({ behavior: 'smooth', block: 'nearest' });
437+
}
413438
});
414439
});
415-
416-
// Speaker link functionality
417-
document.addEventListener('click', function(e) {
418-
if (e.target.classList.contains('speaker-link')) {
440+
});
441+
document.addEventListener('DOMContentLoaded', function() {
442+
const speakerLinks = document.querySelectorAll('.speaker-link');
443+
444+
speakerLinks.forEach(link => {
445+
link.addEventListener('click', function(e) {
419446
e.preventDefault();
420-
const speakerId = e.target.dataset.speakerId;
447+
const speakerId = this.dataset.speakerId;
421448

422-
// Reset all cards and details
449+
// Remove active state from all cards
423450
document.querySelectorAll('.custom-card').forEach(card => {
424451
card.classList.remove('active');
425452
});
453+
454+
// Hide all speaker details
426455
document.querySelectorAll('.speaker-details').forEach(detail => {
427456
detail.classList.remove('show');
428457
});
429458

430-
// Activate clicked speaker's card and details
459+
// Show selected speaker details
431460
const speakerCard = document.querySelector(`.custom-card[data-speaker-id="${speakerId}"]`);
432461
const speakerDetails = document.getElementById(`speaker-details-${speakerId}`);
433462

434463
if (speakerCard && speakerDetails) {
435464
speakerCard.classList.add('active');
436465
speakerDetails.classList.add('show');
437-
// Scroll to speaker section
438-
document.querySelector('.speaker-cards').scrollIntoView({ behavior: 'smooth', block: 'start' });
466+
speakerDetails.scrollIntoView({ behavior: 'smooth', block: 'nearest' });
439467
}
440-
}
468+
});
441469
});
442470
});
443471
</script>

0 commit comments

Comments
 (0)