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 <!-- Latest compiled and minified JavaScript --
>
12 <script src=
"https://code.jquery.com/jquery-2.1.4.min.js"></script>
13 <script src=
"https://maxcdn.bootstrapcdn.com/bootstrap/3.3.5/js/bootstrap.min.js"></script>
17 background-color: blue;
20 .sprite table.outline td {
21 border:
1px solid red;
34 border-left:
2px solid transparent;
38 border-right:
2px solid transparent;
42 border-top:
2px solid transparent;
46 border-bottom:
2px solid transparent;
49 .sprite.measurements .line-left {
50 border-left:
2px solid black;
53 .sprite.measurements .line-right {
54 border-right:
2px solid black;
57 .sprite.measurements .line-top {
58 border-top:
2px solid black;
61 .sprite.measurements .line-bottom {
62 border-bottom:
2px solid black;
65 .sprite.measurements .dimension-top {
66 transform: translate(
50%, -
50%);
69 .sprite.measurements .dimension-bottom {
70 transform: translate(
50%,
50%);
73 .sprite.measurements .dimension-left {
74 transform: translateY(
50%);
77 .sprite.measurements .dimension-right {
78 transform: translateY(
50%);
81 .sprite.measurements .dimension-left .line-left, .sprite.measurements .dimension-right .line-right {
95 .sprite.measurements .height, .sprite.measurements .width {
100 border:
1px solid red;
115 <div class=
"container-fluid">
116 <h1><a id=
"home" href=
"/" title=
"Return"><i class=
"fa fa-arrow-left"></i></a><?php echo $name;
?></h1>
118 <ul class=
"nav nav-tabs">
119 <li class=
"nav active"><a href=
"#comparison" data-toggle=
"tab">Comparison
</a></li>
120 <li class=
"nav"><a href=
"#cost" data-toggle=
"tab">Cost
</a></li>
121 <li class=
"nav"><a href=
"#materials" data-toggle=
"tab">Materials
</a></li>
124 <div class=
"tab-content">
125 <div class=
"tab-pane fade in active" id=
"comparison">
126 <div id=
"original_sprite">
127 <div class=
"col-md-6">
129 <div class=
"sprite col-md-8"><?php echo $original_sprite;
?></div>
130 <div class=
"colour_table col-md-4"><?php echo $original_colour_table;
?></div>
132 <div class=
"col-md-6">
133 <h2>Ironlack approximation
</h2>
134 <div class=
"sprite col-md-8"><?php echo $ironlak_sprite;
?></div>
135 <div class=
"colour_table col-md-4"><?php echo $ironlak_colour_table;
?></div>
139 <div class=
"tab-pane fade in" id=
"cost">
140 <div class=
"col-md-6">
142 <div class=
"sprite measurements col-md-8">
143 <?php echo $ironlak_sprite;
?>
145 <div class=
"col-md-4">
146 <h3>Cost of materials
</h3>
147 <?php $materials = $cost_of_lumber + $cost_of_cans;
?>
148 <?php $materials_used = $value_of_lumber_used + $value_of_can_used;
?>
149 <table class=
"table">
152 <td><?php echo $cost_of_lumber;
?></td>
156 <td><?php echo $cost_of_cans;
?></td>
160 <td><strong><?php echo $materials;
?></strong></td>
164 <h3>Value of materials used
</h3>
165 <table class=
"table">
168 <td><?php echo $value_of_lumber_used;
?></td>
172 <td><?php echo $value_of_can_used;
?></td>
176 <td><strong><?php echo $materials_used;
?></strong></td>
180 <h3>Profit @
<?php echo $markup*
100;
?>% Markup
</h3>
181 <table class=
"table">
184 <td><?php echo $materials_used*$markup;
?></td>
187 <th>Less materials
</th>
188 <td><?php echo $materials_used*$markup - $materials;
?></td>
194 <div class=
"col-md-6">
195 <h2>Materials Breakdown
</h2>
196 <div class=
"col-md-12">
198 <?php echo $spray_can_breakdown;
?>
201 <div class=
"col-md-12">
203 <?php echo $lumber_breakdown;
?>
207 <div class=
"tab-pane fade in" id=
"materials">
208 <div class=
"col-md-6">
210 <div class=
"sprite col-md-8">
211 <?php echo $ironlak_sprite;
?>
213 <div class=
"col-md-4">
214 <h3>Measurements (in m)
</h3>
215 <form action=
"upload.php" method=
"POST" class=
"form-horizontal">
216 <div class=
"form-group">
217 <label for=
"spritename" class=
"control-label col-md-3">Name:
</label>
218 <div class=
"col-md-8"><input id=
"spritename" name=
"spritename" class=
"form-control" type=
"text" value=
"<?php echo $vars['spritename']; ?>"></input></div>
221 <div class=
"form-group">
222 <label for=
"wood_size" class=
"control-label col-md-3">Size:
</label>
223 <div class=
"col-md-8"><input id=
"wood_size" name=
"wood_size" class=
"form-control" type=
"text" value=
"<?php echo $vars['wood_size']; ?>"></input></div>
226 <div class=
"form-group">
227 <label for=
"wood_length" class=
"control-label col-md-3">Length:
</label>
228 <div class=
"col-md-8"><input id=
"wood_length" name=
"wood_length" class=
"form-control" type=
"text" value=
"<?php echo $vars['wood_length']; ?>"></input></div>
231 <div class=
"form-group">
232 <label for=
"wood_cost" class=
"control-label col-md-3">Cost:
</label>
233 <div class=
"col-md-8"><input id=
"wood_cost" name=
"wood_cost" class=
"form-control" type=
"text" value=
"<?php echo $vars['wood_cost']; ?>"></input></div>
236 <div class=
"form-group">
237 <label for=
"markup" class=
"control-label col-md-3">Markup:
</label>
238 <div class=
"col-md-8"><input id=
"markup" name=
"markup" class=
"form-control" type=
"text" value=
"<?php echo $vars['markup']; ?>"></input></div>
241 <input type=
"hidden" name=
"hash" value=
"<?php echo $hash; ?>"></input>
242 <input class=
"btn btn-success" type=
"submit" name=
"submit" value=
"Save">
251 padSprite = function(sprite, width, height) {
255 $(sprite).find('tr').each(function() {
256 $(this).append(
"<td class=\"added\"></td>");
259 $(sprite).find('tr:first td:last').append('
<div class=
"line-top"></div>');
260 $(sprite).find('tr:first td:last').addClass('dimension-top');
262 $(sprite).find('tr:last td:last').append('
<div class=
"line-bottom"></div>');
263 $(sprite).find('tr:last td:last').addClass('dimension-bottom');
265 $(sprite).find('tr').each(function(){
266 $(this).find('td').eq(
0).before('
<td class=
"added"></td>');
269 for (var i=
0; i<$(sprite).find(
"tr:last td").length; i++) {
270 var cells = cells ? cells + '
<td class=
"added"></td>' : '
<tr><td class=
"added"></td>';
272 cells +=
"<td class=\"added\"></td></tr><tr><td class=\"added\"></td><td class=\"line-top width added\" colspan=\"" + width +
"\"><?php echo $sprite_width_cm; ?></td></tr>";
273 $(sprite).find(
"tr:last").after(cells);
275 $(sprite).find('tr:nth-last-child(
2) td:nth-last-child(
2)').append('
<div class=
"line-left"></div>');
276 $(sprite).find('tr:nth-last-child(
2) td:nth-last-child(
2)').addClass('dimension-left');
278 $(sprite).find('tr:nth-last-child(
2) td:first').append('
<div class=
"line-right"></div>');
279 $(sprite).find('tr:nth-last-child(
2) td:first').addClass('dimension-right');
281 $(sprite).find(
"tr:first td:last").after(
"<td class=\"line-left\ height added\" rowspan=\"" + height +
"\"><?php echo $sprite_height_cm; ?></td>")
284 var height = $(
".sprite:first table tr").length;
285 var width = $(
".sprite:first table tr:first td").length;
286 $(
".sprite").each(function() {
287 padSprite($(this), width, height);
291 var pixelSize = Math.floor($(
".sprite:first").width()*
0.75 / $(
".sprite:first table tr:first td").length);
293 $(
".sprite td").width(pixelSize);
294 $(
".sprite td").height(pixelSize);
296 $(window).bind('resize', function(e)
299 $(window).resize(function()
301 clearTimeout(window.resizeEvt);
302 window.resizeEvt = setTimeout(function()
304 var pixelSize = Math.floor($(
".sprite:visible").filter(
":first").width()*
0.75 / $(
".sprite:first table tr:first td").length);
305 //console.log($(
".sprite:visible").filter(
":first").width());
306 //console.log($(
".sprite:first table tr:first td").length)
307 //console.log(pixelSize);
308 $(
".sprite td").width(pixelSize);
309 $(
".sprite td").height(pixelSize);
314 $(
".colour-row" ).hover(function() {
315 var colour = $(this).attr('colour');
316 $(
"." + colour).toggleClass(
"highlighted");
319 function nextTab(elem) {
320 $(elem + ' li.active')
322 .find('a[
data-toggle=
"tab"]')
326 $(document).keypress(function(e) {
328 var active = $(
".nav li.active");
329 var tabs = active.parent().children();
330 tabs.eq((tabs.index(active) +
1) % tabs.length).find('a[
data-toggle=
"tab"]').click();
334 $(
".sprite tr td:not(.added)").toggleClass(
"grid");