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 " >
2326</template >
2427
2528<script setup>
26- defineProps ([" event" , " solo" , " background" ]);
29+ const props = defineProps ([" event" , " solo" , " background" ]);
2730
2831const 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+
115132strong {
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 >
0 commit comments