1 /* Copyright 2011 The Dominion of Awesome
2 * See COPYING for licensing information */
6 style: "background-color: #2ab40f",
8 {name: "direction", label: "Direction of Travel", kind: "ListSelector", items: [
9 {caption: "right", value: -1},
10 {caption: "left", value: 1}
12 {name: "speed", label: "Speed", kind: "Slider", minimum: 0.1, maximum: 10, snap: 0.1}
17 {name: "clouds", style: "height: 200px; background-image: url(hacks/Landscape/clouds.png)"},
18 {name: "mountains", style: "height: 200px; background-image: url(hacks/Landscape/mountains.png)"},
19 {name: "trees", style: "height: 200px; background-image: url(hacks/Landscape/trees.png)"}
22 this.inherited(arguments);
27 this.timer = setInterval(this.draw.bind(this), 33);
30 clearInterval(this.timer);
34 this.n += this.direction * this.speed;
37 else if (this.n >= 1600)
40 this.$.clouds.applyStyle("background-position", (this.n * 1.5) + "px top");
41 this.$.mountains.applyStyle("background-position", (this.n * 2.5) + "px top");
42 this.$.trees.applyStyle("background-position", (this.n * 7.5) + "px top");