<commit_before>// Version 2015-09-03
// Additional: adding a <style> tag to control the [::after] element blinking
function typingAnimation(d) {
    "use strict";
    var q = function (a) {
            return d.querySelector(a);
        },
        input_text = q("#inp"), //input element
        button = q("#start"), //button trigger
        output = q("#text_wrap"), //the output
        head = q("head"),
        interval, //timer
        counter = -1; //counter

    function stopAnimation() {
        var style,
            content = ".animation::after{animation:none;-webkit-animation:none}";
        if (!q("#stopAnimation")) {
            style = d.createElement("style");
            style.id = "stopAnimation";
            style.innerHTML = content;
            head.appendChild(style);
        } else {
            if (!q("#stopAnimation").innerHTML) {
                q("#stopAnimation").innerHTML = content;
            }
        }
    }
    function clickFocus() {
        input_text.value = "";
        output.innerHTML = "";
        button.disabled = 0;
    }
    function appearing_character() {
        var split_input = input_text.value.split("");
        stopAnimation();
        if (!split_input) {
            interval = clearInterval(interval);
            output.innerHTML = "enter sumthin";
        } else {
            counter += 1;
            if (counter < split_input.length) {
                output.innerHTML += split_input[counter];
            } else {
                counter = -1;
                q("#stopAnimation").innerHTML = "";
                clearInterval(interval);
            }
        }
    }
    function buttonClick() {
        interval = setInterval(appearing_character, 200);
        button.disabled = 1;
    }

    //TRIGGERS
    input_text.onclick = clickFocus;
    input_text.onfocus = clickFocus;
    button.onclick = buttonClick;
}
typingAnimation(document);<commit_msg>Updated the variable names<commit_after>// Version 2015-09-03
// Additional: adding a <style> tag to control the [::after] element blinking
function typingAnimation(d) {
    "use strict";
    var q = function (a) {
            return d.querySelector(a);
        },
        inputText = q("#inp"), //input element
        button = q("#start"), //button trigger
        output = q("#text_wrap"), //the output
        head = q("head"),
        interval, //timer
        counter = -1; //counter

    function stopAnimation() {
        var style,
            content = ".animation::after{animation:none;-webkit-animation:none}";
        if (!q("#stopAnimation")) {
            style = d.createElement("style");
            style.id = "stopAnimation";
            style.innerHTML = content;
            head.appendChild(style);
        } else {
            if (!q("#stopAnimation").innerHTML) {
                q("#stopAnimation").innerHTML = content;
            }
        }
    }
    function clickFocus() {
        inputText.value = "";
        output.innerHTML = "";
        button.disabled = 0;
    }
    function appearingChars() {
        var split_input = inputText.value.split("");
        stopAnimation();
        if (!split_input) {
            interval = clearInterval(interval);
            output.innerHTML = "enter sumthin";
        } else {
            counter += 1;
            if (counter < split_input.length) {
                output.innerHTML += split_input[counter];
            } else {
                counter = -1;
                q("#stopAnimation").innerHTML = "";
                clearInterval(interval);
            }
        }
    }
    function buttonClick() {
        interval = setInterval(appearingChars, 200);
        button.disabled = 1;
    }

    //TRIGGERS
    inputText.onclick = clickFocus;
    inputText.onfocus = clickFocus;
    button.onclick = buttonClick;
}
typingAnimation(document);
{'fraction_non_alphanumeric': 0.12993762993762994, 'fraction_numerical': 0.008316008316008316, 'mean_word_length': 1.8094890510948904, 'pattern_counts': {'":': 0, '<': 7, '<?xml version=': 0, '>': 5, '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': '7016456', 'n_tokens_mistral': 1031, 'n_tokens_neox': 990, 'n_words': 222}