Skip to content

Commit

Permalink
Closes academicpages#339 with a fixed masthead
Browse files Browse the repository at this point in the history
  • Loading branch information
rjzupkoii authored and dorukaks committed Nov 24, 2024
1 parent a4c3ff5 commit dc77f7f
Show file tree
Hide file tree
Showing 5 changed files with 34 additions and 12 deletions.
3 changes: 3 additions & 0 deletions _pages/markdown.md
Original file line number Diff line number Diff line change
Expand Up @@ -288,3 +288,6 @@ This allows you to denote <var>variables</var>.

***
**Footnotes**

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

4 changes: 1 addition & 3 deletions _sass/_sidebar.scss
Original file line number Diff line number Diff line change
Expand Up @@ -16,9 +16,7 @@
@include clearfix();
margin-bottom: 1em;

@media screen and (min-width: $sidebar-screen-min-width) {
height: 100vh;
overflow-y: auto; // Add scrollbar if the sidebar is too long
@media screen and (min-width: 1024px) {
position: fixed;
padding-top: $masthead-height;
}
Expand Down
8 changes: 1 addition & 7 deletions _sass/_variables.scss
Original file line number Diff line number Diff line change
Expand Up @@ -43,13 +43,7 @@ $type-size-7 : 0.6875em; // ~11px
$type-size-8 : 0.625em; // ~10px

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

/* Sidebar properties */
$sidebar-screen-min-width : 1024px;
$sidebar-link-max-width : 250px;


$masthead-height : 50px;

/*
Colors
Expand Down
25 changes: 24 additions & 1 deletion assets/js/_main.js
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,30 @@ $(document).ready(function(){
}, 250);

// FitVids init
fitvids();
$("#main").fitVids();

// init sticky sidebar
$(".sticky").Stickyfill();

var stickySideBar = function(){
var show = $(".author__urls-wrapper button").length === 0 ? $(window).width() > 1024 : !$(".author__urls-wrapper button").is(":visible");
if (show) {
// fix
Stickyfill.rebuild();
Stickyfill.init();
$(".author__urls").show();
} else {
// unfix
Stickyfill.stop();
$(".author__urls").hide();
}
};

stickySideBar();

$(window).resize(function(){
stickySideBar();
});

// Follow menu drop down
$(".author__urls-wrapper button").on("click", function() {
Expand Down
6 changes: 5 additions & 1 deletion assets/js/main.min.js

Large diffs are not rendered by default.

0 comments on commit dc77f7f

Please sign in to comment.