(function($) {


    $( document ).ready(function() {
        $('.webien-scroll').each(function () {
            let el = $(this);
            let data = JSON.parse(el.attr('webien-scroll'));


            let waypoint = new Waypoint({
                element: el,
                handler: function (direction) {

                    if (direction === 'up') {
                        el.removeClass('scrolled');
                        el.addClass('unscrolled');
                    }

                    if (direction === 'down') {
                        el.removeClass('unscrolled');
                        el.addClass('scrolled');
                    }
                },
                offset: data.offset,
            });
        });
    });


}(jQuery));