summaryrefslogtreecommitdiffstats
path: root/layouts/partials/scripts.html
blob: c5efc63124c69c9bc930958f6814dff9dd19424c (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
<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"
    });
</script>