Sha256: 40c6a7a41584e2b71ebd1831dd4359ed826774f6f81cdbbaf1251f7d92b55dd8

Contents?: true

Size: 1.54 KB

Versions: 12

Compression:

Stored size: 1.54 KB

Contents

/**
 * Main JS file for Casper behaviours
 */

/*globals jQuery, document */
(function ($) {
    "use strict";

    $(document).ready(function () {

        // Tooltip init
        tooltipInit();

        // Init the posts
        postInit();

        // Waypoints
        waypointsInit();

    });

    // Init waypoints for header and footer animations
    function waypointsInit() {

        var headerWaypoint = new Waypoint({
            element: document.getElementById('masthead'),
            offset: -5,
            handler: function (direction) {
                if (direction === 'down')
                    this.element.classList.remove('animation-on');
                else
                    this.element.classList.add('animation-on');
            }
        });

        var footerWaypoint = new Waypoint({
            element: document.getElementById('footer'),
            handler: function (direction) {
                this.element.classList.toggle('animation-on');
            },
            offset: 'bottom-in-view'
        });

    }

    // Init bootstrap tooltip
    function tooltipInit() {
        $('[data-toggle]').tooltip();
    }

    function postInit() {
        // Set lead paragraphs
        $('.post-body p:first-child').addClass('lead');

        // Set feature image
        var featured = $('.featured-image').find('img').attr('src');
        if (featured) {
            $('#masthead').css('backgroundImage', 'url(' + featured + ')');
            $('#footer').css('backgroundImage', 'url(' + featured + ')');
        };
    }

} (jQuery));

Version data entries

12 entries across 12 versions & 1 rubygems

Version Path
jekyll-theme-omega-0.2.7 assets/js/script.js
jekyll-theme-omega-0.2.6 assets/js/script.js
jekyll-theme-omega-0.2.5 assets/js/script.js
jekyll-theme-omega-0.2.4 assets/js/script.js
jekyll-theme-omega-0.2.2 theme_assets/js/script.js
jekyll-theme-omega-0.2.0 assets/js/script.js
jekyll-theme-omega-0.1.9 assets/js/script.js
jekyll-theme-omega-0.1.8 assets/js/script.js
jekyll-theme-omega-0.1.7 assets/js/script.js
jekyll-theme-omega-0.1.6 assets/js/script.js
jekyll-theme-omega-0.1.5 assets/js/script.js
jekyll-theme-omega-0.1.4 assets/js/script.js