diff options
Diffstat (limited to 'layouts/partials')
-rw-r--r-- | layouts/partials/head.html | 3 | ||||
-rw-r--r-- | layouts/partials/scripts.html | 33 |
2 files changed, 35 insertions, 1 deletions
diff --git a/layouts/partials/head.html b/layouts/partials/head.html index 8d035ce..749c213 100644 --- a/layouts/partials/head.html +++ b/layouts/partials/head.html @@ -17,7 +17,8 @@ {{ $style := $sass | resources.ToCSS }} <link rel="stylesheet" href="{{ $style.Permalink }}"> <script src="{{ .Site.Params.cdnVanillaLazyloadJS }}"></script> - +<script src="{{ .Site.Params.cdnJQueryJS }}"></script> +<script src="{{ .Site.Params.cdnProgessJS }}"></script> {{ if or .Params.math .Site.Params.math }} {{ partial "math.html" . }} {{ end }}
\ No newline at end of file diff --git a/layouts/partials/scripts.html b/layouts/partials/scripts.html index 4caf7ba..c5efc63 100644 --- a/layouts/partials/scripts.html +++ b/layouts/partials/scripts.html @@ -1,4 +1,37 @@ <script> + $(function () { + var bar = new ProgressBar.Circle('#progress', { + color: '#8AA2D3', + strokeWidth: 15, + trailColor: '#E5E2E4', + trailWidth: 15, + text: { + autoStyleContainer: false + }, + fill: '#E5E2E4', + step: function (state, circle) { + var value = Math.round(circle.value() * 100); + if (value == 0 || value == 100) { + circle.setText(''); + } else { + circle.setText(value); + } + } + }); + var scrolled = ($(window).scrollTop() / ($(document).height() - $(window).height() - 1)); + bar.animate(scrolled); + $(window).scroll(function () { + scrolled = ($(window).scrollTop() / ($(document).height() - $(window).height() - 1)); + if (scrolled < 0.0005) { + scrolled = 0; + } else if (scrolled > 1) { + scrolled = 1; + } + bar.set(scrolled); + }); + }); +</script> +<script> var lazyLoadInstance = new LazyLoad({ elements_selector: ".lazy" }); |