-
Notifications
You must be signed in to change notification settings - Fork 0
/
index.html
executable file
·98 lines (75 loc) · 2.67 KB
/
index.html
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
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
<!DOCTYPE HTML>
<html lang="en">
<head>
<title>jQuery Three :: Earth</title>
<meta charset="utf-8">
<!-- common styles in examples -->
<link rel="stylesheet" href="assets/css/styles.css" type="text/css" media="screen">
<style type="text/css">
scene {
background-image: url(assets/img/skybox/stars/px.jpg), url(assets/img/skybox/stars/nx.jpg), url(assets/img/skybox/stars/py.jpg), url(assets/img/skybox/stars/ny.jpg), url(assets/img/skybox/stars/pz.jpg), url(assets/img/skybox/stars/nz.jpg);
}
#main-cam {
-webkit-transform: translate3d(0, 0, 1000px);
/* -webkit-backface-visibility: hidden;
-webkit-perspective: 1000; */
}
.earth {
-webkit-transform: translate3d(0, 0, 0);
background-image: url(assets/img/planets/earth/earth_geography_1k.jpg);
}
.atmosphere {
-webkit-transform: translate3d(0, 0, 1px);
background-image: url(assets/img/planets/earth/earth_atmosphere_1k.png);
}
@-moz-keyframes rotate360 {
from { -moz-transform: rotateY(0deg); }
to { -moz-transform: rotateY(360deg); }
}
@-webkit-keyframes rotate360 {
from { -webkit-transform: rotateY(0deg); }
to { -webkit-transform: rotateY(360deg); }
}
@keyframes rotate360 {
from { transform:rotateY(0deg); }
to { transform:rotateY(360deg); }
}
.rotating {
-webkit-animation: rotate360 60s linear infinite;
-moz-animation: rotate360 60s linear infinite;
animation: rotate360 60s linear infinite;
}
.rotating-inner {
-webkit-animation: rotate360 100s linear infinite;
-moz-animation: rotate360 100s linear infinite;
animation: rotate360 100s linear infinite;
}
</style>
</head>
<body>
<header>
</header>
<div id="main">
<scene id="first">
<camera id="main-cam" class="perspective" data-fov="30" data-far="4000"></camera>
<sphere class="earth rotating-inner" data-radius="200" data-segments="40" data-rings="30"></sphere>
<sphere class="atmosphere rotating" data-radius="205" data-segments="40" data-rings="30"></sphere>
<solar-system scale="0.0001"></solar-system>
</scene>
</div>
<!-- deps -->
<script type="text/javascript" src="//ajax.googleapis.com/ajax/libs/jquery/2.1.1/jquery.min.js"></script>
<script type="text/javascript" src="assets/js/libs/three.min.js"></script>
<!-- lib -->
<script type="text/javascript" src="assets/js/libs/jquery.three.js"></script>
<!-- helpers -->
<script type="text/javascript" src="assets/js/helpers/lookaround.js"></script>
<!-- logic -->
<script type="text/javascript">
// initiate 3d environemnt
$("#main").three();
// add event listener
$("#main").on("update", LookArround);
</script>
</body>
</html>