Skip to content

Commit 8d66dd3

Browse files
Changed classes for page title section to match new css rules (more concise naming structure).
Further unified text classes across the site. Added function to prevent body scrolling on iOS devices - safari there ignores overflow: hidden set on body (live test needed).
1 parent 192fa76 commit 8d66dd3

File tree

7 files changed

+53
-18
lines changed

7 files changed

+53
-18
lines changed

_pages/03_events.html

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,8 +19,8 @@
1919
<div class="events-page__background-img">
2020
<div class="row container-fluid">
2121
<div class="col-sm-12">
22-
<h2 class="section-title page__title">Events</h2>
23-
<h3 class="page__subtitle">See what's coming up. Check what we did recently</h3>
22+
<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>
2424
</div>
2525
</div>
2626
</div>

_pages/04_contact.html

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,8 +19,8 @@
1919
<div class="contact__background-img">
2020
<div class="row container-fluid">
2121
<div class="col-sm-12">
22-
<h2 class="contact__section-title">Contact Us</h2>
23-
<h3 class="contact__section-subtitle">Got an idea? Can you or your company support us? Let us know.</h3>
22+
<h2 class="contact__page-title">Contact Us</h2>
23+
<h3 class="contact__page-subtitle">Got an idea? Can you or your company support us? Let us know.</h3>
2424
</div>
2525
</div>
2626
</div>

_sass/contact.scss

Lines changed: 4 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -14,17 +14,12 @@
1414
}
1515
}
1616

17-
.contact__section-title {
18-
@extend .section-title-light;
19-
margin-top: 20vh;
20-
color: $page-title;
17+
.contact__page-title {
18+
@extend .page-title-light;
2119
}
2220

23-
.contact__section-subtitle {
24-
@extend .subtitle;
25-
font-size: 1.75em;
26-
text-align: center;
27-
margin-bottom: 10vh;
21+
.contact__page-subtitle {
22+
@extend .page-subtitle;
2823
}
2924

3025
.contact__form {

_sass/events.scss

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,4 +4,12 @@
44

55
.events-page__background-img {
66
@extend .contact__background-img
7+
}
8+
9+
.events-page__page-title {
10+
@extend .page-title-light;
11+
}
12+
13+
.events-page__page-subtitle {
14+
@extend .page-subtitle
715
}

_sass/style.scss

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -295,7 +295,7 @@ a {
295295
width: 100%;
296296
background: rgba(0, 0, 0, 0.9);
297297
font-size: 2.5em;
298-
color: $section-title-light;
298+
color: $title-light;
299299
margin-top: 0;
300300
padding-top: 0.5em;
301301
padding-bottom: 0.5em;

_sass/typography.scss

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -60,6 +60,20 @@
6060
color: $section-title-light;
6161
}
6262

63+
.page-title-light {
64+
@extend .section-title;
65+
margin-top: 20vh;
66+
color: $page-title;
67+
}
68+
69+
.page-subtitle {
70+
font-family: 'Encode Sans Expanded', sans-serif;
71+
color: $subtitle;
72+
font-size: 1.75em;
73+
text-align: center;
74+
margin-bottom: 10vh;
75+
}
76+
6377
.event-label {
6478
font-family: 'Encode Sans Expanded', sans-serif;
6579
background: linear-gradient(45deg, $grey, $grey 80%, transparent 80%, transparent 100%);

static/js/site.js

Lines changed: 22 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -5,13 +5,29 @@ var buttonCloseContainer = $(".navigation__button-close-container");
55
var navigationButtonClose = $(".navigation__button-close");
66
var scrollPosition = 0;
77
var scrollBarWidth = 0;
8+
var preventDefaultAction = function(e) {
9+
e.preventDefault();
10+
};
811

912

1013
$(document).ready(function () {
1114
buttonOpenContainer.on("click", openNav);
1215
navigationButtonClose.on("click", closeNav);
1316
});
1417

18+
19+
function stopBodyScrolling (bool) {
20+
/**
21+
* Required to stop body scrolling on iOS devices (safari ignores
22+
* body overflow: hidden in css.
23+
*/
24+
if (bool === true) {
25+
document.body.addEventListener("touchmove", preventDefaultAction, false);
26+
} else {
27+
document.body.removeEventListener("touchmove", preventDefaultAction, false);
28+
}
29+
}
30+
1531
function setActiveLink() {
1632
var currentURL = window.location.href;
1733
$('.navigation__link, .footer__link').each(function () {
@@ -24,10 +40,11 @@ function setActiveLink() {
2440
function openNav() {
2541
scrollPosition = $(window).scrollTop();
2642
scrollBarWidth = (window.innerWidth - $(window).width());
27-
$("body").addClass("no-scroll");
43+
$(".body").addClass("no-scroll");
44+
stopBodyScrolling(true);
2845
// To prevent content from jumping when scrollbar disappears.
2946
$(window).scrollTop(scrollPosition);
30-
$("body").css("padding-right", scrollBarWidth + "px");
47+
$(".body").css("padding-right", scrollBarWidth + "px");
3148
buttonOpenContainer.css("pointer-events", "none");
3249
buttonOpenContainer.toggle(500, showCloseButton);
3350
hamburgerBar.css("background-color", "transparent");
@@ -36,9 +53,10 @@ function openNav() {
3653

3754
/* Close when someone clicks on the "x" symbol inside the overlay */
3855
function closeNav() {
39-
$("body").removeClass("no-scroll");
56+
$(".body").removeClass("no-scroll");
57+
stopBodyScrolling(false);
4058
// To stop content jerking left-right when scrollbar is restored.
41-
$("body").css("padding-right", "");
59+
$(".body").css("padding-right", "");
4260
hamburgerBar.css("background-color", "#ffffff");
4361
navigationOverlay.css("width", "0%");
4462
buttonOpenContainer.css("display", "inline");

0 commit comments

Comments
 (0)