Skip to content

Commit 932a10b

Browse files
committed
Update full view for all schedule layouts.
1 parent a67f689 commit 932a10b

File tree

3 files changed

+46
-47
lines changed

3 files changed

+46
-47
lines changed

src/layouts/ScheduleLayout.astro

Lines changed: 46 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -80,3 +80,49 @@ const { title, description } = Astro.props;
8080
}
8181
}
8282
</style>
83+
84+
<style is:global>
85+
.layout-wrapper2 {
86+
transition: transform 0.3s ease;
87+
transform-origitalk/n: center center;
88+
}
89+
90+
.layout-wrapper2.scaled-up {
91+
position: absolute;
92+
background-color: #F5E5D7;
93+
height:100vh;
94+
width:100vw;
95+
padding:50px;
96+
}
97+
</style>
98+
99+
<script is:inline>
100+
const days = document.querySelectorAll('.day');
101+
const wrapper = document.querySelector('.layout-wrapper2');
102+
103+
days.forEach((day) => {
104+
let btn = day.querySelector('.maximize-btn');
105+
btn.addEventListener('click', () => {
106+
wrapper.classList.toggle('scaled-up');
107+
btn.textContent = wrapper.classList.contains('scaled-up') ? 'Normal View' : 'Full View';
108+
109+
const h3 = day.querySelector('h3');
110+
111+
if (h3 && h3.tagName === 'H3') {
112+
const anchor = h3.querySelector('a[href^="#"]');
113+
114+
if (anchor) {
115+
const targetId = anchor.getAttribute('href').substring(1); // remove '#'
116+
const targetElement = document.getElementById(targetId);
117+
118+
if (targetElement) {
119+
targetElement.scrollIntoView({behavior: "smooth"});
120+
121+
}
122+
}
123+
}
124+
});
125+
126+
127+
});
128+
</script>

src/pages/schedule.astro

Lines changed: 0 additions & 47 deletions
Original file line numberDiff line numberDiff line change
@@ -30,50 +30,3 @@ const allDays = Array.from(
3030
))
3131
}
3232
</Layout>
33-
34-
<style is:global>
35-
.layout-wrapper2 {
36-
transition: transform 0.3s ease;
37-
transform-origin: center center;
38-
}
39-
40-
.layout-wrapper2.scaled-up {
41-
position: absolute;
42-
background-color: #F5E5D7;
43-
height:100vh;
44-
width:100vw;
45-
padding:50px;
46-
}
47-
</style>
48-
49-
50-
<script is:inline>
51-
const days = document.querySelectorAll('.day');
52-
const wrapper = document.querySelector('.layout-wrapper2');
53-
54-
days.forEach((day) => {
55-
let btn = day.querySelector('.maximize-btn');
56-
btn.addEventListener('click', () => {
57-
wrapper.classList.toggle('scaled-up');
58-
btn.textContent = wrapper.classList.contains('scaled-up') ? 'Normal View' : 'Full View';
59-
60-
const h3 = day.querySelector('h3');
61-
62-
if (h3 && h3.tagName === 'H3') {
63-
const anchor = h3.querySelector('a[href^="#"]');
64-
65-
if (anchor) {
66-
const targetId = anchor.getAttribute('href').substring(1); // remove '#'
67-
const targetElement = document.getElementById(targetId);
68-
69-
if (targetElement) {
70-
targetElement.scrollIntoView();
71-
72-
}
73-
}
74-
}
75-
});
76-
77-
78-
});
79-
</script>
File renamed without changes.

0 commit comments

Comments
 (0)