-
Notifications
You must be signed in to change notification settings - Fork 1
/
index.php
264 lines (205 loc) · 8.89 KB
/
index.php
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
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
<!DOCTYPE html>
<?php
// Require functions.php, which includes things you need for facebook and other helper methods
require_once('functions.php');
require_once('fileUploads.php');
?>
<html lang="en">
<head>
<meta charset="utf-8">
<title>MP6 Mosaic Creator - Designed by Matthew Dierker</title>
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<meta name="description" content="Create beautiful mosaic images using your own pictures, free!">
<meta name="author" content="Matthew Dierker">
<!-- Le styles -->
<link href="css/bootstrap.css" rel="stylesheet">
<link href="css/style.css" rel="stylesheet">
<link href="css/bootstrap-responsive.css" rel="stylesheet">
<!-- Le HTML5 shim, for IE6-8 support of HTML5 elements -->
<!--[if lt IE 9]>
<script src="http://html5shim.googlecode.com/svn/trunk/html5.js"></script>
<![endif]-->
</head>
<body>
<div class="navbar navbar-fixed-top">
<div class="navbar-inner">
<div class="container">
<!-- This is for mobile... I think -->
<a class="btn btn-navbar" data-toggle="collapse" data-target=".nav-collapse">
<span class="icon-bar"></span>
<span class="icon-bar"></span>
<span class="icon-bar"></span>
</a>
<a class="brand" href="#">MP6.3 Mosaic Creator</a>
<div class="nav-collapse">
<ul class="nav">
<li class="active"><a href="#">Home</a></li>
<li class="dropdown">
<a class ="dropdown-toggle" data-toggle="dropdown" href="https://wiki.engr.illinois.edu/display/cs225/MP+6">Original MP Spec <b class="caret"></b></a>
<ul class="dropdown-menu">
<li><a href="https://wiki.engr.illinois.edu/display/cs225/MP+6.1">MP 6.1 (Part 1)</a></li>
<li><a href="https://wiki.engr.illinois.edu/display/cs225/MP+6.2">MP 6.2 (Part 2)</a></li>
</ul>
</li>
<!-- <li><a href="#contact">Contact</a></li> -->
</ul>
</div><!--/.nav-collapse -->
</div>
</div>
</div>
<div class="container-fluid">
<div class="row-fluid">
<div class="span8">
<div class="hero-unit">
<h1>Create your own Mosaic!</h1>
<p>Use your own images to make a mosaic, like these! <b>To get started, just login on the right.</b></p>
<div class="onLogoutSlide hide">
<img src="img/mosaic-sample.png"> <img src="img/mosaic-sample.png"><br><br>
<a class="btn btn-primary btn-large" href="img/mosaic.png">See them bigger!</a>
</div>
<div class="onLogoutHide onLoginSlideIn hide">
<a class="btn btn-primary btn-large" href="img/mosaic.png">See an example!</a>
</div>
</div>
<!-- Start Step 1, File Uploading -->
<div id="fileUpload" class="fileUpload step hide">
<h2>Upload your Images</h2>
<form id="fileupload" action="upload-plugin/server/" method="POST" enctype="multipart/form-data">
<!-- The fileupload-buttonbar contains buttons to add/delete files and start/cancel the upload -->
<div class="row fileupload-buttonbar">
<div class="span7">
<!-- The fileinput-button span is used to style the file input field as button -->
<span class="btn btn-success fileinput-button">
<i class="icon-plus icon-white"></i>
<span>Add files...</span>
<input type="file" name="files[]" multiple>
</span>
<button type="submit" class="btn btn-primary start">
<i class="icon-upload icon-white"></i>
<span>Start upload</span>
</button>
<button type="reset" class="btn btn-warning cancel">
<i class="icon-ban-circle icon-white"></i>
<span>Cancel upload</span>
</button>
<button type="button" class="btn btn-danger delete">
<i class="icon-trash icon-white"></i>
<span>Delete</span>
</button>
<input type="checkbox" class="toggle">
</div>
<div class="span5">
<!-- The global progress bar -->
<div class="progress progress-success progress-striped active fade">
<div class="bar" style="width:0%;"></div>
</div>
</div>
</div>
<!-- The loading indicator is shown during image processing -->
<div class="fileupload-loading"></div>
<br>
<!-- The table listing the files available for upload/download -->
<table class="table table-striped"><tbody class="files" data-toggle="modal-gallery" data-target="#modal-gallery"></tbody></table>
</form>
<?php includeFileUploadImageGallery(); ?>
<?php includeFileUploadTemplates(); ?>
</div>
<!-- End File Upload -->
<!-- Start Select Source -->
<div id="selectSource" class="selectSource step hide">
<h2>Select the source image</h2>
<p>The source image is the one that the mosaic is made out of, and does not have to be resized!</p>
<div id="selectSourceGallery" class="selectSourceGallery">
</div>
</div>
<!-- End Select Source -->
<!-- Start Format Images -->
<div id="createMosaic" class="createMosaic step hide">
<h2>Create your Mosaic!</h2>
<p>It's time to make the mosaic! The first step is to format your images, and then we're ready to begin.</p>
<div id="createMosaicDisplay">
<div id="createMosaicNeedsSourceImage" class="alert alert-error hide">
<b>Uh oh!</b> It looks like you've skipped a step. Go back to step 2 and select a source image first!
</div>
<div id="formatImagesStart" class="formatImagesStart">
<p>
<a href="javascript:formatImages();" class="btn btn-large btn-primary">Format Images & Create Mosaic »</a>
</p>
</div>
<div id="formatImagesStatus" class="formatImagesStatus hide">
<div class="progress progress-striped active">
<div id="formatImagesProgressBar" class="bar" style="width: 0%"></div>
</div>
<h4><b>Progress: </b><span id="formatImagesProgressStatus">0 / ?</span> images processed</h4>
</div>
<div id="processMosaic" class="processMosaic hide">
<h3>Image Formatting Complete!</h3>
<h4>Creating your mosaic... <img src="img/pacman-loader.gif"></h4>
</div>
</div>
</div>
<!-- End Format Images -->
</div>
<div class="span4">
<div class="loginContainer roundedBox">
<div class="onLoginHide onLogoutHide">
Loading... <img src="img/pacman-loader.gif">
</div>
<div class="loginBox onLoginHide onLogoutFadeIn hide" id="loginBox">
<h3>Login</h3>
<p>We'll need you to login to facebook to start! If you don't have a facebook account, you're out of luck for now. Sorry! (but feel free to <a href="http://facebook.com">register</a>!)</p>
<div class="fb-login-button">Login with Facebook</div>
</div>
<div class="logoutBox onLogoutHide onLoginFadeIn hide" id="logoutBox">
<h3>
Welcome <a class="fb-profile-link"><span class="fb-first-name"></span></a>!
</h3>
<p>
<a class="btn btn-mini" href="javascript:logout();">Logout</a>
</p>
</div>
</div>
<div class="stepsContainer roundedBox onLoginFade hide" style="margin-top: 40px">
<u><h2>Image Creation</h2></u>
<?php
makeStep('1) Upload Images', 'Upload your images to the server', 'fileUploadStep');
makeStep('2) Select Source', 'Pick one of your images to be the mosaic\'s background', 'selectSourceStep');
makeStep('3) Format Images', 'Format your uploads so they can be included in a mosaic', 'createMosaicStep');
?>
</div>
</div>
</div>
</div> <!-- /container -->
<!-- Le javascript
================================================== -->
<!-- Placed at the end of the document so the pages load faster -->
<script src="http://ajax.googleapis.com/ajax/libs/jquery/1.7.2/jquery.min.js"></script>
<script src="https://ajax.googleapis.com/ajax/libs/jqueryui/1.8.18/jquery-ui.min.js"></script>
<script src="js/bootstrap.min.js"></script>
<script src="js/bootstrap-dropdown.js"></script>
<script src="js/jquery.color.js"></script>
<!-- Start File Upload Scripts -->
<?php includeFileUploadScripts(); ?>
<!-- End File Upload Scripts -->
<script type="text/javascript" src="js/home.js"></script>
<div id="fb-root"></div>
<script>
window.fbAsyncInit = function() {
FB.init({
appId : <?php echo FACEBOOK_APP_ID; ?>,
status : true,
cookie : true,
xfbml : true,
oauth : true,
});
facebookInitComplete();
};
(function(d){
var js, id = 'facebook-jssdk'; if (d.getElementById(id)) {return;}
js = d.createElement('script'); js.id = id; js.async = true;
js.src = "//connect.facebook.net/en_US/all.js";
d.getElementsByTagName('head')[0].appendChild(js);
}(document));
</script>
</body>
</html>