Skip to content

Commit

Permalink
Closes #339 with a fixed masthead
Browse files Browse the repository at this point in the history
  • Loading branch information
rjzupkoii committed Mar 10, 2024
1 parent 2d2b04e commit 185fac4
Show file tree
Hide file tree
Showing 7 changed files with 26 additions and 23 deletions.
5 changes: 4 additions & 1 deletion _pages/markdown.md
Original file line number Diff line number Diff line change
Expand Up @@ -258,4 +258,7 @@ Still sticking with science and Isaac Newton's E = MC<sup>2</sup>, which should
This allows you to denote <var>variables</var>.

***
**Footnotes**
**Footnotes**

The footnotes in the page will be returned following this line, return to the section on <a href="#footnotes">Markdown Footnotes</a>.

2 changes: 1 addition & 1 deletion _sass/_base.scss
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ html {

body {
margin: 0;
padding: 0;
padding: $masthead-height 0 0;
padding-bottom: 9em;
color: $text-color;
font-family: $global-font-family;
Expand Down
7 changes: 6 additions & 1 deletion _sass/_masthead.scss
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,13 @@
========================================================================== */

.masthead {
position: relative;
position: fixed;
background: white;
border-bottom: 1px solid $border-color;
height: $masthead-height;
top: 0;
width: 100%;

-webkit-animation: intro 0.3s both;
animation: intro 0.3s both;
-webkit-animation-delay: 0.15s;
Expand Down
6 changes: 5 additions & 1 deletion _sass/_sidebar.scss
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,11 @@
@include clearfix();
margin-bottom: 1em;

@media screen and (min-width: 1024px) {
position: fixed;
padding-top: $masthead-height;
}

@include breakpoint($large) {
@include span(2 of 12);
opacity: 1;
Expand All @@ -24,7 +29,6 @@
}
}


@include breakpoint($x-large) {
padding-right: 0;
}
Expand Down
2 changes: 2 additions & 0 deletions _sass/_variables.scss
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,8 @@ $type-size-6 : 0.75em; // ~12px
$type-size-7 : 0.6875em; // ~11px
$type-size-8 : 0.625em; // ~10px

/* masthead properties */
$masthead-height : 50px;

/*
Colors
Expand Down
17 changes: 3 additions & 14 deletions assets/js/_main.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
========================================================================== */

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

var stickySideBar = function(){
var show = $(".author__urls-wrapper button").length === 0 ? $(window).width() > 1024 : !$(".author__urls-wrapper button").is(":visible");
// console.log("has button: " + $(".author__urls-wrapper button").length === 0);
// console.log("Window Width: " + windowWidth);
// console.log("show: " + show);
//old code was if($(window).width() > 1024)
if (show) {
// fix
Stickyfill.rebuild();
Expand All @@ -51,26 +47,19 @@ $(document).ready(function(){
});

// Follow menu drop down

$(".author__urls-wrapper button").on("click", function() {
$(".author__urls").fadeToggle("fast", function() {});
$(".author__urls-wrapper button").toggleClass("open");
});

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

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

// Magnific-Popup options
$(".image-popup").magnificPopup({
// disableOn: function() {
// if( $(window).width() < 500 ) {
// return false;
// }
// return true;
// },
type: 'image',
tLoading: 'Loading image #%curr%...',
gallery: {
Expand Down
10 changes: 5 additions & 5 deletions assets/js/main.min.js

Large diffs are not rendered by default.

0 comments on commit 185fac4

Please sign in to comment.