feat: Tree background

This commit is contained in:
Mikhail Shabanov committed 2022-08-06 13:01:32 +02:00
1 parent 5b9e65be9f
commit 10f9dc1557
2 files changed
+27 -14

No files matched your search

@@ -1,21 +1,34 @@
@using WotBlitzStatisticsPro.Blazor.Helpers
@inherits PlayerInfoTanksTreeBase;
<div style="overflow-y: auto; overflow-x: auto;">
<svg
xmlns="http://www.w3.org/2000/svg"
width="1400"
height="@FrameHeigth"
style="background-color: darkcyan; ">
@for (int i = 0; i < 3; i++)
<svg
xmlns="http://www.w3.org/2000/svg"
width="@((CardWidth + 40) * 10)"
height="@FrameHeigth"
>
<!-- Background -->
@for (int i = 0; i < 10; i++)
{
<svg
xmlns="http://www.w3.org/2000/svg"
<rect
x="@(i * (CardWidth + 40))"
y="0"
width="@(CardWidth + 40)"
height="@FrameHeigth"
fill="@(i % 2 == 0 ? "#464A5D" : "#3A3D4B")"
>
</rect>
}
@for (int i = 0; i < 3; i++)
{
<!-- Tank card svg-->
<svg
xmlns="http://www.w3.org/2000/svg"
x="20"
y="@(i * (CardWidth + 20) + 20)"
width="@CardWidth"
height="@CardHeigth">
<g>
<!--Rect fill = #275950 - researched, #2E353B - unresearched, #66502b - prem-->
<!--Rect fill = #275950 - researched, #2E353B - unresearched, #66502b - prem-->
<rect
x="0"
y="0"
@@ -24,7 +37,7 @@
rx="10"
ry="10"
fill="@(i == 0 ? "#275950" : (i == 1 ? "#2E353B" : "#66502b"))"
stroke="#4a8777">
>
</rect>
<!--Tank type-->
@@ -41,7 +54,7 @@
</text>
<!--Researched: Mastery, Winrate, AvgDmg, Battles, LastBattle-->
@if(i == 0 || i == 2)
@if (i == 0 || i == 2)
{
<g>
<!--Mastery-->
@@ -51,7 +64,7 @@
<text x="32" y="40" fill="white" text-anchor="start" alignment-baseline="before-edge" font-family="Segoe UI" font-size="12">
@(TanksList.ToArray()[i].WinRate.ToString("N0"))%
</text>
<line x1="8" y1="60" x2="58" y2="60" style="@($"stroke:{TanksList.ToArray()[i].WinRate.ScaleColor()};stroke-width:3")" />
<line x1="8" y1="60" x2="58" y2="60" style="@($"stroke:{TanksList.ToArray()[i].WinRate.ScaleColor()};stroke-width:3")"/>
<!--AvgDmg-->
<image x="@(CardWidth - 62)" y="40" width="20" height="20" href="icons/damage.scale-200.png"/>
<text x="@(CardWidth - 37)" y="40" fill="white" text-anchor="start" alignment-baseline="before-edge" font-family="Segoe UI" font-size="12">
@@ -70,7 +83,7 @@
</g>
}
<!--Unresearched: XP, Credits-->
@if(i == 1)
@if (i == 1)
{
<g>
<!--XP-->
@@ -64,7 +64,7 @@ namespace WotBlitzStatisticsPro.Blazor.Pages
Notifications.ReportError("Can not get data from backend", e.Message);
}
FrameHeigth = screenHeight - 390;
FrameHeigth = screenHeight + 390;
}
public int GetTextWidth(string text, string fontFace, int fontSize)