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 :-) */
44 image
-rendering
: pixelated
;
48 border
: 2px dashed
#0A8A40;
59 transform
: translateY(-50%
);
64 form fieldset
:not(:first
-of
-type
) {
70 image
-rendering
: pixelated
;
81 #menu-container div span{
83 -webkit
-transition
: all
0.5s ease
-in
-out
;
84 -moz
-transition
: all
0.5s ease
-in
-out
;
85 -o
-transition
: all
0.5s ease
-in
-out
;
86 transition
: all
0.5s ease
-in
-out
;
91 #menu-container div:hover span{
100 #materials .form-control {
104 #materials #custom-materials {
119 border
-bottom
: 2px dashed white
;
124 #spritename::-webkit-input-placeholder {
130 text
-align
: left
!important
;
133 #materials-presets a:hover {
137 #materials-presets a.active {
138 background
-color
: blue
;
144 <div id
="menu" class="container-fluid vertical-center">
145 <div
class="col-md-2 col-md-push-4 col-xs-4 col-xs-push-2">
146 <div id
="menu-container">
149 <i
class="fa fa-upload"></i
><h2
>UPLOAD
</h2
>
154 <div
class="col-md-2 col-md-push-4 col-xs-4 col-xs-push-2">
155 <div id
="menu-container">
158 <i
class="fa fa-edit"></i
><h2
>EDIT
</h2
>
165 <div id
="upload" class="container-fluid vertical-center">
166 <form action
="upload.php" method
="POST" class="form-horizontal">
167 <fieldset id
="upload_fs">
168 <div
class="dropzone" id
="dropzone"></div
>
170 <fieldset id
="materials_fs">
171 <div id
="sprite" class="col-md-2 col-md-push-3"></div
>
172 <div id
="materials" class="col-md-3 col-md-push-4">
175 <div id
="materials-presets">
176 <div
class="list-group">
177 <a
class="list-group-item" id
="bunnings18">Bunnings
18x18mm pine
</a
>
178 <a
class="list-group-item" id
="bunnings42">Bunnings
42x42mm pine
</a
>
181 <input
class="btn btn-success" type
="submit" name
="submit" value
="Calculate">
182 <a
class="btn btn-primary" id
="custom">Custom
</a
>
185 <div id
="custom-materials">
186 <h3
>All measurements in meters
</h3
>
188 <div
class="form-group">
189 <label
for="wood_size" class="control-label col-md-2">Size
:</label
>
190 <div
class="col-md-10"><input id
="wood_size" name
="wood_size" class="form-control" type
="text"></input
></div
>
193 <div
class="form-group">
194 <label
for="wood_length" class="control-label col-md-2">Length
:</label
>
195 <div
class="col-md-10"><input id
="wood_length" name
="wood_length" class="form-control" type
="text"></input
></div
>
198 <div
class="form-group">
199 <label
for="wood_cost" class="control-label col-md-2">Cost
:</label
>
200 <div
class="col-md-10"><input id
="wood_cost" name
="wood_cost" class="form-control" type
="text"></input
></div
>
203 <div
class="form-group">
204 <label
for="markup" class="control-label col-md-2">Markup
:</label
>
205 <div
class="col-md-10"><input id
="markup" name
="markup" class="form-control" type
="text" value
="1.5"></input
></div
>
208 <input
class="btn btn-success" type
="submit" name
="submit" value
="Calculate">
209 <a href
="#" class="btn btn-primary" id
="presets">Presets
</a
>
216 <div id
="edit" class="container-fluid vertical-center">
217 <div
class="col-xs-8 col-xs-push-2">
218 <?php
foreach(glob("uploads/*.txt") as $file): ?
>
219 <?php
$vars = unserialize(file_get_contents($file)); ?
>
220 <?php
$hash = basename($file, ".txt"); ?
>
221 <div
class="col-lg-4 col-sm-6 col-xs-12">
222 <a href
="upload.php?sprite=<?php echo $hash; ?>">
223 <img src
="uploads/<?php echo $hash; ?>.png" class="thumbnail img-responsive">
230 Dropzone
.options
.dropzone
= {
232 thumbnailHeight
: 120,
234 this
.on("success", function(file
, response
) {
235 $
("#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>');
238 this
.on("complete", function(file
) {
239 setTimeout(function() {
240 fs_complete($
("#upload_fs"));
246 $
("#custom").click(function(e
) {
248 $
("#materials-presets").fadeOut("slow", function() {
249 $
("#custom-materials").fadeIn("slow");
253 $
("#presets").click(function(e
) {
255 $
("#custom-materials").fadeOut("slow", function() {
256 $
("#materials-presets").fadeIn("slow");
261 $
("#materials-presets .list-group a").click(function() {
262 $
("#materials-presets a").removeClass("active");
263 $
(this
).addClass("active");
265 switch($
(this
).attr('id')) {
267 $
("#wood_size").val("0.018");
268 $
("#wood_length").val("2.4");
269 $
("#wood_cost").val("9.59");
272 $
("#wood_size").val("0.042");
273 $
("#wood_length").val("2.4");
274 $
("#wood_cost").val("14.83");