<commit_before>function swipe(direction){
    var endpoint = window.location.href.split('/')[7];
    var forward, backward;

    // Homepage to choose an avatar page
    if (endpoint === 'index.html'){
          forward = 'choose-an-avatar.html',
          backward = ''
    };

    // Avatar to introduction page
    if (endpoint === 'choose-an-avatar.html'){
        forward = 'introduction.html',
        backward = 'index.html'
    };

    // Introduction to feelings page
    if (endpoint === 'introduction.html'){
        forward = 'feelings.html',
        backward = 'choose-an-avatar.html'
    };

    // Feelings page to eating page
    if (endpoint === 'feelings.html'){
        forward = 'eating.html',
        backward = 'introduction.html'
    };

    // Eating page to finish page
    if (endpoint === 'eating.html'){
        forward = 'personality.html',
        backward = 'feelings.html'
    };

    // Eating page to finish page
    if (endpoint === 'personality.html'){
        forward = 'finished.html',
        backward = 'eating.html'
    };

    // Eating page to finish page
    if (endpoint === 'finished.html'){
        forward = '',
        backward = 'eating.html'
    };

    if(direction === "swipeleft" && event.target.tagName !== 'IMG'){
      window.location.href = forward;
    }

    if(direction === "swiperight" && event.target.tagName !== 'IMG'){
      window.location.href = backward;
    }
}

// The if statement stops the carousel from triggering the page swipe
Hammer(document.body).on("swipeleft", function(){ swipe("swipeleft") });
Hammer(document.body).on("swiperight", function(){ swipe("swiperight") });
<commit_msg>change order of pages.<commit_after>function swipe(direction){
    var endpoint = window.location.href.split('/')[7];
    var forward, backward;

    // Homepage to choose an avatar page
    if (endpoint === 'index.html'){
          forward = 'choose-an-avatar.html',
          backward = ''
    };

    // Avatar to introduction page
    if (endpoint === 'choose-an-avatar.html'){
        forward = 'introduction.html',
        backward = 'index.html'
    };

    // Introduction to feelings page
    if (endpoint === 'introduction.html'){
        forward = 'eating.html',
        backward = 'choose-an-avatar.html'
    };

    // Eating page to finish page
    if (endpoint === 'eating.html'){
        forward = 'feelings.html',
        backward = 'introduction.html'
    };

    // Feelings page to eating page
    if (endpoint === 'feelings.html'){
        forward = 'personality.html',
        backward = 'eating.html'
    };

    // Eating page to finish page
    if (endpoint === 'personality.html'){
        forward = 'finished.html',
        backward = 'feelings.html'
    };

    // Eating page to finish page
    if (endpoint === 'finished.html'){
        forward = '',
        backward = 'personality.html'
    };

    if(direction === "swipeleft" && event.target.tagName !== 'IMG'){
      window.location.href = forward;
    }

    if(direction === "swiperight" && event.target.tagName !== 'IMG'){
      window.location.href = backward;
    }
}

// The if statement stops the carousel from triggering the page swipe
Hammer(document.body).on("swipeleft", function(){ swipe("swipeleft") });
Hammer(document.body).on("swiperight", function(){ swipe("swiperight") });

{'fraction_non_alphanumeric': 0.1565868263473054, 'fraction_numerical': 0.0005988023952095808, 'mean_word_length': 2.5131440588853837, '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': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '6084898', 'n_tokens_mistral': 1022, 'n_tokens_neox': 985, 'n_words': 239}