-
Notifications
You must be signed in to change notification settings - Fork 6
/
web.html
181 lines (161 loc) · 6.2 KB
/
web.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
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<title>StarboundEd – Web Viewer</title>
<link rel="stylesheet" href="//netdna.bootstrapcdn.com/bootstrap/3.1.1/css/bootstrap.min.css">
<link rel="stylesheet" href="//netdna.bootstrapcdn.com/font-awesome/4.0.3/css/font-awesome.min.css">
<meta property="og:image" content="http://i.imgur.com/GqHZ82O.jpg">
<style>
canvas, img {
image-rendering: -moz-crisp-edges;
image-rendering: -webkit-optimize-contrast;
image-rendering: pixelated;
}
#progress {
background: #c00;
box-shadow: 0 0 5px #f00;
height: 5px;
left: 0;
margin-bottom: 0;
position: absolute;
top: 50px;
transition: width .7s;
z-index: 1031;
}
#viewport {
overflow: hidden;
position: absolute;
top: 50px;
right: 0;
bottom: 0;
left: 0;
}
.btn-file {
position: relative;
overflow: hidden;
}
.btn-file input[type=file] {
position: absolute;
top: 0;
right: 0;
min-width: 100%;
min-height: 100%;
font-size: 999px;
text-align: right;
filter: alpha(opacity=0);
opacity: 0;
outline: none;
background: white;
cursor: inherit;
display: block;
}
</style>
<script src="//code.jquery.com/jquery-1.11.0.min.js"></script>
<script src="//netdna.bootstrapcdn.com/bootstrap/3.1.1/js/bootstrap.min.js"></script>
<script src="//cdn.ravenjs.com/1.1.11/jquery,native/raven.min.js"></script>
<script>
Raven.config('https://[email protected]/19811', {}).install();
</script>
</head>
<body>
<nav class="navbar navbar-inverse navbar-fixed-top">
<div class="container">
<a class="navbar-brand" href="#">StarboundEd</a>
<button type="button" class="btn btn-success navbar-btn" data-toggle="modal" data-target="#world-selector">Open world</button>
<p class="navbar-text navbar-right" id="world-status">No world loaded</p>
</div>
</nav>
<div id="progress" style="display: none; width: 0;"></div>
<div class="modal fade" id="directory-selector">
<div class="modal-dialog">
<div class="modal-content">
<div class="modal-header">
<h4 class="modal-title">Choose your Starbound directory</h4>
</div>
<div class="modal-body">
<p>This world viewer doesn't distribute any of Starbound's resources,
so to be able to render the world, it needs to be able to read assets
from Starbound's directory on your disk.</p>
<p id="directory-status">
<span class="glyphicon glyphicon-question-sign"></span>
<strong>Please choose your Starbound directory</strong>
</p>
<p><input id="directory" type="file" webkitdirectory></p>
<p class="small mac" style="display: none;"><strong>Tip:</strong> Copy
the path below, then click <em>Choose File</em>, then hold down ⌘+⇧+G to
open the <em>Go to folder</em> dialog, then paste the path into it.<br>
<code>~/Library/Application Support/Steam/SteamApps/common</code></p>
<p class="small windows" style="display: none;"><strong>Tip:</strong>
The Starbound directory is generally located in the following location:<br>
<code>C:\Program Files (x86)\Steam\SteamApps\common</code></p>
</div>
<div class="modal-footer">
<button id="load-directory" type="button" class="btn btn-primary" disabled>Load assets</button>
</div>
</div>
</div>
</div>
<div class="modal fade" id="file-selector">
<div class="modal-dialog">
<div class="modal-content">
<div class="modal-header">
<h4 class="modal-title">Choose your Starbound assets file</h4>
</div>
<div class="modal-body">
<p>This world viewer doesn't distribute any of Starbound's resources,
so to be able to render the world, it needs to be able to read from
Starbound's <code>assets/packed.pak</code> file on your disk.</p>
<p id="file-status">
<span class="glyphicon glyphicon-question-sign"></span>
<strong>Please choose Starbound's <code>packed.pak</code> file</strong>
</p>
<p><input id="file" type="file"></p>
<p class="small mac" style="display: none;"><strong>Tip:</strong> Copy
the path below, then click <em>Choose File</em>, then hold down ⌘+⇧+G to
open the <em>Go to folder</em> dialog, then paste the path into it.<br>
<code>~/Library/Application Support/Steam/SteamApps/common/Starbound/assets</code></p>
<p class="small windows" style="display: none;"><strong>Tip:</strong>
The <code>packed.pak</code> file is generally located in the following location:<br>
<code>C:\Program Files (x86)\Steam\SteamApps\common\Starbound\assets</code></p>
</div>
<div class="modal-footer">
<button id="load-file" type="button" class="btn btn-primary" disabled>Load assets</button>
</div>
</div>
</div>
</div>
<div class="modal fade" id="world-selector">
<div class="modal-dialog">
<div class="modal-content">
<div class="modal-header">
<button type="button" class="close" data-dismiss="modal">×</button>
<h4 class="modal-title">Choose a world or ship</h4>
</div>
<div class="modal-body">
<p>
<span class="btn btn-file btn-sm btn-success">
Add world files <input id="add-world-files" type="file" multiple>
</span>
</p>
<div class="list-group" id="worlds"></div>
</div>
<div class="modal-footer">
<button type="button" class="btn btn-default" data-dismiss="modal">Cancel</button>
</div>
</div>
</div>
</div>
<div id="viewport"></div>
<script>
(function(i,s,o,g,r,a,m){i['GoogleAnalyticsObject']=r;i[r]=i[r]||function(){
(i[r].q=i[r].q||[]).push(arguments)},i[r].l=1*new Date();a=s.createElement(o),
m=s.getElementsByTagName(o)[0];a.async=1;a.src=g;m.parentNode.insertBefore(a,m)
})(window,document,'script','//www.google-analytics.com/analytics.js','ga');
ga('create', 'UA-48819902-1', 'blixt.github.io');
ga('send', 'pageview');
</script>
<script type="text/javascript" src="//dl1d2m8ri9v3j.cloudfront.net/releases/1.2.2/tracker.js" data-customer="1d436090e6354c9696601c99118e75d9"></script>
<script src="build/web.js"></script>
</body>
</html>