Add smooth scroll to header links andpdf icons to anchors

This commit is contained in:
Ryan Watters
2017-02-09 00:58:09 -06:00
parent 872a67a8fc
commit 68476fdf85
8 changed files with 60 additions and 20 deletions
@@ -0,0 +1,15 @@
---
title: Table of Contents
linktitle:
description:
date: 2017-02-01
publishdate: 2017-02-01
lastmod: 2017-02-01
tags: []
categories: []
weight:
draft: false
slug:
aliases: []
notes:
---
@@ -15,3 +15,4 @@ notes:
---
`.IsNamedParams` (reference to shortcodes)
`.TableOfContents` (reference to content/table-of-contents)
@@ -1 +1,23 @@
$('.body-copy a[href$=".pdf"]').append('<i class="icon-pdf"></i>');
$('.body-copy a[href$=".pdf"]').append('<i class="icon-pdf"></i>');
$('.body-copy h2,.body-copy h3').each(function() {
var id = $(this).attr('id');
$(this).append('<a class="smooth-scroll heading-link" href="#' + id + '"><i class="icon-link"></i></a>');
});
$(document).ready(function () {
// bind click event to all internal page anchors
$('a.heading-link').on('click', function (e) {
// prevent default action and bubbling
e.preventDefault();
e.stopPropagation();
// set target to anchor's "href" attribute
var target = $(this).attr('href');
// scroll to each target
$(target).velocity('scroll', {
duration: 500,
offset: -50,
easing: 'ease-in-out'
});
});
});
@@ -13,9 +13,9 @@ h4 {
h1 {
font-size: 2em;
letter-spacing: -.021em;
padding-top:1em;
@include MQ(M) {
font-size: 2.25em;
padding-top: 1em;
}
}
@@ -37,9 +37,10 @@ h4 {
font-family: $code-font-family;
font-weight: $base-font-weight;
}
//keeps index page from taking on code/pre font family
.submenu-item:first-child {
a.submenu-item-link.functions{
font-family:$base-font-family;
a.submenu-item-link.functions {
font-family: $base-font-family;
}
}
@@ -46,16 +46,17 @@ a {
border-bottom: 1px solid $default-anchor-color;
}
}
&a[href$=".pdf"]::after {
font-family: "fontello";
font-style: normal;
font-weight: normal;
speak: none;
display: inline-block;
text-decoration: inherit;
width: 1em;
margin-left: .2em;
text-align: center;
content: '\f1c1';
a.heading-link {
color:lighten($base-font-color,40%);
font-size:.8em;
position:relative;
left:.3em;
bottom:.05em;
&:before,&:after {
display:none;
}
&:hover {
color:$default-anchor-color;
}
}
}
@@ -1,5 +1,5 @@
.all-content-wrapper.home {
background-color: $hugo-blue;
background-color: lighten($hugo-blue-light,50%);
}
main#homepage {
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long