-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathspacestuff.js
66 lines (66 loc) · 1.44 KB
/
spacestuff.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
var spaceThings = [
{
name:'Moon',
realDistance:0.002,
position:200,
width:220,
height:220,
img:'spacestuff/moon.png'
},
{
name:'Mars',
realDistance:0.52,
position:500,
width:640,
height:524,
img:'spacestuff/mars.png'
},
{
name:'Asteroid Belt',
realDistance:1.7,
position:700,
run:function(el) {
el.style.height = '900px';
el.style.width = "100%";
var pos = 0;
el.style.backgroundPosition = pos+"px 0px";
el.style.backgroundImage = 'url(spacestuff/asteroids.png)';
setInterval(function(){
pos += 2;
el.style.backgroundPosition = pos+"px 0px";
}, 50);
}
},
{
name:'Jupiter',
realDistance:4.2,
position:900,
width:640,
height:524,
img:'spacestuff/jupiter.png'
},
{
name:'Saturn',
realDistance:8.3,
position:1200,
width:640,
height:395,
img:'spacestuff/saturn.png'
},
{
name:'Uranus',
realDistance:20.4,
position:1800,
width:970,
height:1000,
img:'spacestuff/uranus.png'
},
{
name:'Neptune',
realDistance:30,
position:2800,
width:600,
height:588,
img:'spacestuff/neptune.png'
}
];