Skip to content

Commit 37c78dd

Browse files
author
Jason Bazalar
committed
Styled upcoming events with date cards and added name of venue
1 parent dc49915 commit 37c78dd

File tree

2 files changed

+70
-7
lines changed

2 files changed

+70
-7
lines changed

custom.js

Lines changed: 13 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -56,6 +56,7 @@
5656
*/
5757
function getFormattedMeetups(meetups) {
5858
var formattedMeetups = [];
59+
5960
// For each event create a list item
6061
meetups.filter( function( meetup, index) {
6162
// Setup event date info
@@ -64,16 +65,23 @@
6465
d.months = ['Jan', 'Feb', 'Mar', 'Apr', 'May', 'Jun', 'Jul', 'Aug', 'Sep', 'Oct', 'Nov', 'Dec'];
6566
d.month = d.months[d.date.getMonth()];
6667
d.d = d.date.getDate();
68+
d.wkdys = ['Mon','Tue','Wed','Thu','Fri','Sat','Sun'];
69+
d.dow = d.wkdys[ d.date.getDay() ];
6770
d.day = (d.d > 9)? d.d : "0"+d.d;
6871
d.time = formatAMPM( d.date );
6972

7073
// Formant and add current event to list
7174
formattedMeetups.push(
72-
'<li>'
73-
+ d.month + ' ' + d.day
74-
+ ' (' + d.time+ ') - '
75-
+ meetup.venue.city + ': '
76-
+'<a href="'+meetup.event_url+'">'+meetup.name+'</a>'
75+
'<li class="meetup">'
76+
+ '<div class="datebox">'
77+
+ ' <div class="dow">' + d.dow + '</div>'
78+
+ ' <div class="date">' + d.month + ' ' + d.day + '</div>'
79+
+ ' <div class="time">' + d.time + '</div>'
80+
+ '</div>'
81+
+ '<div class="infobox">'
82+
+ ' <div class="title"><a href="' + meetup.event_url + '">' + meetup.name + '</a></div>'
83+
+ ' <div class="city">' + meetup.venue.city + ' - ' + meetup.venue.name + '</div>'
84+
+ '</div>'
7785
+'</li>'
7886
);
7987
});

style.css

Lines changed: 57 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -67,6 +67,49 @@ section {
6767
}
6868

6969
/** UPCOMING EVENTS **/
70+
.meetups {
71+
list-style: none;
72+
padding-left: 0px;
73+
}
74+
75+
.meetup {
76+
display: grid;
77+
grid-template-columns: 9% repeat(6, 10%);
78+
margin-bottom: 0.4rem;
79+
}
80+
81+
.datebox {
82+
display: table-cell;
83+
border: 1px solid #b74949;
84+
margin-right: 5px;
85+
font-size: 13px;
86+
border-radius: 5px;
87+
text-align: center;
88+
line-height: 1.3;
89+
}
90+
.datebox .dow {
91+
background-color: rgba(183, 73, 73, 0.30);
92+
padding: 3px 3px 1px 0px;
93+
text-transform: uppercase;
94+
font-weight: 600;
95+
}
96+
.datebox .date {
97+
padding: 3px 3px 0 3px;
98+
}
99+
.datebox .time {
100+
padding: 0 3px 2px;
101+
}
102+
103+
.infobox {
104+
padding-left: 10px;
105+
grid-column-start: 2;
106+
grid-column-end: 10;
107+
}
108+
.infobox .city {
109+
font-style: italic;
110+
font-size: 16px;
111+
}
112+
70113
.load-more {
71114
display: flex;
72115
list-style: none;
@@ -77,7 +120,6 @@ section {
77120
margin: 0 auto;
78121
border: 1px solid #b74949;
79122
padding: 10px;
80-
font-size: 1em;
81123
text-decoration: none;
82124
}
83125
.load-more a:hover {
@@ -102,5 +144,18 @@ section {
102144
ul.meetups li a {
103145
display: block;
104146
}
105-
147+
148+
.datebox {
149+
grid-column-start: 1;
150+
grid-column-end: 3;
151+
}
152+
.infobox {
153+
grid-column-start: 3;
154+
grid-column-end: 10;
155+
}
156+
157+
.load-more a {
158+
font-size: 2em;
159+
padding: 10px 25px;
160+
}
106161
}

0 commit comments

Comments
 (0)