<commit_before>
$(document).ready(function() {

    Number.prototype.mod = function(n) {
        return ((this%n)+n)%n;
    };


    for(var i = 1; i <= 18; i++) {
        var modalID = '#portfolioModal' + i;
        if(window.location.href.indexOf(modalID) != -1) {
            $(modalID).modal('show');
        }
    }

    if(window.location.href.indexOf('#digi') != -1) {
        $("#portfolioModal1").modal('show');
    }

    if(window.location.href.indexOf('#UAV') != -1) {
        $("#portfolioModal5").modal('show');
    }

    if(window.location.href.indexOf('#Elixr') != -1) {
        $('#portfolioModal4').modal('show');
    }

    if(window.location.href.indexOf('#MLRoad') != -1) {
        $('#portfolioModal3').modal('show');
    }

    
    /* Onclicks */
    $('.btn-prev').on('click', function(event) {
        var modal = $(this).parents().eq(5);
        var modalID = modal.attr('id')
        var numberText = modalID.split("portfolioModal")[1];
        var number = parseInt(numberText, 10) - 1;
        var newNum = (number-1).mod(18);
        var newModalID = '#portfolioModal' + (newNum+1);

        //close then open
        $('#'+modalID).modal('toggle');
        $(newModalID).modal('show');
    });

    $('.btn-next').on('click', function(event) {
        var modal = $(this).parents().eq(5);
        var modalID = modal.attr('id')
        var numberText = modalID.split("portfolioModal")[1];
        var number = parseInt(numberText, 10)-1;
        var newNum = (number+1).mod(18);
        var newModalID = '#portfolioModal' + (newNum+1);

        //close then open
        $('#'+modalID).modal('toggle');
        $(newModalID).modal('show');
    });
    
});<commit_msg>fixed modal popup background from stacking<commit_after>
$(document).ready(function() {

    Number.prototype.mod = function(n) {
        return ((this%n)+n)%n;
    };


    for(var i = 1; i <= 18; i++) {
        var modalID = '#portfolioModal' + i;
        if(window.location.href.indexOf(modalID) != -1) {
            $(modalID).modal('show');
        }
    }

    if(window.location.href.indexOf('#digi') != -1) {
        $("#portfolioModal1").modal('show');
    }

    if(window.location.href.indexOf('#UAV') != -1) {
        $("#portfolioModal5").modal('show');
    }

    if(window.location.href.indexOf('#Elixr') != -1) {
        $('#portfolioModal4').modal('show');
    }

    if(window.location.href.indexOf('#MLRoad') != -1) {
        $('#portfolioModal3').modal('show');
    }

    
    /* Onclicks */
    $('.btn-prev').on('click', function(event) {

        //close modal
        $('.modal').modal('hide');
        $('.modal-backdrop').remove()

        var modal = $(this).parents().eq(5);
        var modalID = modal.attr('id')
        var numberText = modalID.split("portfolioModal")[1];
        var number = parseInt(numberText, 10) - 1;
        var newNum = (number-1).mod(18);
        var newModalID = '#portfolioModal' + (newNum+1);

        $(newModalID).modal('show');
    });

    $('.btn-next').on('click', function(event) {

        //cloase modal
        $('.modal').modal('hide');
        $('.modal-backdrop').remove()

        var modal = $(this).parents().eq(5);
        var modalID = modal.attr('id')
        var numberText = modalID.split("portfolioModal")[1];
        var number = parseInt(numberText, 10)-1;
        var newNum = (number+1).mod(18);
        var newModalID = '#portfolioModal' + (newNum+1);

        //close then open
        $(newModalID).modal('show');
    });
    
});
{'fraction_non_alphanumeric': 0.21136363636363636, 'fraction_numerical': 0.017045454545454544, 'mean_word_length': 2.369377990430622, 'pattern_counts': {'":': 0, '<': 5, '<?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': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '467477', 'n_tokens_mistral': 1176, 'n_tokens_neox': 1138, 'n_words': 182}