<commit_before>(function(root, factory) {
  if (typeof define === 'function' && define.amd) {
    // AMD
    // jQuery and Raphael dependencies loaded outside RequireJS
    define(factory);
  }
})(this, function() {

  var init = function(client) {
    // clicking the Timer triggers the end game screen.
    // TODO: remove this when actual game state can trigger end of game
    $('.countdown').on('click', (function() {
      var player = client.entities[client.uuid];
      this.gameover(player);
    }).bind(this));

    // animation of the Timer (this is currently just a demo)
    var archtype = Raphael('countdown', 200, 200);
    var archtype_bot = Raphael('countdown_static', 500, 500);

    archtype.customAttributes.arc = function(xloc, yloc, value, total, R) {
      var alpha = 360 / total * value,
        a = (90 - alpha) * Math.PI / 180,
        x = xloc + R * Math.cos(a),
        y = yloc - R * Math.sin(a),
        path;

      if (total == value) {
        path = [
          ["M", xloc, yloc - R],
          ["A", R, R, 0, 1, 1, xloc - 0.01, yloc - R]
        ];
      } else {
        path = [
          ["M", xloc, yloc - R],
          ["A", R, R, 0, +(alpha > 180), 1, x, y]
        ];
      }

      return {
        path: path
      };
    };

    archtype_bot.customAttributes.arc = function(xloc, yloc, value, total, R) {
      var alpha = 360 / total * value,
        a = (90 - alpha) * Math.PI / 180,
        x = xloc + R * Math.cos(a),
        y = yloc - R * Math.sin(a),
        path;

      if (total == value) {
        path = [
          ["M", xloc, yloc - R],
          ["A", R, R, 0, 1, 1, xloc - 0.01, yloc - R]
        ];
      } else {
        path = [
          ["M", xloc, yloc - R],
          ["A", R, R, 0, +(alpha > 180), 1, x, y]
        ];
      }

      return {
        path: path
      };
    };

    // make an arc at 50,50 with a radius of 30 that grows from 0 to 40 of 100 with a bounce
    var my_arc = archtype.path().attr({
      "stroke":"#ed1b24",
      "stroke-width":10,
      arc:[60, 60, 0, 100, 50]
    });

    var my_arc_bot = archtype_bot.path().attr({
      "stroke":"#ccc",
      "stroke-width":10,
      arc:[60, 60, 100, 100, 50]
    });

    // TODO: remove this, animate timer on ui update loop
    function animate_arc() {
      setTimeout(function() {
        my_arc.animate({
          arc:[60, 60, 100, 100, 50]
        }, 10000);
      }, 2000);
    }

    animate_arc();

    // load twitter widgets (may not be necessary)
    /*
    !function (d, s, id) {
        var js, fjs = d.getElementsByTagName(s)[0];
        if (!d.getElementById(id)) {
            js = d.createElement(s);
            js.id = id;
            js.src = "https://platform.twitter.com/widgets.js";
            fjs.parentNode.insertBefore(js, fjs);
        }
    }(document, "script", "twitter-wjs");
    */
  };

  var gameover = function(player) {
    // this object should have all data needed to display gameover screen
    if (player) console.log(player);

    $('#gameover-container').show();
    $('#main').hide();
    $('#hud').hide();
    $('body').removeClass('game').addClass('gameover');
  };

  return {
    init: init,
    gameover: gameover
  };

});
<commit_msg>Setting up for gameover items<commit_after>(function(root, factory) {
  if (typeof define === 'function' && define.amd) {
    // AMD
    // jQuery and Raphael dependencies loaded outside RequireJS
    define(factory);
  }
})(this, function() {

  var init = function(client) {
    // clicking the Timer triggers the end game screen.
    // TODO: remove this when actual game state can trigger end of game
    $('.countdown').on('click', (function() {
      var player = client.entities[client.uuid];
      this.gameover(player);
    }).bind(this));

    // animation of the Timer (this is currently just a demo)
    var archtype = Raphael('countdown', 200, 200);
    var archtype_bot = Raphael('countdown_static', 500, 500);

    archtype.customAttributes.arc = function(xloc, yloc, value, total, R) {
      var alpha = 360 / total * value,
        a = (90 - alpha) * Math.PI / 180,
        x = xloc + R * Math.cos(a),
        y = yloc - R * Math.sin(a),
        path;

      if (total == value) {
        path = [
          ["M", xloc, yloc - R],
          ["A", R, R, 0, 1, 1, xloc - 0.01, yloc - R]
        ];
      } else {
        path = [
          ["M", xloc, yloc - R],
          ["A", R, R, 0, +(alpha > 180), 1, x, y]
        ];
      }

      return {
        path: path
      };
    };

    archtype_bot.customAttributes.arc = function(xloc, yloc, value, total, R) {
      var alpha = 360 / total * value,
        a = (90 - alpha) * Math.PI / 180,
        x = xloc + R * Math.cos(a),
        y = yloc - R * Math.sin(a),
        path;

      if (total == value) {
        path = [
          ["M", xloc, yloc - R],
          ["A", R, R, 0, 1, 1, xloc - 0.01, yloc - R]
        ];
      } else {
        path = [
          ["M", xloc, yloc - R],
          ["A", R, R, 0, +(alpha > 180), 1, x, y]
        ];
      }

      return {
        path: path
      };
    };

    // make an arc at 50,50 with a radius of 30 that grows from 0 to 40 of 100 with a bounce
    var my_arc = archtype.path().attr({
      "stroke":"#ed1b24",
      "stroke-width":10,
      arc:[60, 60, 0, 100, 50]
    });

    var my_arc_bot = archtype_bot.path().attr({
      "stroke":"#ccc",
      "stroke-width":10,
      arc:[60, 60, 100, 100, 50]
    });

    // TODO: remove this, animate timer on ui update loop
    function animate_arc() {
      setTimeout(function() {
        my_arc.animate({
          arc:[60, 60, 100, 100, 50]
        }, 10000);
      }, 2000);
    }

    animate_arc();

    // load twitter widgets (may not be necessary)
    /*
    !function (d, s, id) {
        var js, fjs = d.getElementsByTagName(s)[0];
        if (!d.getElementById(id)) {
            js = d.createElement(s);
            js.id = id;
            js.src = "https://platform.twitter.com/widgets.js";
            fjs.parentNode.insertBefore(js, fjs);
        }
    }(document, "script", "twitter-wjs");
    */
  };

  var gameover = function(player) {
    // this object should have all data needed to display gameover screen
    if (player) console.log(player);
    var intox = player.state.public.intoxication;
    var pimage = player.state.public.src;

    $('#gameover-container').show();
    $('#main').hide();
    $('#hud').hide();
    $('body').removeClass('game').addClass('gameover');
  };

  return {
    init: init,
    gameover: gameover
  };

});

{'fraction_non_alphanumeric': 0.1650929028327749, 'fraction_numerical': 0.03441973804447152, 'mean_word_length': 1.8589464518937744, 'pattern_counts': {'":': 8, '<': 3, '<?xml version=': 0, '>': 7, 'https://': 2, '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': '1021353', 'n_tokens_mistral': 2420, 'n_tokens_neox': 2160, 'n_words': 622}