Welcome to mirror list, hosted at ThFree Co, Russian Federation.

theme.js « js « static - github.com/2-REC/hugo-myportfolio-theme.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
blob: 18cfaae06b000e8c2882c530a554097804283a64 (plain)
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
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
/*!
 * Start Bootstrap - Creative Bootstrap Theme (http://startbootstrap.com)
 * Code licensed under the Apache License v2.0.
 * For details, see http://www.apache.org/licenses/LICENSE-2.0.
 */

(function($) {
    "use strict"; // Start of use strict

    // jQuery for page scrolling feature - requires jQuery Easing plugin
    $('a.page-scroll').bind('click', function(event) {
        var $anchor = $(this);
        var $offset = $($anchor.attr('href')).offset();
        if ($offset) {
            $('html, body').stop().animate({
                scrollTop: $offset.top - $('.navbar-header').height()
            }, 1250, 'easeInOutExpo');
            event.preventDefault();
        }
    });
    /* 2-REC - TODO: don't use 'animate' */
    $('a.page-jump').bind('click', function(event) {
        var $anchor = $(this);
        var $offset = $($anchor.attr('href')).offset();
        if ($offset) {
            $('html, body').stop().animate({
                scrollTop: $offset.top - $('.navbar-header').height()
            }, 0, 'easeInOutExpo');
            event.preventDefault();
        }
    });

    // Highlight the top nav as scrolling occurs
    $('body').scrollspy({
        target: '.navbar-fixed-top',
        offset: ($('.navbar-header').height() + 1)
    })

    // Closes the Responsive Menu on Menu Item Click
    $('.navbar-collapse ul li a').click(function() {
        $('.navbar-toggle:visible').click();
    });

    // Fit Text Plugin for Main Header
    $("h1").fitText(
        1.2, {
            minFontSize: '35px',
            maxFontSize: '65px'
        }
    );

    // Offset for Main Navigation
    $('#navFixed').affix({
        offset: {
            top: ($('.navbar-header').height() * 2)
        }
    })

})(jQuery); // End of use strict