Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Schedule & live #521

Merged
merged 9 commits into from
Apr 6, 2024
4 changes: 2 additions & 2 deletions src/components/AppHeader.vue
Original file line number Diff line number Diff line change
Expand Up @@ -80,8 +80,8 @@ const isActive = (page: string): boolean => {
Home</RouterLink
>
</li>
<li :class="{ selected: isActive('/live') }">
<RouterLink to="/live" @click="closeAsideMenu"
<li :class="{ selected: isActive('/schedule') }">
<RouterLink to="/schedule" @click="closeAsideMenu"
><FontAwesomeIcon
icon="calendar-days"
size="sm"
Expand Down
22 changes: 22 additions & 0 deletions src/components/Countdown.vue
Original file line number Diff line number Diff line change
Expand Up @@ -161,4 +161,26 @@ const handleClick = (): void => {
border-radius: 100%;
}
}

@media (max-width: 720px) {
.countdown {
&--fullscreen {
top: 40px;
left: 59vw;
width: 33.333vw;
height: 33.333vw;
}

&--fullscreen &__time {
font-size: 6vw;
}
}

.countdown__bg {
top: auto;
right: auto;
bottom: auto;
left: auto;
}
}
</style>
118 changes: 57 additions & 61 deletions src/views/Live.vue → src/components/LiveView.vue
Original file line number Diff line number Diff line change
Expand Up @@ -82,13 +82,18 @@ const events = computed<(TimelineEventItem | TimelineEventTitle)[]>(() => {
eventIndex < day.events.length
) {
const event = day.events[eventIndex]
let haveEnd = true
if (event.start === event.end) {
haveEnd = false
}

hourEvents.push({
type: 'event',
id: event.id,
startTmsp: i,
endTmsp,
startHour: formatDate('time', event.start),
endHour: formatDate('time', event.end),
endHour: haveEnd ? formatDate('time', event.end) : '',
title: event.title,
isSubscribed: notificationsStore.subscriptions.includes(event.id),
})
Expand Down Expand Up @@ -116,51 +121,53 @@ const events = computed<(TimelineEventItem | TimelineEventTitle)[]>(() => {
</script>

<template>
<div id="live" class="container-live">
<div
class="events-fancy"
:class="{ 'events-fancy--fullscreen': fullscreen }"
>
<ul>
<template v-for="event in events">
<li
v-if="event.type === 'title'"
:key="`${event.title}-${event.startTmsp}`"
>
<h1>{{ event.title }}</h1>
</li>
<li
v-else-if="event.type === 'item'"
:key="`${event.startTmsp}`"
:class="{ happening: event.isHappening }"
>
<ArrowNarrowRightIcon
v-if="event.isHappening"
class="event__arrow"
/>
<div
v-for="hourEvent in event.hourEvents"
:key="hourEvent.id"
class="event"
:class="{ subscribed: hourEvent.isSubscribed }"
:data-event-id="hourEvent.id"
@click="notificationsStore.toggleSubscription(hourEvent.id)"
<div>
<div class="container-live">
<div
class="events-fancy"
:class="{ 'events-fancy--fullscreen': fullscreen }"
>
<ul>
<template v-for="event in events">
<li
v-if="event.type === 'title'"
:key="`${event.title}-${event.startTmsp}`"
>
<div class="event__hour">
<div>{{ hourEvent.startHour }}</div>
<div class="event__end-hour">{{ hourEvent.endHour }}</div>
</div>
<div class="title">
{{ hourEvent.title }}
<VolumeOffIcon
v-if="!hourEvent.isSubscribed"
class="event__subscribed-icon"
/>
<h1>{{ event.title }}</h1>
</li>
<li
v-else-if="event.type === 'item'"
:key="`${event.startTmsp}`"
:class="{ happening: event.isHappening }"
>
<ArrowNarrowRightIcon
v-if="event.isHappening"
class="event__arrow"
/>
<div
v-for="hourEvent in event.hourEvents"
:key="hourEvent.id"
class="event"
:class="{ subscribed: hourEvent.isSubscribed }"
:data-event-id="hourEvent.id"
@click="notificationsStore.toggleSubscription(hourEvent.id)"
>
<div class="event__hour">
<div>{{ hourEvent.startHour }}</div>
<div class="event__end-hour">{{ hourEvent.endHour }}</div>
</div>
<div class="title">
{{ hourEvent.title }}
<VolumeOffIcon
v-if="!hourEvent.isSubscribed"
class="event__subscribed-icon"
/>
</div>
</div>
</div>
</li>
</template>
</ul>
</li>
</template>
</ul>
</div>
</div>
</div>
</template>
Expand All @@ -175,7 +182,7 @@ const events = computed<(TimelineEventItem | TimelineEventTitle)[]>(() => {
}

.event {
margin: 5px 0;
margin: 16px 0;
cursor: url('../assets/img/rocket-fire.png'), auto;
user-select: none;

Expand All @@ -185,6 +192,7 @@ const events = computed<(TimelineEventItem | TimelineEventTitle)[]>(() => {
height: 2.5rem;
margin-top: -0.25em;
margin-right: 0.5em;
color: $secondary-color;
}

&__subscribed-icon {
Expand All @@ -200,6 +208,7 @@ const events = computed<(TimelineEventItem | TimelineEventTitle)[]>(() => {
margin-right: 10px;
font-size: 15px;
font-weight: bold;
gap: 8px;
text-align: right;

&__end-hour {
Expand Down Expand Up @@ -230,32 +239,17 @@ const events = computed<(TimelineEventItem | TimelineEventTitle)[]>(() => {
-webkit-overflow-scrolling: touch;
text-align: left;

&::before {
position: fixed;
z-index: 10;
top: 39px;
right: 0;
left: 0;
height: 100px;
background-image: linear-gradient($bg-color, transparent);
content: '';
pointer-events: none;
}

ul {
min-height: 200px;
max-height: 100%;
box-sizing: content-box;
padding-top: 25px;
padding-right: 25px;
padding-left: 25px;
margin-top: 175px;
margin-right: 75px;
margin-left: 75px;
background-color: #ffffff75;
border-radius: 25px;
list-style: none;
overflow-y: none;
}

li {
Expand All @@ -272,6 +266,8 @@ const events = computed<(TimelineEventItem | TimelineEventTitle)[]>(() => {

> div {
display: flex;
align-items: center;
gap: 16px;
}
}

Expand All @@ -293,7 +289,7 @@ const events = computed<(TimelineEventItem | TimelineEventTitle)[]>(() => {
width: 100%;
height: 100%;
max-height: 100%;
margin-left: 40%;
margin-left: 48%;
}

li {
Expand Down
2 changes: 1 addition & 1 deletion src/components/PanelContainer.vue
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ defineProps<Props>()
max-width: 1300px;
flex-wrap: wrap;
justify-content: center;
padding: 150px 16px 50px;
padding: 140px 60px 50px;
margin: 0 auto;

@media (max-width: 720px) {
Expand Down
Loading
Loading