3 BouncingTextBox = Utilities.createSubclass(BouncingParticle,
4 function(stage, sampleText)
6 BouncingParticle.call(this, stage);
8 this.element = document.createElement("div");
9 this.element.classList.add('particle');
10 this.element.style.width = this.size.x + "px";
11 this.element.style.height = this.size.y + "px";
12 this.element.textContent = sampleText;
14 stage.element.appendChild(this.element);
20 this.element.style.left = this.position.x + "px";
21 this.element.style.top = this.position.y + "px";
24 animate: function(timeDelta)
26 BouncingParticle.prototype.animate.call(this, timeDelta);
31 BouncingTextBoxStage = Utilities.createSubclass(BouncingParticlesStage,
34 BouncingParticlesStage.call(this);
35 this._sampleText = document.getElementById('sample-text').textContent;
38 createParticle: function()
40 return new BouncingTextBox(this, this._sampleText);
43 particleWillBeRemoved: function(particle)
45 particle.element.remove();
49 BouncingTextBoxBenchmark = Utilities.createSubclass(Benchmark,
52 Benchmark.call(this, new BouncingTextBoxStage(), options);
56 window.benchmarkClass = BouncingTextBoxBenchmark;