3 <!-- Latest compiled
and minified CSS
-->
4 <link rel
="stylesheet" href
="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.5/css/bootstrap.min.css">
6 <!-- Optional theme
-->
7 <link rel
="stylesheet" href
="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.5/css/bootstrap-theme.min.css">
9 <link rel
="stylesheet" href
="//maxcdn.bootstrapcdn.com/font-awesome/4.3.0/css/font-awesome.min.css">
11 <link rel
="stylesheet" href
="basic.css">
12 <link rel
="stylesheet" href
="dropzone.css">
14 <link href
='http://fonts.googleapis.com/css?family=Oswald' rel
='stylesheet' type
='text/css'>
16 <!-- Latest compiled
and minified JavaScript
-->
17 <script src
="https://code.jquery.com/jquery-2.1.4.min.js"></script
>
18 <script src
="https://cdnjs.cloudflare.com/ajax/libs/jquery-easing/1.3/jquery.easing.min.js"></script
>
19 <script src
="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.5/js/bootstrap.min.js"></script
>
20 <script src
="dropzone.js"></script
>
21 <script src
="form.js"></script
>
25 font
-family
: 'Oswald', sans
-serif
;
33 min
-height
: 100%
; /* Fallback for browsers do NOT support vh unit */
34 min
-height
: 100vh
; /* These two lines are counted as one :-) */
50 image
-rendering
: pixelated
;
54 border
: 2px dashed
#0A8A40;
65 transform
: translateY(-50%
);
70 form fieldset
:not(:first
-of
-type
) {
76 image
-rendering
: pixelated
;
92 -webkit
-transition
: all
0.5s ease
-in
-out
;
93 -moz
-transition
: all
0.5s ease
-in
-out
;
94 -o
-transition
: all
0.5s ease
-in
-out
;
95 transition
: all
0.5s ease
-in
-out
;
99 .text
-scroll
:hover span
{
104 #edit .text-scroll:hover span {
111 padding
-bottom
: 10px
;
119 #materials .form-control {
123 #materials #custom-materials {
138 border
-bottom
: 2px dashed white
;
143 #spritename::-webkit-input-placeholder {
149 text
-align
: left
!important
;
152 #materials-presets a:hover {
156 #materials-presets a.active {
157 background
-color
: blue
;
160 .text
-scroll a
, #text-scroll a:hover {
161 text
-decoration
: none
;
168 <div id
="menu" class="container-fluid vertical-center">
169 <div
class="col-md-2 col-md-push-4 col-xs-4 col-xs-push-2">
170 <div
class="menu-container">
171 <div
class="text-scroll">
173 <a href
="#upload"><i
class="fa fa-upload"></i
><h2
>UPLOAD
</h2
></a
>
178 <div
class="col-md-2 col-md-push-4 col-xs-4 col-xs-push-2">
179 <div
class="menu-container">
180 <div
class="text-scroll">
182 <a href
="#edit"><i
class="fa fa-edit"></i
><h2
>EDIT
</h2
></a
>
189 <div id
="upload" class="container-fluid vertical-center">
190 <form action
="upload.php" method
="POST" class="form-horizontal">
191 <fieldset id
="upload_fs">
192 <div
class="dropzone" id
="dropzone"></div
>
194 <fieldset id
="materials_fs">
195 <div id
="sprite" class="col-md-2 col-md-push-3"></div
>
196 <div id
="materials" class="col-md-3 col-md-push-4">
199 <div id
="materials-presets">
200 <div
class="list-group">
201 <a
class="list-group-item" id
="bunnings18">Bunnings
18x18mm pine
</a
>
202 <a
class="list-group-item" id
="bunnings42">Bunnings
42x42mm pine
</a
>
205 <input
class="btn btn-success" type
="submit" name
="submit" value
="Calculate">
206 <a
class="btn btn-primary" id
="custom">Custom
</a
>
209 <div id
="custom-materials">
210 <h3
>All measurements in meters
</h3
>
212 <div
class="form-group">
213 <label
for="wood_size" class="control-label col-md-2">Size
:</label
>
214 <div
class="col-md-10"><input id
="wood_size" name
="wood_size" class="form-control" type
="text"></input
></div
>
217 <div
class="form-group">
218 <label
for="wood_length" class="control-label col-md-2">Length
:</label
>
219 <div
class="col-md-10"><input id
="wood_length" name
="wood_length" class="form-control" type
="text"></input
></div
>
222 <div
class="form-group">
223 <label
for="wood_cost" class="control-label col-md-2">Cost
:</label
>
224 <div
class="col-md-10"><input id
="wood_cost" name
="wood_cost" class="form-control" type
="text"></input
></div
>
227 <div
class="form-group">
228 <label
for="markup" class="control-label col-md-2">Markup
:</label
>
229 <div
class="col-md-10"><input id
="markup" name
="markup" class="form-control" type
="text" value
="1.5"></input
></div
>
232 <input
class="btn btn-success" type
="submit" name
="submit" value
="Calculate">
233 <a href
="#" class="btn btn-primary" id
="presets">Presets
</a
>
240 <div id
="edit" class="container-fluid vertical-center">
241 <div
class="col-xs-8 col-xs-push-2">
242 <?php
foreach(glob("uploads/*.txt") as $file): ?
>
243 <?php
$vars = unserialize(file_get_contents($file)); ?
>
244 <?php
$hash = basename($file, ".txt"); ?
>
245 <div
class="col-lg-4 col-sm-6 col-xs-12">
246 <div
class="text-scroll thumbnail">
248 <a href
="upload.php?sprite=<?php echo $hash; ?>">
249 <img src
="uploads/<?php echo $hash; ?>.png" class="img-responsive">
251 <h2
><?php
echo $vars['spritename']; ?
></h2
>
259 Dropzone
.options
.dropzone
= {
261 thumbnailHeight
: 120,
263 this
.on("success", function(file
, response
) {
264 $
("#sprite").append('<img src="uploads/' + response +
'.png"><input type="hidden" name="hash" value="' + response +
'"></input> <input id="spritename" name="spritename" class="form-control" type="text" placeholder="Name" autocomplete="off"></input>');
267 this
.on("complete", function(file
) {
268 setTimeout(function() {
269 fs_complete($
("#upload_fs"));
275 $
("#custom").click(function(e
) {
277 $
("#materials-presets").fadeOut("slow", function() {
278 $
("#custom-materials").fadeIn("slow");
282 $
("#presets").click(function(e
) {
284 $
("#custom-materials").fadeOut("slow", function() {
285 $
("#materials-presets").fadeIn("slow");
290 $
("#materials-presets .list-group a").click(function() {
291 $
("#materials-presets a").removeClass("active");
292 $
(this
).addClass("active");
294 switch($
(this
).attr('id')) {
296 $
("#wood_size").val("0.018");
297 $
("#wood_length").val("2.4");
298 $
("#wood_cost").val("9.59");
301 $
("#wood_size").val("0.042");
302 $
("#wood_length").val("2.4");
303 $
("#wood_cost").val("14.83");