Skip to content

Commit

Permalink
swapped legend items
Browse files Browse the repository at this point in the history
  • Loading branch information
jason-dutton committed Oct 26, 2023
1 parent da0a661 commit 295b214
Show file tree
Hide file tree
Showing 4 changed files with 53 additions and 39 deletions.
36 changes: 21 additions & 15 deletions src/apps/blazor-app/Components/Advanced/BuildYourHome.razor
Original file line number Diff line number Diff line change
Expand Up @@ -262,28 +262,34 @@
<h3 class="font-medium text-lg text-primary-900 text-left">Running Hours on Batteries</h3>
</div>
<DaylightChart hours="@dlh" daylightHours="@daylight" concurrent="concurrentRuntime"/>
<div class="flex flex-row justify-center w-full has-tooltip">
<div class="flex flex-row w-full justify-center items-center gap-1">
@if(float.IsInfinity(dlh) || dlh == 99) {
string hexColor = calculationDataHandler.GetColorGradient(99);
<div class=" h-3 w-3 rounded-md" style="background-color: @hexColor;"></div>
<div class="flex flex-row justify-center w-full">
<div class="flex flex-row w-full justify-center items-center gap-1 has-tooltip">
<Tooltip pointer="45" direction="top">
<p>@tooltipService.GetTooltip("simultaneous running hours")</p>
</Tooltip>
@if(float.IsInfinity(concurrentRuntime) || dlh == 99) {
string hexColorConcurrent = calculationDataHandler.GetColorGradient(99, 4);
<div class=" h-3 w-3 rounded-sm" style="background-color: @hexColorConcurrent;"></div>
<p class="text-5xl text-primary-900 font-semibold">99+</p>
} else {
string hexColor = calculationDataHandler.GetColorGradient(dlh);
<div class=" h-3 w-3 rounded-md" style="background-color: @hexColor;"></div>
<p class="text-5xl text-primary-900 font-semibold">@dlh</p>
string hexColorConcurrent = calculationDataHandler.GetColorGradient(concurrentRuntime, 4);
<div class=" h-3 w-3 rounded-sm" style="background-color: @hexColorConcurrent;"></div>
<p class="text-5xl text-primary-900 font-semibold">@concurrentRuntime</p>
}
<p class="text-5xl text-gray-400 font-bold">h</p>
</div>
<div class="flex flex-row w-full justify-center items-center gap-1">
@if(float.IsInfinity(concurrentRuntime) || dlh == 99) {
string hexColorConcurrent = calculationDataHandler.GetColorGradient(99, 4);
<div class=" h-3 w-3 rounded-md" style="background-color: @hexColorConcurrent;"></div>
<div class="flex flex-row w-full justify-center items-center gap-1 has-tooltip">
<Tooltip pointer="45" direction="top">
<p>@tooltipService.GetTooltip("running hours on batteries")</p>
</Tooltip>
@if(float.IsInfinity(dlh) || dlh == 99) {
string hexColor = calculationDataHandler.GetColorGradient(99);
<div class=" h-3 w-3 rounded-sm" style="background-color: @hexColor;"></div>
<p class="text-5xl text-primary-900 font-semibold">99+</p>
} else {
string hexColorConcurrent = calculationDataHandler.GetColorGradient(concurrentRuntime, 4);
<div class=" h-3 w-3 rounded-md" style="background-color: @hexColorConcurrent;"></div>
<p class="text-5xl text-primary-900 font-semibold">@concurrentRuntime</p>
string hexColor = calculationDataHandler.GetColorGradient(dlh);
<div class=" h-3 w-3 rounded-sm" style="background-color: @hexColor;"></div>
<p class="text-5xl text-primary-900 font-semibold">@dlh</p>
}
<p class="text-5xl text-gray-400 font-bold">h</p>
</div>
Expand Down
33 changes: 20 additions & 13 deletions src/apps/blazor-app/Components/Dashboard/Appliances.razor
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
@using BlazorApp.Components.Base
@inject ProtectedSessionStorage ProtectedSessionStore
@inject BlazorApp.Data.ToastService toastService
@inject BlazorApp.Data.TooltipService tooltipService

<Card>
@if (appliancesLoaded)
Expand Down Expand Up @@ -203,27 +204,33 @@
<div class="flex flex-row justify-center w-full has-tooltip">
@if (appliancesLoaded)
{
<div class="flex flex-row justify-center items-center gap-1 mr-16">
@if(float.IsInfinity(dlh) || dlh == 99) {
string hexColor = calculationDataHandler.GetColorGradient(99);
<div class=" h-3 w-3 rounded-md" style="background-color: @hexColor;"></div>
<div class="flex flex-row justify-center items-center gap-1 has-tooltip mr-16">
<Tooltip pointer="45" direction="top">
<p class="max-w-sm">@tooltipService.GetTooltip("simultaneous running hours")</p>
</Tooltip>
@if(float.IsInfinity(concurrentRuntime) || dlh == 99) {
string hexColorConcurrent = calculationDataHandler.GetColorGradient(99, 4);
<div class=" h-3 w-3 rounded-sm" style="background-color: @hexColorConcurrent;"></div>
<p class="text-5xl text-primary-900 font-semibold">99+</p>
} else {
string hexColor = calculationDataHandler.GetColorGradient(dlh);
<div class=" h-3 w-3 rounded-md" style="background-color: @hexColor;"></div>
<p class="text-5xl text-primary-900 font-semibold">@dlh</p>
string hexColorConcurrent = calculationDataHandler.GetColorGradient(concurrentRuntime, 4);
<div class=" h-3 w-3 rounded-sm" style="background-color: @hexColorConcurrent;"></div>
<p class="text-5xl text-primary-900 font-semibold">@concurrentRuntime</p>
}
<p class="text-5xl text-gray-400 font-bold">h</p>
</div>
<div class="flex flex-row justify-center items-center gap-1">
@if(float.IsInfinity(concurrentRuntime) || dlh == 99) {
string hexColorConcurrent = calculationDataHandler.GetColorGradient(99, 4);
<div class=" h-3 w-3 rounded-md" style="background-color: @hexColorConcurrent;"></div>
<Tooltip pointer="45" direction="top">
<p class="max-w-sm">@tooltipService.GetTooltip("running hours on batteries has-tooltip")</p>
</Tooltip>
@if(float.IsInfinity(dlh) || dlh == 99) {
string hexColor = calculationDataHandler.GetColorGradient(99);
<div class=" h-3 w-3 rounded-sm" style="background-color: @hexColor;"></div>
<p class="text-5xl text-primary-900 font-semibold">99+</p>
} else {
string hexColorConcurrent = calculationDataHandler.GetColorGradient(concurrentRuntime, 4);
<div class=" h-3 w-3 rounded-md" style="background-color: @hexColorConcurrent;"></div>
<p class="text-5xl text-primary-900 font-semibold">@concurrentRuntime</p>
string hexColor = calculationDataHandler.GetColorGradient(dlh);
<div class=" h-3 w-3 rounded-sm" style="background-color: @hexColor;"></div>
<p class="text-5xl text-primary-900 font-semibold">@dlh</p>
}
<p class="text-5xl text-gray-400 font-bold">h</p>
</div>
Expand Down
20 changes: 10 additions & 10 deletions src/apps/blazor-app/Components/SolarScore/Results.razor
Original file line number Diff line number Diff line change
Expand Up @@ -165,25 +165,25 @@
<div class="flex flex-col w-full justify-center items-center gap-10">
<div class="flex flex-row gap-2 items-center mt-4">
@{
string hexColor = calculationDataHandler.GetColorGradient(dlh);
string hexColorConcurrent = calculationDataHandler.GetColorGradient(concurrentRuntime, 4);
}
<div class=" h-3 w-3 rounded-sm" style="background-color: @hexColor;"></div>
<div class=" h-3 w-3 rounded-sm" style="background-color: @hexColorConcurrent;"></div>
<div class="flex flex-row gap-1 mr-5 has-tooltip">
<Tooltip pointer="45" direction="top">
<p>@tooltipService.GetTooltip("running hours on batteries")</p>
<Tooltip pointer="45">
<p>@tooltipService.GetTooltip("simultaneous running hours")</p>
</Tooltip>
<p class='text-green-600" text-3xl font-semibold'>@dlh</p>
<p class='text-green-600" text-3xl font-semibold'>@concurrentRuntime</p>
<p class="text-3xl text-gray-400 font-bold">h</p>
</div>
@{
string hexColorConcurrent = calculationDataHandler.GetColorGradient(concurrentRuntime, 4);
string hexColor = calculationDataHandler.GetColorGradient(dlh);
}
<div class=" h-3 w-3 rounded-sm" style="background-color: @hexColorConcurrent;"></div>
<div class="flex flex-row gap-1 has-tooltip">
<Tooltip pointer="45">
<div class=" h-3 w-3 rounded-sm" style="background-color: @hexColor;"></div>
<div class="flex flex-row gap-1 has-tooltip">
<Tooltip pointer="45" direction="top">
<p>@tooltipService.GetTooltip("running hours on batteries")</p>
</Tooltip>
<p class='text-green-600" text-3xl font-semibold'>@concurrentRuntime</p>
<p class='text-green-600" text-3xl font-semibold'>@dlh</p>
<p class="text-3xl text-gray-400 font-bold">h</p>
</div>
</div>
Expand Down
3 changes: 2 additions & 1 deletion src/apps/blazor-app/Data/Tooltips.cs
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,8 @@ public TooltipService()
tooltips["solarScore"] = "The percentage of sunlight exposure on your property's roof compared to an optimal roof.";
tooltips["potential savings"] = "How much money you can save monthly by producing clean energy.";
tooltips["average energy produced"] = "The daily energy your solar panels produce averaged over a year.";
tooltips["running hours on batteries"] = "The total time in which you can run the chosen appliances exclusively using battery power.";
tooltips["running hours on batteries"] = "The average time your batteries will last given daily duration usage of your appliances";
tooltips["simultaneous running hours"] = "The time your batteries will last given simultaneous and constant use of all your appliances";
tooltips["battery utilisation"] = "The maximum percentage your batteries can charge, while running the selected appliances.";
tooltips["solar score add button"] = "Add or remove appliances";
tooltips["number of panels"] = "Affects your average energy production and how quickly you can charge your batteries while running appliances.";
Expand Down

0 comments on commit 295b214

Please sign in to comment.