Skip to content
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.

Commit d79f563

Browse files
committedMar 4, 2018
Merge branch 'make_universal_responsive_background_images'
2 parents 3179e00 + 704356e commit d79f563

19 files changed

+84
-41
lines changed
 

‎_layouts/post.html

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -89,7 +89,9 @@ <h1 class="post__content-title">Event's sponsors</h1>
8989
<div class="post__logo-col col-sm-3 col-12">
9090
<h3 class="post__sponsor-name">{{ sponsor_obj.sponsor_name }}</h3>
9191
<a class="post__sponsor-container post__sponsor-link" href="{{ sponsor_obj.sponsor_link }}">
92-
<img class="post__sponsor-img" src="{{ site.baseurl }}/{{ sponsor_obj.sponsor_logo }}">
92+
<img class="post__sponsor-img"
93+
src="{{ site.baseurl }}/{{ sponsor_obj.sponsor_logo }}"
94+
alt="Sponsor logo">
9395
</a>
9496
</div >
9597
<div class="post__sponsor-info-col col-12 col-sm-auto col-xl-7 ">

‎_pages/03_events.html

Lines changed: 18 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -3,27 +3,31 @@
33
title: Events
44
permalink: /events/
55
---
6-
7-
<style>
8-
.events-page__background-img {
9-
background-size: contain;
10-
background: linear-gradient(90deg,
11-
rgba(0, 0, 0, 0.75),
12-
rgba(0, 0, 0, 0.75)),
13-
url("{{ site.baseurl }}/static/images/contact/contact_top_1920x600px.jpg") top center no-repeat;
14-
}
15-
</style>
16-
17-
186
<section class="events-page">
19-
<div class="events-page__background-img">
7+
<div class="events-page__background-img" data-image-type="responsive">
8+
<picture>
9+
<source srcset="../static/images/events_page/events_page_top_480x150px.jpg 480w,
10+
../static/images/events_page/events_page_top_960x300px.jpg 960w,
11+
../static/images/events_page/events_page_top_1920x600px.jpg 1920w"
12+
media="(orientation: landscape)"
13+
sizes="100vw">
14+
<source srcset="../static/images/events_page/events_page_top_750x650px.jpg 750w,
15+
../static/images/events_page/events_page_top_1650x1100px.jpg 1650w"
16+
media="(orientation: portrait)"
17+
sizes="100vw">
18+
<img class="responsive"
19+
src="../static/images/events_page/events_page_top_960x300px.jpg"
20+
alt="Events"
21+
data-overlay="linear-gradient(180deg, rgba(0, 0, 0, 0.65) 0%, rgba(0, 0, 0, 0.65) 100%)">
22+
</picture>
2023
<div class="row container-fluid">
2124
<div class="col-sm-12">
2225
<h2 class="events-page__page-title">Events</h2>
23-
<h3 class="events-page__page-subtitle">See what's coming up. Check what we did recently.</h3>
26+
<h3 class="events-page__page-subtitle">See what's coming up and what we did recently.</h3>
2427
</div>
2528
</div>
2629
</div>
30+
2731
<!--Contact form-->
2832
<form class="contact__form container" method="POST" action="//formspree.io/py.sprints@gmail.com" role="form">
2933
<div class="row">

‎_pages/04_contact.html

Lines changed: 17 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -3,27 +3,31 @@
33
title: Contact
44
permalink: /contact/
55
---
6-
7-
<style>
8-
.contact__background-img {
9-
background-size: contain;
10-
background: linear-gradient(90deg,
11-
rgba(0, 0, 0, 0.75),
12-
rgba(0, 0, 0, 0.75)),
13-
url("{{ site.baseurl }}/static/images/contact/contact_top_1920x600px.jpg") top center no-repeat;
14-
}
15-
</style>
16-
17-
186
<section class="contact">
19-
<div class="contact__background-img">
7+
<div class="contact__background-img" data-image-type="responsive">
8+
<picture>
9+
<source srcset="../static/images/contact/contact_top_450x150px.jpg 450w,
10+
../static/images/contact/contact_top_960x300px.jpg 960w,
11+
../static/images/contact/contact_top_1920x600px.jpg 1920w"
12+
media="(orientation: landscape)"
13+
sizes="100vw">
14+
<source srcset="../static/images/contact/contact_top_750x650px.jpg 750w,
15+
../static/images/contact/contact_top_1650x1100px.jpg 1650w"
16+
media="(orientation: portrait)"
17+
sizes="100vw">
18+
<img class="responsive"
19+
src="../static/images/contact/contact_top_960x300px.jpg"
20+
alt="Contact Us"
21+
data-overlay="linear-gradient(180deg, rgba(0, 0, 0, 0.75) 0%, rgba(0, 0, 0, 0.75) 100%)">
22+
</picture>
2023
<div class="row container-fluid">
2124
<div class="col-sm-12">
2225
<h2 class="contact__page-title">Contact Us</h2>
2326
<h3 class="contact__page-subtitle">Got an idea? Can you or your company support us? Let us know.</h3>
2427
</div>
2528
</div>
2629
</div>
30+
2731
<!--Contact form-->
2832
<form class="contact__form container" method="POST" action="//formspree.io/py.sprints@gmail.com" role="form">
2933
<div class="row">

