Skip to content

Commit 97a3b40

Browse files
Finished styling upcoming events. Made columns equal height.
Added auto feed for event sponsors in upcoming event. Need to refactor this and footer into one include file accepting arguments.
1 parent c0b49f5 commit 97a3b40

File tree

2 files changed

+61
-89
lines changed

2 files changed

+61
-89
lines changed

_sass/style.scss

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -297,10 +297,10 @@ a {
297297
}
298298

299299
.upcoming__col {
300-
margin-top: 1em;
301300
background: rgba(0, 0, 0, 0.7);
302301
border-radius: 5px;
303-
box-shadow: black 5px 5px 5px 0;
302+
border: #000000 2px ridge;
303+
box-shadow: rgba(0, 0, 0, 0.76) 5px 5px 5px 0;
304304
}
305305

306306
@media (min-width: 768px) {
@@ -333,24 +333,26 @@ a {
333333
.upcoming__img-container {
334334
background-size: cover;
335335
background-position: center center;
336-
border-radius: 20px 5px 20px 5px;
336+
border-radius: 20px;
337337
border-top: #A55605 3px solid;
338338
border-bottom: #A55605 3px solid;
339339
min-height: 50vh;
340340
}
341341

342-
@media (min-width: 768px) {
343-
min-height: 60vh;
342+
.upcoming__content {
343+
margin-top: 5.5%;
344344
}
345345

346346
.upcoming__logo-col {
347347
padding-right: 0;
348348
padding-left: 0;
349-
flex: 1;
349+
margin-top: 1em;
350+
box-shadow: rgba(0, 0, 0, 0.76) 5px 5px 5px 0;
350351
}
351352

352353
@media (min-width: 768px) {
353354
.upcoming__logo-col {
355+
margin-top: 0;
354356
margin-right: 5.5%;
355357
}
356358
}
@@ -366,27 +368,25 @@ a {
366368
.upcoming__sponsor-list {
367369
background: rgba(7, 41, 72, 0.7);
368370
border: #072948 2px ridge;
369-
margin-top: 1em;
370371
border-radius: 5px;
371-
box-shadow: rgba(0, 0, 0, 0.76) 5px 5px 5px 0;
372372
}
373373

374374
.upcoming__sponsor-title {
375375
color: antiquewhite;
376376
font-family: 'Encode Sans Expanded', sans-serif;
377377
font-size: 2.5em;
378-
margin-top: 2.5%;
378+
padding-top: 2.5%;
379379
margin-bottom: 2.5%;
380380
}
381381

382382
.upcoming__button-row {
383383
margin-top: 10%;
384-
margin-bottom: 5%;
384+
margin-bottom: 5.5%;
385385
}
386386

387387
@media (min-width: 768px) {
388388
.upcoming__button-row {
389-
margin-top: 5%;
389+
margin-top: 5.5%;
390390
}
391391
}
392392

@@ -656,7 +656,7 @@ a {
656656
display: inline-block;
657657
line-height: 102px;
658658
vertical-align: middle;
659-
margin: 1%;
659+
margin: 0.5em 1% 0.5em 1%;
660660
width: 75%;
661661
height: 102px;
662662
&:hover > .footer__img {

index.html

Lines changed: 49 additions & 77 deletions
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,7 @@ <h3 class="mission__statement">Provide mentorship and challenge for people of al
5252
<div class="row container-fluid">
5353
<hr class="upcoming-divider">
5454
<div class="upcoming__img-container col-md-12">
55-
<div class="row">
55+
<div class="upcoming__content row">
5656
<div class="upcoming__col col-md-5 col-12 mr-auto">
5757
<h2 class="upcoming__title">Upcoming Event</h2>
5858
<div class="row">
@@ -102,83 +102,55 @@ <h2 class="post__label">Project</h2>
102102
{% endif %}
103103
</div>
104104
<div class="upcoming__logo-col col-md-5 text-center">
105-
<div class="upcoming__sponsor-list">
105+
<div class="upcoming__sponsor-list h-100">
106106
<h2 class="upcoming__sponsor-title">Supported By</h2>
107-
108-
109-
{% comment %}
110-
Assume number of sponsors is even. We are going to create rows of 2 sponsors in each.
111-
If not even the last row must contain 1 sponsor and be terminated with appropriate tags.
112-
{% endcomment %}
113-
114-
{% assign sponsors = "" | split: ',' %}
115-
{% for sponsor in site.sponsors %}
116-
<!--HEre select item that maches the sponsor_id - the object
117-
instead of just the string sponsor name.-->
118-
{% assign sponsors = sponsors | push: sponsor %}
119-
{% endfor %}
120-
{% assign num_of_sponsors = sponsors | size %}
121-
{% assign sponsors_remainder = num_of_sponsors | modulo: 2 %}
122-
123-
{% if sponsors_remainder == 0 %}
124-
{% assign num_of_sponsors_even = true %}
125-
{% assign row_num_modifier = 1 %}
126-
{% else %}
127-
{% assign num_of_sponsors_even = false %}
128-
{% assign row_num_modifier = 0 %}
129-
{% endif %}
130-
131-
{% assign num_of_rows = num_of_sponsors | divided_by: 2 | floor | minus: row_num_modifier %}
132-
{% assign items_per_row = 1 %}
133-
134-
{% for row in (0..num_of_rows) %}
135-
{% if forloop.last and num_of_sponsors_even == false %}
136-
{% assign items_per_row = 0 %}
137-
{% endif %}
138-
<div class="row">
139-
{% for col in (0..items_per_row) %}
140-
{% assign sponsor_index = row | times: 2 | plus: col %}
141-
{% assign sponsor = sponsors[sponsor_index] %}
142-
<div class="footer__sponsor-col col-md-12 col-lg-6">
143-
<a class="footer__sponsor-link" href="{{ sponsor.sponsor_link }}">
144-
<img class="footer__img" src="{{ site.baseurl }}/{{ sponsor.sponsor_logo }}">
145-
</a>
146-
</div>
147-
{% endfor %}
148-
</div>
149-
{% endfor %}
150-
151-
152-
153-
154-
155-
156-
157-
158-
159-
160-
161-
162-
163-
164-
165-
166-
167-
168-
169-
170-
171-
172-
173-
174-
175-
176-
177-
178-
179-
180-
181-
107+
<!--HERE feed event sponsors only - we need sponsor objects not just the name.-->
108+
<!--Build an array of site sponsors (all).-->
109+
{% assign site_sponsors_all = "" | split: ',' %}
110+
{% for sponsor in site.sponsors %}
111+
{% assign site_sponsors_all = site_sponsors_all | push: sponsor %}
112+
{% endfor %}
113+
114+
<!--Build an array of sponsors for the event.-->
115+
{% assign event_sponsors = "" | split: ',' %}
116+
{% for sponsor in post.sponsors %}
117+
{% for site_sponsor in site_sponsors_all %}
118+
{% if site_sponsor.sponsor_id == sponsor %}
119+
{% assign event_sponsors = event_sponsors | push: site_sponsor %}
120+
{% endif %}
121+
{% endfor %}
122+
{% endfor %}
123+
124+
{% assign num_of_sponsors = event_sponsors | size %}
125+
{% assign sponsors_remainder = num_of_sponsors | modulo: 2 %}
126+
127+
{% if sponsors_remainder == 0 %}
128+
{% assign num_of_sponsors_even = true %}
129+
{% assign row_num_modifier = 1 %}
130+
{% else %}
131+
{% assign num_of_sponsors_even = false %}
132+
{% assign row_num_modifier = 0 %}
133+
{% endif %}
134+
135+
{% assign num_of_rows = num_of_sponsors | divided_by: 2 | floor | minus: row_num_modifier %}
136+
{% assign items_per_row = 1 %}
137+
138+
{% for row in (0..num_of_rows) %}
139+
{% if forloop.last and num_of_sponsors_even == false %}
140+
{% assign items_per_row = 0 %}
141+
{% endif %}
142+
<div class="row">
143+
{% for col in (0..items_per_row) %}
144+
{% assign sponsor_index = row | times: 2 | plus: col %}
145+
{% assign sponsor = event_sponsors[sponsor_index] %}
146+
<div class="footer__sponsor-col col-md-12 col-lg-6">
147+
<a class="footer__sponsor-link" href="{{ sponsor.sponsor_link }}">
148+
<img class="footer__img" src="{{ site.baseurl }}/{{ sponsor.sponsor_logo }}">
149+
</a>
150+
</div>
151+
{% endfor %}
152+
</div>
153+
{% endfor %}
182154
</div>
183155
</div>
184156
</div>

0 commit comments

Comments
 (0)