Skip to content

Commit a67f689

Browse files
committed
Full view for schedule.
1 parent b436e01 commit a67f689

File tree

4 files changed

+107
-12
lines changed

4 files changed

+107
-12
lines changed

src/components/schedule/day.astro

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@ import Session from "@components/schedule/session.astro";
66
import { addMinutes, differenceInMinutes, parseISO } from "date-fns";
77
//import { Title } from "@components/typography/title";
88
import Headline from "@components/ui/Headline.astro";
9+
import Button from "@ui/Button.astro";
910
import { Select } from "@components/form/select";
1011
import { formatInTimeZone } from "date-fns-tz";
1112

@@ -335,6 +336,7 @@ const dateText = format(date, "eeee - do MMMM");
335336

336337
<div class="h-12"></div>
337338

339+
<Button class="maximize-btn invisible" clear>Full view</Button>
338340
<div class="schedule-wrapper">
339341
<header class="schedule-container header">
340342
<div
@@ -544,10 +546,6 @@ const dateText = format(date, "eeee - do MMMM");
544546
}
545547

546548
.schedule {
547-
--header-height: 30px;
548-
--break: 8px;
549-
--lunch: 8px;
550-
--minute: 4px;
551549
--room-change: calc(var(--minute) * 8);
552550
--5min: calc(var(--minute) * 5);
553551

src/layouts/ScheduleLayout.astro

Lines changed: 56 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -19,15 +19,64 @@ const { title, description } = Astro.props;
1919
</Layout>
2020

2121
<style is:global>
22-
.layout-wrapper2 {
23-
max-width: 800px;
24-
margin:auto;
25-
display: grid;
26-
grid-template-columns: 1fr (770px, 100%) 1fr !important;
27-
}
28-
2922
.layout-wrapper2 > * {
3023
grid-column: 2;
3124
}
3225

26+
@media screen and (max-width: 1280px) {
27+
.layout-wrapper2 {
28+
max-width: 800px;
29+
margin:auto;
30+
display: grid;
31+
grid-template-columns: 1fr (770px, 100%) 1fr !important;
32+
}
33+
}
34+
35+
36+
@media screen and (min-width: 1281px) {
37+
.layout-wrapper2 {
38+
/*max-width: 1100px;*/
39+
max-width: auto !important;
40+
grid-template-columns: 1fr (1070px, 100%) 1fr !important;
41+
}
42+
43+
.layout-wrapper2 .schedule *{
44+
font-size:1.2rem;
45+
--header-height: 40px !important;
46+
--break: 10px !important;
47+
}
48+
49+
.layout-wrapper2 {
50+
h2, .break {
51+
font-size:1.2rem;
52+
}
53+
}
54+
}
55+
56+
57+
/*@media screen and (min-width: 1601px) {*/
58+
/*.layout-wrapper2 {*/
59+
/* max-width: auto !important;*/
60+
/* grid-template-columns: 1fr (1170px, 100%) 1fr !important;*/
61+
/*}*/
62+
/**/
63+
64+
@media screen and (min-width: 1201px) {
65+
66+
.layout-wrapper2.scaled-up .schedule *{
67+
font-size:1.4rem;
68+
--header-height: 60px !important;
69+
--break: 14px !important;
70+
}
71+
.layout-wrapper2.scaled-up {
72+
h2, .break {
73+
font-size:1.4rem;
74+
}
75+
}
76+
}
77+
@media screen and (min-width: 1601px) {
78+
.maximize-btn {
79+
visibility:initial;
80+
}
81+
}
3382
</style>

src/pages/schedule.astro

Lines changed: 48 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@ import { getEntry, getCollection } from "astro:content";
33
import Layout from "@layouts/ScheduleLayout.astro";
44
import ScheduleDay from "@components/schedule/day.astro";
55
import Headline from "@ui/Headline.astro";
6+
import Button from "@ui/Button.astro";
67
78
export const getStaticPaths = async () => {
89
const days = await getCollection("days");
@@ -29,3 +30,50 @@ const allDays = Array.from(
2930
))
3031
}
3132
</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>

src/pages/schedule/talks.astro

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ import { getCollection } from "astro:content";
33
import Layout from "@layouts/ScheduleLayout.astro";
44
import ScheduleDay from "@components/schedule/day.astro";
55
import { slugify } from '@utils/content';
6-
import Headline from "@ui/Headline.astro"
6+
import Headline from "@ui/Headline.astro";
77
88
export const getStaticPaths = async () => {
99
const sessions = await getCollection("sessions");

0 commit comments

Comments
 (0)