‎_sass/contact.scss

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,12 @@
2222
@extend .page-subtitle;
2323
}
2424

25+
@media (max-width: 576px) {
26+
.contact__form {
27+
max-width: 96%;
28+
}
29+
}
30+
2531
.contact__form {
2632
margin-top: 5em;
2733
border-radius: 5px;

‎_sass/style.scss

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -132,7 +132,7 @@ a {
132132
}
133133

134134
.navigation__subtitle {
135-
font-size: 1.16em;
135+
font-size: 1.75em;
136136
font-family: 'Share Tech Mono', monospace;
137137
color: $page-subtitle;
138138
text-align: center;
@@ -145,7 +145,7 @@ a {
145145
margin-top: 40vh;
146146
}
147147
.navigation__subtitle {
148-
font-size: 1.43em;
148+
font-size: 1.9em;
149149
}
150150
}
151151

@@ -155,7 +155,7 @@ a {
155155
margin-top: 40vh;
156156
}
157157
.navigation__subtitle {
158-
font-size: 1.66em;
158+
font-size: 2em;
159159
}
160160
}
161161

@@ -165,7 +165,7 @@ a {
165165
margin-top: 40vh;
166166
}
167167
.navigation__subtitle {
168-
font-size: 2em;
168+
font-size: 2.25em;
169169
}
170170
}
171171

