(function ($) {
    "use strict";
    /*--/ Star Typed /--*/
    if ($('.text-slider').length == 1) {
        var typed_strings = $('.text-slider-items').text();
        var typed = new Typed('.text-slider', {
            strings: typed_strings.split(','),
            typeSpeed: 80,
            loop: true,
            backDelay: 1100,
            backSpeed: 30
        });
    }

    function initParallax() {
        $('#masthead').parallax("100%", 0.3);
        $('#content').parallax("20%", 0.7);
    }

    initParallax();

    let counter;
    counter = 0;
    $(window).scroll(function () {
        if ($(window).scrollTop() + $(window).height() == $(document).height()) {
            function see_more() {
                counter = counter + 10;
                var csrftoken = $.cookie('csrftoken')
                let info;
                info = {'counter': counter, 'csrfmiddlewaretoken': csrftoken}
                $.ajax({
                    type: "POST",
                    url: 'article/article_list_call/',
                    data: info,
                    datatype: 'json',
                    headers: {"X-CSRFToken": csrftoken},
                    success: function (data) {
                        console.log(data)
                        $("#articles_list").append(data);
                    }
                })
            }
            see_more();
        }
    })

})(jQuery);

