<commit_before>var breathFocus = (function () {
    var breathInterval = null;
    var breathTime = 5;
    var stateInterval = null;

    var breathContent = document.getElementsByClassName("breath-content")[0];
    var timerSelect = document.getElementById("timerSelect");
    var start = document.getElementById("start");
    var increase = document.getElementById("increase");
    var decrease = document.getElementById("decrease");
    var minutes = document.getElementById("minutes");
    var countdown = document.getElementById("countdown");
    var breathMsg = document.getElementById("breathMsg");
    var message = "Get yourself comfortable and start breathing when ready";

    window.onload = function () {
        init();
    };

    function init() {
        document.body.style.webkitAnimationPlayState = "paused";
        document.body.style.animationPlayState = "paused";
        breathContent.style.webkitAnimationPlayState = "paused";
        breathContent.style.animationPlayState = "paused";

        breathMsg.textContent = message;

        decrease.addEventListener("click", function () {
            if (breathTime > 1) {
                breathTime--;
            }
            minutes.textContent = breathTime.toString();
        });

        increase.addEventListener("click", function () {
            breathTime++;
            minutes.textContent = breathTime.toString();
        });

        start.addEventListener("click", function () {
            breathMsg.textContent = "Breath In";
            stateInterval = setInterval(function () {
                breathMsg.textContent = (breathMsg.textContent === "Breath Out") ? "Breath In" : "Breath Out";
            }, 5000);

            updateClass(timerSelect, "fade-in", "fade-out");
            updateClass(countdown, "fade-out", "fade-in");

            startTimer(breathTime * 60);
            document.body.style.webkitAnimationPlayState = "running";
            document.body.style.animationPlayState = "running";
            breathContent.style.webkitAnimationPlayState = "running";
            breathContent.style.animationPlayState = "running";

        });
    }

    function startTimer(duration) {
        var timer = duration, minutes, seconds;

        function breathTimer() {
            minutes = parseInt(timer / 60, 10);
            seconds = parseInt(timer % 60, 10);

            minutes = minutes < 10 ? "0" + minutes : minutes;
            seconds = seconds < 10 ? "0" + seconds : seconds;

            countdown.textContent = (minutes + ":" + seconds);

            if (--timer < 0) {
                clearInterval(breathInterval);
                clearInterval(stateInterval);

                updateClass(timerSelect, "fade-out", "fade-in");
                updateClass(countdown, "fade-in", "fade-out");
                breathMsg.textContent = message;

                document.body.style.webkitAnimationPlayState = "paused";
                document.body.style.animationPlayState = "paused";
                breathContent.style.webkitAnimationPlayState = "paused";
                breathContent.style.animationPlayState = "paused";
            }
        }

        breathTimer();
        breathInterval = setInterval(breathTimer, 1000);
    }

    function updateClass(target, removeClass, addClass) {
        target.classList.remove(removeClass);
        target.classList.add(addClass);
    }
})();<commit_msg>fix webkit animation play state<commit_after>var breathFocus = (function () {
    var breathInterval = null;
    var breathTime = 5;
    var stateInterval = null;

    var breathContent = document.getElementsByClassName("breath-content")[0];
    var timerSelect = document.getElementById("timerSelect");
    var start = document.getElementById("start");
    var increase = document.getElementById("increase");
    var decrease = document.getElementById("decrease");
    var minutes = document.getElementById("minutes");
    var countdown = document.getElementById("countdown");
    var breathMsg = document.getElementById("breathMsg");
    var message = "Get yourself comfortable and start breathing when ready";

    window.onload = function () {
        init();
    };

    function init() {
        document.body.style.WebkitAnimationPlayState = "paused";
        document.body.style.animationPlayState = "paused";
        breathContent.style.WebkitAnimationPlayState = "paused";
        breathContent.style.animationPlayState = "paused";

        breathMsg.textContent = message;

        decrease.addEventListener("click", function () {
            if (breathTime > 1) {
                breathTime--;
            }
            minutes.textContent = breathTime.toString();
        });

        increase.addEventListener("click", function () {
            breathTime++;
            minutes.textContent = breathTime.toString();
        });

        start.addEventListener("click", function () {
            breathMsg.textContent = "Breath In";
            stateInterval = setInterval(function () {
                breathMsg.textContent = (breathMsg.textContent === "Breath Out") ? "Breath In" : "Breath Out";
            }, 5000);

            updateClass(timerSelect, "fade-in", "fade-out");
            updateClass(countdown, "fade-out", "fade-in");

            startTimer(breathTime * 60);
            document.body.style.WebkitAnimationPlayState = "running";
            document.body.style.animationPlayState = "running";
            breathContent.style.WebkitAnimationPlayState = "running";
            breathContent.style.animationPlayState = "running";

        });
    }

    function startTimer(duration) {
        var timer = duration, minutes, seconds;

        function breathTimer() {
            minutes = parseInt(timer / 60, 10);
            seconds = parseInt(timer % 60, 10);

            minutes = minutes < 10 ? "0" + minutes : minutes;
            seconds = seconds < 10 ? "0" + seconds : seconds;

            countdown.textContent = (minutes + ":" + seconds);

            if (--timer < 0) {
                clearInterval(breathInterval);
                clearInterval(stateInterval);

                updateClass(timerSelect, "fade-out", "fade-in");
                updateClass(countdown, "fade-in", "fade-out");
                breathMsg.textContent = message;

                document.body.style.WebkitAnimationPlayState = "paused";
                document.body.style.animationPlayState = "paused";
                breathContent.style.WebkitAnimationPlayState = "paused";
                breathContent.style.animationPlayState = "paused";
            }
        }

        breathTimer();
        breathInterval = setInterval(breathTimer, 1000);
    }

    function updateClass(target, removeClass, addClass) {
        target.classList.remove(removeClass);
        target.classList.add(addClass);
    }
})();
{'fraction_non_alphanumeric': 0.11723534558180228, 'fraction_numerical': 0.008165645960921552, 'mean_word_length': 2.360607545320921, 'pattern_counts': {'":': 2, '<': 9, '<?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': '6842669', 'n_tokens_mistral': 1828, 'n_tokens_neox': 1705, 'n_words': 342}