<commit_before>var base = 'http://www.freedomjs.org/?user=';
var colors = [
    '#041022', '#111d2f',
    '#05080d', '#031419',
    '#070524', '#091321',
    '#163038', '#0f093e',
    '#051010', '#041124',
    '#171929', '#0c1d36',
    '#011722', '#061233',
    '#050d1a', '#0e2b2e',
    '#040f21', '#0e2240',
    '#0d142a', '#051c24'
];
var brights = [
    '#0000ff', '#0033ff',
    '#00ff00', '#00cc33',
    '#3434ff', '#2098ff',
    '#21e831', '#0df088',
    '#00ff14', '#baff00',
    '#6cff00', '#63cb2c',
];

var container;
var stage;
var nodes = {};
var uqueue = [];

window.addEventListener('load', function () {
  document.body.className = 'loaded';
  container = document.getElementById('loading');
}, false);

window.addEventListener('message', function (msg) {
  if (msg.data.event === 'status' && msg.data.online === true) {
    document.body.className = 'online';
    reset();
    setupStage();
  } else if (msg.data.event === 'status') {
    document.body.className = 'okay';
    container.innerHTML = '<div class="striped">' +
      (msg.data.online || 'Connecting') + '</div>';
    reset();
  } else if (msg.data.event === 'user') {
    updateUsers(msg.data.users);
  } else {
    console.warn('ignored ' + msg.data.event);
  }
}, false);

window.addEventListener('resize', function() {
  updateUsers(nodes);
}, false);

var setupStage = function () {
  container.innerHTML = '';
  var cb = typeof stage === 'function' ? stage : function() {};
  stage = Sprite3D.stage(container);
  
  // Background.
  var panels = [];
  for (var i = 0; i < 20; i++) {
    var sprite = Sprite3D.create(".panel").x(i * 70).z(0);
    panels.push(sprite);
    stage.appendChild(sprite);
    sprite.update();
  }
  setInterval(permute.bind({}, panels), 2000);
  cb();
};

var permute = function (panels) {
  var first = Math.floor(Math.random() * panels.length);
  var second = Math.floor(Math.random() * panels.length);
  var out = panels[first];
  panels[first] = panels[second];
  panels[second] = out;
  for (var i = 0; i < panels.length; i++) {
    panels[i].css(
			"Transition",
			"all "+(1+2*Math.random())+"s ease-in-out",
			true
		).x(i * 70)
        .css('width', Math.random() * 150 + 'px')
        .css('background', colors[Math.floor(Math.random() * 20)])
        .rotationY(Math.random()*160 - 80)
        .rotationZ(Math.random()*10 - 5)
        .update();
  }
};

var updateUsers = function (users) {
  if (!stage || typeof stage === 'function') {
    stage = updateUsers.bind({}, users);
    return;
  }
  for (var user in users) {
    if (users.hasOwnProperty(user) && !nodes[user]) {
      enter(user, users[user]);
    }
  }
  for (var node in nodes) {
    if (nodes.hasOwnProperty(node) && !users[node]) {
      nodes[node].exit();
    }
  }
  for (var i in nodes) {
    if (nodes.hasOwnProperty(i)) {
      nodes[i].layout().update();
    }
  }
};

var reset = function() {
  for (var node in nodes) {
    if (nodes.hasOwnProperty(node)) {
      delete nodes[node].exit(true);
    }
  }
  nodes = {};
};

var User = function (name) {
  this.name = name;
  this.phase = 'entered';
  this.image = qr.toDataURL({
    value: base + name,
    background: 'rgba(255,0,0,0)'<commit_msg>spurious delete<commit_after>var base = 'http://www.freedomjs.org/?user=';
var colors = [
    '#041022', '#111d2f',
    '#05080d', '#031419',
    '#070524', '#091321',
    '#163038', '#0f093e',
    '#051010', '#041124',
    '#171929', '#0c1d36',
    '#011722', '#061233',
    '#050d1a', '#0e2b2e',
    '#040f21', '#0e2240',
    '#0d142a', '#051c24'
];
var brights = [
    '#0000ff', '#0033ff',
    '#00ff00', '#00cc33',
    '#3434ff', '#2098ff',
    '#21e831', '#0df088',
    '#00ff14', '#baff00',
    '#6cff00', '#63cb2c',
];

var container;
var stage;
var nodes = {};
var uqueue = [];

window.addEventListener('load', function () {
  document.body.className = 'loaded';
  container = document.getElementById('loading');
}, false);

window.addEventListener('message', function (msg) {
  if (msg.data.event === 'status' && msg.data.online === true) {
    document.body.className = 'online';
    reset();
    setupStage();
  } else if (msg.data.event === 'status') {
    document.body.className = 'okay';
    container.innerHTML = '<div class="striped">' +
      (msg.data.online || 'Connecting') + '</div>';
    reset();
  } else if (msg.data.event === 'user') {
    updateUsers(msg.data.users);
  } else {
    console.warn('ignored ' + msg.data.event);
  }
}, false);

window.addEventListener('resize', function() {
  updateUsers(nodes);
}, false);

var setupStage = function () {
  container.innerHTML = '';
  var cb = typeof stage === 'function' ? stage : function() {};
  stage = Sprite3D.stage(container);
  
  // Background.
  var panels = [];
  for (var i = 0; i < 20; i++) {
    var sprite = Sprite3D.create(".panel").x(i * 70).z(0);
    panels.push(sprite);
    stage.appendChild(sprite);
    sprite.update();
  }
  setInterval(permute.bind({}, panels), 2000);
  cb();
};

var permute = function (panels) {
  var first = Math.floor(Math.random() * panels.length);
  var second = Math.floor(Math.random() * panels.length);
  var out = panels[first];
  panels[first] = panels[second];
  panels[second] = out;
  for (var i = 0; i < panels.length; i++) {
    panels[i].css(
			"Transition",
			"all "+(1+2*Math.random())+"s ease-in-out",
			true
		).x(i * 70)
        .css('width', Math.random() * 150 + 'px')
        .css('background', colors[Math.floor(Math.random() * 20)])
        .rotationY(Math.random()*160 - 80)
        .rotationZ(Math.random()*10 - 5)
        .update();
  }
};

var updateUsers = function (users) {
  if (!stage || typeof stage === 'function') {
    stage = updateUsers.bind({}, users);
    return;
  }
  for (var user in users) {
    if (users.hasOwnProperty(user) && !nodes[user]) {
      enter(user, users[user]);
    }
  }
  for (var node in nodes) {
    if (nodes.hasOwnProperty(node) && !users[node]) {
      nodes[node].exit();
    }
  }
  for (var i in nodes) {
    if (nodes.hasOwnProperty(i)) {
      nodes[i].layout().update();
    }
  }
};

var reset = function() {
  for (var node in nodes) {
    if (nodes.hasOwnProperty(node)) {
      nodes[node].exit(true);
    }
  }
  nodes = {};
};

var User = function (name) {
  this.name = name;
  this.phase = 'entered';
  this.image = qr.toDataURL({
    value: base + name,
    background: 'rgba(255,0,0,0)'
{'fraction_non_alphanumeric': 0.2104769351055512, 'fraction_numerical': 0.05754495699765442, 'mean_word_length': 3.134453781512605, 'pattern_counts': {'":': 0, '<': 11, '<?xml version=': 0, '>': 7, 'https://': 0, 'lorem ipsum': 0, 'www.': 2, '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': '4405893', 'n_tokens_mistral': 2520, 'n_tokens_neox': 2351, 'n_words': 479}