@@ -286,6 +286,7 @@ a {
286286

287287
@media (min-width: 768px) {
288288
.upcoming__col {
289+
margin-top: 0;
289290
margin-left: auto;
290291
margin-right: auto;
291292
}
@@ -298,6 +299,7 @@ a {
298299
font-size: 2.5em;
299300
color: $title-light;
300301
margin-top: 0;
302+
margin-bottom: 0;
301303
padding-top: 0.5em;
302304
padding-bottom: 0.5em;
303305
border-top-left-radius: 20px;
@@ -343,6 +345,7 @@ a {
343345
@media (min-width: 768px) {
344346
.upcoming__button-row {
345347
margin-top: 5.5%;
348+
margin-bottom: 5.5%;
346349
}
347350
}
348351

‎index.html

Lines changed: 18 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -17,17 +17,19 @@
1717
static/images/title_photo/title_glass_building_1080x1920.jpg 1080w,
1818
static/images/title_photo/title_glass_building_1125x2436.jpg 1125w,
1919
static/images/title_photo/title_glass_building_1242x2436.jpg 1242w,
20-
static/images/title_photo/title_glass_building_1442x2562.jpg 1442w,
21-
"
20+
static/images/title_photo/title_glass_building_1442x2562.jpg 1442w"
2221
media="(orientation: portrait)"
2322
sizes="100vw">
24-
<img class="responsive" src="static/images/title_photo/title_glass_building_960x540.jpg" alt="Python Sprints Title Image">
23+
<img class="responsive"
24+
src="static/images/title_photo/title_glass_building_960x540.jpg"
25+
alt="Python Sprints Title Image"
26+
data-overlay="linear-gradient(180deg, rgba(0, 0, 0, 0.45) 0%, rgba(0, 0, 0, 0.8) 100%)">
2527
</picture>
2628

2729
<div class="row">
2830
<div class="col-md-12">
2931
<h1 class="navigation__title">Python Sprints</h1>
30-
<h2 class="navigation__subtitle"><em>The World Is Waiting For Your Code</em></h2>
32+
<h2 class="navigation__subtitle"><em>The World Needs Your Code</em></h2>
3133
</div>
3234
</div>
3335
</div>
@@ -98,7 +100,9 @@ <h2 class="upcoming__event-label">Project</h2>
98100
<div class="row">
99101
<div class="upcoming__event-title col-12 text-center">
100102
<a href="{{ post.project_link }}">
101-
<img class="upcoming__project-logo" src="{{ site.baseurl }}/{{ post.project_logo }}">
103+
<img class="upcoming__project-logo"
104+
src="{{ site.baseurl }}/{{ post.project_logo }}"
105+
alt="Upcoming project logo">
102106
</a>
103107
</div>
104108
</div>
@@ -152,7 +156,9 @@ <h2 class="upcoming__event-label">Sponsors</h2>
152156
{% assign sponsor = event_sponsors[sponsor_index] %}
153157
<div class="footer__sponsor-col col-md-12 col-lg-6">
154158
<a class="footer__sponsor-link" href="{{ sponsor.sponsor_link }}">
155-
<img class="footer__img" src="{{ site.baseurl }}/{{ sponsor.sponsor_logo }}">
159+
<img class="footer__img"
160+
src="{{ site.baseurl }}/{{ sponsor.sponsor_logo }}"
161+
alt="Sponsor logo">
156162
</a>
157163
</div>
158164
{% endfor %}
@@ -196,7 +202,9 @@ <h2 class="services__section-title">What Do We Do?</h2>
196202

197203
<div class="row">
198204
<div class="second-on-mobile no-gutters__col col-md-6">
199-
<img class="services__img img-fluid rounded" src="static/images/services/educating_devs_840x561px.jpg">
205+
<img class="services__img img-fluid rounded"
206+
src="static/images/services/educating_devs_840x561px.jpg"
207+
alt="Educating developers">
200208
</div>
201209
<div class="first-on-mobile no-gutters__col col-md-6">
202210
<h2 class="services__title text-right">Helping Beginners To Get Good</h2>
@@ -212,7 +220,9 @@ <h2 class="services__title text-left">Engaging Core Developers</h2>
212220
<p class="services__content text-left">For those of you who are programming on the advanced level there are always new tasks to test your mettle. We fix bugs, we improve implementations and add features. No matter your style you will be able to find a ticket to your liking. The sprints are always advertised well ahead of the time so you can prepare yourself by checking on the issues that will be worked on early enough.</p>
213221
</div>
214222
<div class="no-gutters__col col-md-6">
215-
<img class="services__img img-fluid rounded" src="static/images/services/advanced_lvl_840x560px.jpg">
223+
<img class="services__img img-fluid rounded"
224+
src="static/images/services/advanced_lvl_840x560px.jpg"
225+
alt="Core developers in action">
216226
</div>
217227
</div>
218228
</section>

‎static/credits.txt

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,3 +9,5 @@
99

1010
contact photo: Photo by Alejandro Escamilla on Unsplash / Photo by NordWood Themes on Unsplash
1111
contact: <a href='https://www.freepik.com/free-photo/blank-business-cards-and-cup-of-coffee-on-wooden-table-corporate-stationary-branding-mock-up_1187395.htm'>Designed by Freepik</a>
12+
13+
events photo: Photo by Alex Kotliarskyi on Unsplash
Loading
8.14 KB
Loading
-68.3 KB
Binary file not shown.
Loading
Loading
78.3 KB
Loading
Loading
Loading
Loading
Loading
Loading

‎static/js/site.js

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,11 @@ $(document).ready(function () {
1616
});
1717

1818

19+
function readDeviceOrientation() {
20+
21+
return window.matchMedia("(orientation: portrait)").matches;
22+
}
23+
1924
function stopBodyScrolling (bool) {
2025
/**
2126
* Required to stop body scrolling on iOS devices (safari ignores
@@ -87,9 +92,16 @@ class ResponsiveBackgroundImage {
8792

8893
update() {
8994
let src = typeof this.img.currentSrc !== 'undefined' ? this.img.currentSrc : this.img.src;
95+
let image = this.img;
96+
let overlay = image.getAttribute("data-overlay");
97+
if (overlay === null || overlay === undefined) {
98+
overlay = "";
99+
}
100+
90101
if (this.src !== src) {
91102
this.src = src;
92-
this.element.style.backgroundImage = 'linear-gradient(rgba(0, 0, 0, 0.4), rgba(0, 0, 0, 0.6)), url("' + this.src + '")';
103+
104+
this.element.style.backgroundImage = overlay + ', url("' + this.src + '")';
93105
}
94106
}
95107
}

0 commit comments

Comments
 (0)
Please sign in to comment.