<commit_before>window.onscroll = function() {
    window.scrollTo(0, 0);
};

$(document).ready(function() {
    var $body = $(document.body);
    var $adelheid = $('.adelheid');
    var $main = $('.main');
    var $chapters = $('.chapter');
    var $bubble_links = $('.bubble-link');

    var active_chapter_num = 0;
    var num_chapters = $chapters.length;
    var chapter_width = $(window).width();
    // Time it takes to change a chapter.
    var adelheid_ms = parseInt($adelheid.css('transition-duration'), 10) * 1000;
    var transitioning = false;

    var songs = [];
    var songs_paused = false;

    var reel_interval;

    /* ==== */
    /* Init */
    /* ==== */
    function $get_chapter(chapter) {
        return $($chapters[chapter]);
    }
    function $active_chapter() {
        return $($chapters[active_chapter_num]);
    }
    $chapters.css('width', chapter_width);

    $body.hammer({'swipe_velocity': 0.3}).on('swipe', function(e) {
        if (transitioning || ['left', 'right'].indexOf(e.gesture.direction) === -1) {
            return;
        }
        if (e.gesture.direction == 'left') {
            $('.next').trigger('click');
        } else {
            $('.prev').trigger('click');
        }
    });

    $('.button').on('click', function() {
        this.classList.add('tapped');

        var that = this;
        setTimeout(function() {
            that.classList.remove('tapped');
        }, 750);
    });

    /* ========== */
    /* Title page */
    /* ========== */
    $('.prologue').click(function() {
        var $prologue = $(this);

        $body.trigger('start');
        $('.chapter:first-child').addClass('active').find('.image-reel')
                                 .addClass('running');

        $prologue.addClass('remove');
        setTimeout(function() {
            $prologue.remove();
        }, 5000);
    });

    /* ================= */
    /* Changing chapters */
    /* ================= */
    function go_to_chapter(old_chapter, chapter) {
        if (chapter == old_chapter) {
            return;
        }
        transitioning = true;

        // Change background.
        cycle_background($get_chapter(chapter).data('background'));

        // Change songs.
        if (!songs_paused) {
            pause(songs[old_chapter]);
            setTimeout(function() {<commit_msg>remove unnecessary active add class<commit_after>window.onscroll = function() {
    window.scrollTo(0, 0);
};

$(document).ready(function() {
    var $body = $(document.body);
    var $adelheid = $('.adelheid');
    var $main = $('.main');
    var $chapters = $('.chapter');
    var $bubble_links = $('.bubble-link');

    var active_chapter_num = 0;
    var num_chapters = $chapters.length;
    var chapter_width = $(window).width();
    // Time it takes to change a chapter.
    var adelheid_ms = parseInt($adelheid.css('transition-duration'), 10) * 1000;
    var transitioning = false;

    var songs = [];
    var songs_paused = false;

    var reel_interval;

    /* ==== */
    /* Init */
    /* ==== */
    function $get_chapter(chapter) {
        return $($chapters[chapter]);
    }
    function $active_chapter() {
        return $($chapters[active_chapter_num]);
    }
    $chapters.css('width', chapter_width);

    $body.hammer({'swipe_velocity': 0.3}).on('swipe', function(e) {
        if (transitioning || ['left', 'right'].indexOf(e.gesture.direction) === -1) {
            return;
        }
        if (e.gesture.direction == 'left') {
            $('.next').trigger('click');
        } else {
            $('.prev').trigger('click');
        }
    });

    $('.button').on('click', function() {
        this.classList.add('tapped');

        var that = this;
        setTimeout(function() {
            that.classList.remove('tapped');
        }, 750);
    });

    /* ========== */
    /* Title page */
    /* ========== */
    $('.prologue').click(function() {
        var $prologue = $(this);

        $body.trigger('start');
        $('.chapter:first-child').find('.image-reel').addClass('running');

        $prologue.addClass('remove');
        setTimeout(function() {
            $prologue.remove();
        }, 5000);
    });

    /* ================= */
    /* Changing chapters */
    /* ================= */
    function go_to_chapter(old_chapter, chapter) {
        if (chapter == old_chapter) {
            return;
        }
        transitioning = true;

        // Change background.
        cycle_background($get_chapter(chapter).data('background'));

        // Change songs.
        if (!songs_paused) {
            pause(songs[old_chapter]);
            setTimeout(function() {
{'fraction_non_alphanumeric': 0.20214822771213747, 'fraction_numerical': 0.00816326530612245, 'mean_word_length': 2.180327868852459, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 1, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '6677761', 'n_tokens_mistral': 1459, 'n_tokens_neox': 1360, 'n_words': 241}