diff --git a/js/main.js b/js/main.js
index 08c39ee..9efff21 100644
--- a/js/main.js
+++ b/js/main.js
@@ -174,6 +174,8 @@ class WindSimulation {
scene.remove(this.simulation);
this.simulation = null;
this.simulationPot = null;
+ for(var i = 0; i < this.mills; i++)
+ this.wms[i].lowPower(false);
document.getElementById("follower").style.display = "none";
document.getElementById("results").style.display = "none";
}
@@ -243,12 +245,24 @@ class WindSimulation {
add_simulation(ws, pot) {
var sum = 0;
for(let i = 0; i < pot.length; i++) {
- this.wms[i].lowPower(pot[i] < 2.75/*14.95 * 0.8*/)
+ this.wms[i].lowPower(pot[i] < 14.95 * 0.5);
sum += pot[i];
}
+ var pasa = Math.round(sum / 14.95 / pot.length * 100) >= 80;
var results = document.getElementById("results")
- results.innerHTML = (Math.round(sum * 100) / 100) + " GWh (" + Math.round(sum * 100 / 14.95 / pot.length) + "%)";
+ var innerHTML = '
Resultados de la simulación
' + (pasa ?
+ '
🥳🥳🥳 ¡Tu simulación está bien! ¿Probaste otros vientos? Si sí agregá más aerogeneradores.
' :
+ '
⚠️⚠️⚠️ ¡Tu simulación no funciona! Probá otras configuraciones.
') + '
';
+
+ for(let i = 0; i < pot.length; i++) {
+ var perc = Math.round(pot[i] / 14.95 * 100);
+ innerHTML += 'Nº' + (i + 1) + ': | ' + Math.round(pot[i] * 100) / 100 + ' GWh | ' + perc + '% ' + (perc < 50 ? '⚠️' : '') + ' |
'
+ }
+ var perc = Math.round(sum / 14.95 / pot.length * 100);
+ innerHTML += 'TOTAL: | ' + Math.round(sum * 100) / 100 + ' GWh | ' + perc + '% ' + (perc < 80 ? '⚠️' : '') + ' |
';
+
+ results.innerHTML = innerHTML;
results.style.display = "block";
var geometry = new THREE.PlaneGeometry(this.width, this.height, 10 * this.width, 10 * this.height);
diff --git a/style.css b/style.css
index b6f94a8..faaf438 100644
--- a/style.css
+++ b/style.css
@@ -11,6 +11,14 @@ body {
color: #fff;
}
+a {
+ color: #fff;
+}
+
+h3, h4 {
+ text-align: center;
+}
+
#container {
position: absolute;
top: 0;
@@ -35,19 +43,30 @@ body {
height: auto;
background: #00000088;
padding: 4vh;
- text-align: center;
+ text-align: left;
+ font-size: .7em;
}
#popup p + p {
margin-top: 1vh;
}
-.l {
- text-align: left;
+#popup h4 {
+ margin-bottom: 1vh;
}
-.s {
- font-size: .7em;
+#popup li {
+ margin-left: 5vh;
+}
+
+#popup .b {
+ display: inline-block;
+ font-weight: 800;
+ border: solid white .4vh;
+ border-radius: 1vh;
+ width: 1em;
+ text-align: center;
+ margin: 0 .2vh;
}
#close {
@@ -114,6 +133,21 @@ body {
left: 1vh;
}
+.bar {
+ border: solid white 1px;
+ display: inline-block;
+ width: 4em;
+ height: .7em;
+}
+
+tr.last {
+ font-weight: bold;
+}
+
+.last td {
+ border-top: solid white 1px;
+}
+
#copyright {
z-index: 2;
font-size: 0.4em;