{"size": 945, "ext": "js", "max_stars_repo_path": "js/chest-component.js", "max_stars_repo_name": "mkeblx/WebBR", "max_stars_repo_stars_event_min_datetime": "2018-01-10T19:14:11.000Z", "max_stars_repo_stars_event_max_datetime": "2019-12-17T02:38:41.000Z", "max_issues_repo_path": "js/chest-component.js", "max_issues_repo_name": "mkeblx/WebBR", "max_issues_repo_issues_event_min_datetime": "2018-01-10T21:30:29.000Z", "max_issues_repo_issues_event_max_datetime": "2018-01-10T21:30:29.000Z", "max_forks_repo_path": "js/chest-component.js", "max_forks_repo_name": "mkeblx/WebBR", "max_forks_repo_forks_event_min_datetime": null, "max_forks_repo_forks_event_max_datetime": null}
{"max_stars_count": 4, "max_issues_count": 1, "max_forks_count": null, "avg_line_length": 23.625, "max_line_length": 70, "alphanum_fraction": 0.5989417989}
AFRAME.registerComponent('chest', {
  scheme: {
    contents: { type: 'array', default: [] }
  },
  init: function() {
    var data = this.data;
    var el = this.el;

    //console.log(this.el);

    this.geometry = new THREE.BoxBufferGeometry(1,1,1);
    this.material = new THREE.MeshStandardMaterial({color: 0xFFC65D});
    this.mesh = new THREE.Mesh(this.geometry, this.material);

    //this.el.setAttribute('material', { color: 0xff0000 });

    el.setObject3D('mesh', this.mesh);

    //console.log(el.object3D);
    this.setPosition(0, -3);
  },
  update: function(oldData) {
    var data = this.data;
    var el = this.el;

    if (Object.keys(oldData).length === 0) { return; }
  },
  remove: function() {
    this.el.removeObject3D('mesh');
  },
  open: function() {
    // spawn contents
    for (var i = 0; i < contents.length; i++) {

    }
  },
  setPosition: function(x,y) {
    this.el.object3D.position.set(x, 0.5, y);
  }
});