Skip to content

Commit 46f324d

Browse files
authored
Merge pull request #41 from Monster0506/master
Improved contact form
2 parents 953ade2 + 985f5e7 commit 46f324d

File tree

2 files changed

+46
-4
lines changed

2 files changed

+46
-4
lines changed

src/components/MeetingCard.vue

Lines changed: 46 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,8 @@
11
<template>
2-
<div class="event-container" :style="background ? {background} : {}">
2+
<div class="event-container" :class="{ 'future-meeting': isFutureMeeting, 'past-meeting': isPastMeeting }" :style="background ? {background} : {}">
3+
<div class="meeting-status" v-if="isFutureMeeting || isPastMeeting">
4+
{{ isFutureMeeting ? 'Upcoming' : 'Past Meeting' }}
5+
</div>
36
<div class="cover-photo" v-if="event.photo" :style="{backgroundImage: `url(${event.photo})`}" />
47
<div class="event">
58
<component class="event-title" :is="event.link ? 'a' : 'span'" :href="event.link" target="_blank" style="color:white">
@@ -23,12 +26,18 @@
2326
</template>
2427

2528
<script setup>
26-
defineProps(["event", "solo", "background"]);
29+
const props = defineProps(["event", "solo", "background"]);
2730
2831
const formatDate = (dateString) => {
2932
return new Date(dateString + "T19:00:00") // that day at 7pm
3033
.toLocaleDateString("en-us", {month: "long", day: "numeric", year: "numeric"});
3134
}
35+
36+
const currentDate = new Date();
37+
const meetingDate = new Date(props.event.date + "T19:00:00");
38+
39+
const isPastMeeting = meetingDate < currentDate;
40+
const isFutureMeeting = meetingDate > currentDate;
3241
</script>
3342

3443
<style scoped lang="scss">
@@ -40,6 +49,7 @@ const formatDate = (dateString) => {
4049
flex-direction: column;
4150
justify-content: center;
4251
margin: 0 auto 80px auto;
52+
position: relative;
4353
&:first-of-type {
4454
margin-top: 50px;
4555
}
@@ -55,6 +65,7 @@ const formatDate = (dateString) => {
5565
min-height: 0;
5666
flex-shrink: 1;
5767
}
68+
5869
.event {
5970
&>* {
6071
padding: 0 24px;
@@ -78,18 +89,21 @@ const formatDate = (dateString) => {
7889
margin: 0;
7990
}
8091
}
92+
8193
.cover-photo {
8294
width: 100%;
8395
padding-bottom: 40%;
8496
background-size: cover;
8597
background-position: center;
8698
}
99+
87100
.event-title {
88101
margin: 12px 0 8px;
89102
// text-decoration: none;
90103
display: flex;
91104
align-items: center;
92105
}
106+
93107
.event-text {
94108
scrollbar-width: thin;
95109
&::-webkit-scrollbar {
@@ -100,6 +114,7 @@ const formatDate = (dateString) => {
100114
min-height: 0;
101115
flex-shrink: 1;
102116
}
117+
103118
.event-footer {
104119
display:flex;
105120
justify-content: space-between;
@@ -109,10 +124,39 @@ const formatDate = (dateString) => {
109124
margin: 2px -4px;
110125
}
111126
}
127+
112128
.external-link {
113129
margin-right: 10px;
114130
}
131+
115132
strong {
116133
font-weight: 600;
117134
}
135+
136+
.meeting-status {
137+
position: absolute;
138+
top: 10px;
139+
right: 10px;
140+
background-color: rgba(0, 0, 0, 0.6);
141+
color: white;
142+
padding: 4px 12px;
143+
border-radius: 20px;
144+
font-size: 0.85rem;
145+
font-weight: 500;
146+
z-index: 1;
147+
}
148+
149+
.future-meeting {
150+
border: 2px solid #2ecc71;
151+
.meeting-status {
152+
background-color: #2ecc71;
153+
}
154+
}
155+
156+
.past-meeting {
157+
opacity: 0.8;
158+
.meeting-status {
159+
background-color: rgba(0, 0, 0, 0.4);
160+
}
161+
}
118162
</style>

src/views/Meetings.vue

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -91,8 +91,6 @@ const groupedEvents = computed(() => {
9191
9292
// reverse the order of events within each group to make them
9393
// forward-chronological within each semester
94-
// result.forEach(value => value.reverse());
95-
// I like reverse chronological order more :-) -Brandon
9694
9795
return result;
9896
});

0 commit comments

Comments
 (0)