Commit daf4512ebdd4d86f3faad518e155d2fa4c855210

Authored by Lars Jørgen Fredheim
1 parent cf5654fb

Added distance warning

.htaccess 0 → 100644
  1 +RewriteEngine On
  2 +RewriteCond %{REQUEST_FILENAME} !-f
  3 +RewriteCond %{REQUEST_FILENAME} !-d
  4 +RewriteRule ^(.*)\.html$ /$1 [L,R=301]
0 5 \ No newline at end of file
... ...
css/style.css
... ... @@ -353,7 +353,7 @@ ul li {
353 353 }
354 354  
355 355 #subtotal {
356   - font-size: 10px;
  356 + font-size: 0.8em;
357 357 font-family: Arial, Helvetica, sans-serif;
358 358 }
359 359  
... ... @@ -839,7 +839,7 @@ ul li {
839 839 }
840 840  
841 841 #suggestionsTable tr:hover td{
842   - background-color: green;
  842 + background-color: #ceffbc;
843 843 }
844 844  
845 845 #autoGenInfo {
... ... @@ -937,6 +937,15 @@ ul li {
937 937 font-size: 0.8em;
938 938 }
939 939  
  940 +.infotextonly {
  941 + color: red;
  942 + margin-top: 5px;
  943 + text-align: center;
  944 + font-size: 0.8em;
  945 + font-weight: bold;
  946 + margin-bottom: 10px;
  947 +}
  948 +
940 949 .close {
941 950 position: fixed;
942 951 top: 10px;
... ...
index.html
... ... @@ -42,14 +42,12 @@
42 42 <script src="js/Constants.js"></script>
43 43 <script src="js/Setup.js"></script>
44 44  
45   -
46   - <!-- TODO: Add this before deployment -->
47   - <!-- Warn user on page refresh/exit --
  45 + <!-- Warn user on page refresh/exit -->
48 46 <script type="text/javascript">
49 47 window.onbeforeunload = function() {
50 48 return "Verify page refresh";
51 49 }
52   - </script> -->
  50 + </script>
53 51 <!--------------------------------------------------------------------------------------------------------------------->
54 52  
55 53 </head>
... ... @@ -95,11 +93,11 @@
95 93 </div>
96 94 </div>
97 95  
98   - <!-- REMOVE ------------------------------------------------------------------------------------>
  96 + <!-- HIDE -------------------------------------------------------------------------------------
99 97 <div class="row">
100 98 <button class="btn btn-info center" id="quickBuild" onclick="Setup.quickBuild()">4 x 4</button>
101 99 </div>
102   - <!---------------------------------------------------------------------------------------------->
  100 + <!--------------------------------------------------------------------------------------------->
103 101  
104 102 <div class="row">
105 103 <div class="col-md-12" style="padding-top: 20px">
... ... @@ -192,6 +190,29 @@
192 190 </div>
193 191 </div>
194 192  
  193 + <!-- Suggested distance modal -->
  194 + <div id="suggestion-modal">
  195 + <button id="triggerSuggestionModal" type="button" class="btn hide" data-toggle="modal" data-target="#suggestion-distance"></button>
  196 + <div class="modal fade" id="distance-modal" tabindex="-1" role="dialog" aria-labelledby="exampleModalLabel" aria-hidden="true">
  197 + <div class="modal-dialog" role="document">
  198 + <div class="modal-content">
  199 + <div class="modal-header">
  200 + <h5 class="modal-title" id="suggestion-distance">OBS!</h5>
  201 + <button type="button" class="close" data-dismiss="modal" aria-label="Close">
  202 + <span aria-hidden="true">&times;</span>
  203 + </button>
  204 + </div>
  205 + <div class="modal-body">
  206 + Anbefalt distanse fra kanten på terrassen er 70mm
  207 + </div>
  208 + <div class="modal-footer">
  209 + <button type="button" class="btn btn-secondary" data-dismiss="modal">Ok</button>
  210 + </div>
  211 + </div>
  212 + </div>
  213 + </div>
  214 + </div>
  215 +
195 216 <!-- Custom terrace wrapper -->
196 217 <div class="custom-terrace-wrapper hide" id="testWrapper">
197 218  
... ... @@ -500,8 +521,16 @@
500 521  
501 522 <div class="container">
502 523  
503   - <!-- Poles -->
504 524 <div class="row element-row" style="margin-top: 50px">
  525 + <div class="col-sm-12">
  526 + <div class="infotextonly" id="suggested-distance">
  527 + NB! Anbefalt avstand fra stolper til terrassekant er minimum 70mm
  528 + </div>
  529 + </div>
  530 + </div>
  531 +
  532 + <!-- Poles -->
  533 + <div class="row element-row" >
505 534 <div class="col-sm-5">
506 535 <div class="right">
507 536 <img class="img-fluid info-pole-buttons" src="images/poles/end_labeled.png">
... ...
js/HTMLGUI.js
... ... @@ -518,7 +518,7 @@ function createSolution(modules, difference) {
518 518  
519 519 var moduleMultiplier = (loopEnd - loopStart) / 2;
520 520 if(moduleMultiplier === 1) {
521   - moduleString = modules[loopStart] + "mm - 180";
  521 + moduleString = modules[loopStart] + "mm - Midtstolpe";
522 522 }
523 523 else {
524 524 moduleString = moduleMultiplier + " x (" + modules[loopStart] + "mm - Midtstolpe)";
... ... @@ -570,7 +570,7 @@ function createSolutionRow(solution, pos) {
570 570 row.appendChild(modules);
571 571  
572 572 var price = document.createElement("td");
573   - price.innerHTML = PDF.NumToStr(totalCost, ",-");
  573 + price.innerHTML = totalCost + ",-";
574 574 row.appendChild(price);
575 575  
576 576 var difference = document.createElement("td");
... ... @@ -639,13 +639,6 @@ function getPrice(type) {
639 639 return Glass.getType(parseInt(document.getElementById("glassTypeSelect").value), type).price + Glass.getRailing(type).price;
640 640 }
641 641 }
642   -function hidePopup() {
643   - document.getElementById("init-info").style.display = "none";
644   -}
645   -
646   -function initHelpOverlay() {
647   -
648   -}
649 642  
650 643 function downscale() {
651 644  
... ...
js/Setup.js
... ... @@ -108,7 +108,6 @@ class Setup {
108 108 document.getElementById("setup").style.display = "none";
109 109 document.getElementById("main").style.display = "inline";
110 110 canvas.style.display = "inline";
111   - //document.getElementById("init-info").style.display = "inline";
112 111  
113 112 initCanvas();
114 113 terrace.displayTerrace(inputs);
... ...
js/camera/OrthographicCamera.js
... ... @@ -73,9 +73,11 @@ class OrthographicCamera {
73 73 }
74 74  
75 75 zoomCameraManually(deltaY) {
76   - this.zoom += deltaY;
77   - this.updateSensibility();
78   - this.update();
  76 + if (deltaY > 0 || this.zoom > 100) {
  77 + this.zoom += deltaY;
  78 + this.updateSensibility();
  79 + this.update();
  80 + }
79 81 }
80 82  
81 83 updateSensibility() {
... ...