Skip to content

Commit 185fac4

Browse files
committed
Closes #339 with a fixed masthead
1 parent 2d2b04e commit 185fac4

File tree

7 files changed

+26
-23
lines changed

7 files changed

+26
-23
lines changed

_pages/markdown.md

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -258,4 +258,7 @@ Still sticking with science and Isaac Newton's E = MC<sup>2</sup>, which should
258258
This allows you to denote <var>variables</var>.
259259

260260
***
261-
**Footnotes**
261+
**Footnotes**
262+
263+
The footnotes in the page will be returned following this line, return to the section on <a href="#footnotes">Markdown Footnotes</a>.
264+

_sass/_base.scss

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ html {
99

1010
body {
1111
margin: 0;
12-
padding: 0;
12+
padding: $masthead-height 0 0;
1313
padding-bottom: 9em;
1414
color: $text-color;
1515
font-family: $global-font-family;

_sass/_masthead.scss

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,13 @@
33
========================================================================== */
44

55
.masthead {
6-
position: relative;
6+
position: fixed;
7+
background: white;
78
border-bottom: 1px solid $border-color;
9+
height: $masthead-height;
10+
top: 0;
11+
width: 100%;
12+
813
-webkit-animation: intro 0.3s both;
914
animation: intro 0.3s both;
1015
-webkit-animation-delay: 0.15s;

_sass/_sidebar.scss

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,11 @@
1313
@include clearfix();
1414
margin-bottom: 1em;
1515

16+
@media screen and (min-width: 1024px) {
17+
position: fixed;
18+
padding-top: $masthead-height;
19+
}
20+
1621
@include breakpoint($large) {
1722
@include span(2 of 12);
1823
opacity: 1;
@@ -24,7 +29,6 @@
2429
}
2530
}
2631

27-
2832
@include breakpoint($x-large) {
2933
padding-right: 0;
3034
}

_sass/_variables.scss

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -42,6 +42,8 @@ $type-size-6 : 0.75em; // ~12px
4242
$type-size-7 : 0.6875em; // ~11px
4343
$type-size-8 : 0.625em; // ~10px
4444

45+
/* masthead properties */
46+
$masthead-height : 50px;
4547

4648
/*
4749
Colors

assets/js/_main.js

Lines changed: 3 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
========================================================================== */
44

55
$(document).ready(function(){
6-
// Sticky footer
6+
// Sticky footer
77
var bumpIt = function() {
88
$("body").css("margin-bottom", $(".page__footer").outerHeight(true));
99
},
@@ -28,10 +28,6 @@ $(document).ready(function(){
2828

2929
var stickySideBar = function(){
3030
var show = $(".author__urls-wrapper button").length === 0 ? $(window).width() > 1024 : !$(".author__urls-wrapper button").is(":visible");
31-
// console.log("has button: " + $(".author__urls-wrapper button").length === 0);
32-
// console.log("Window Width: " + windowWidth);
33-
// console.log("show: " + show);
34-
//old code was if($(window).width() > 1024)
3531
if (show) {
3632
// fix
3733
Stickyfill.rebuild();
@@ -51,26 +47,19 @@ $(document).ready(function(){
5147
});
5248

5349
// Follow menu drop down
54-
5550
$(".author__urls-wrapper button").on("click", function() {
5651
$(".author__urls").fadeToggle("fast", function() {});
5752
$(".author__urls-wrapper button").toggleClass("open");
5853
});
5954

60-
// init smooth scroll
61-
$("a").smoothScroll({offset: -20});
55+
// init smooth scroll, this needs to be slightly more than then fixed masthead height
56+
$("a").smoothScroll({offset: -65});
6257

6358
// add lightbox class to all image links
6459
$("a[href$='.jpg'],a[href$='.jpeg'],a[href$='.JPG'],a[href$='.png'],a[href$='.gif']").addClass("image-popup");
6560

6661
// Magnific-Popup options
6762
$(".image-popup").magnificPopup({
68-
// disableOn: function() {
69-
// if( $(window).width() < 500 ) {
70-
// return false;
71-
// }
72-
// return true;
73-
// },
7463
type: 'image',
7564
tLoading: 'Loading image #%curr%...',
7665
gallery: {

assets/js/main.min.js

Lines changed: 5 additions & 5 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)