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 @using WotBlitzStatisticsPro.Blazor.Helpers
@inherits PlayerInfoTanksTreeBase; @inherits PlayerInfoTanksTreeBase;
<div style="overflow-y: auto; overflow-x: auto;"> <div style="overflow-y: auto; overflow-x: auto;">
<svg <svg
xmlns="http://www.w3.org/2000/svg" xmlns="http://www.w3.org/2000/svg"
width="1400" width="@((CardWidth + 40) * 10)"
height="@FrameHeigth" height="@FrameHeigth"
style="background-color: darkcyan; "> >
@for (int i = 0; i < 3; i++) <!-- Background -->
@for (int i = 0; i < 10; i++)
{ {
<svg <rect
xmlns="http://www.w3.org/2000/svg" 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" x="20"
y="@(i * (CardWidth + 20) + 20)" y="@(i * (CardWidth + 20) + 20)"
width="@CardWidth" width="@CardWidth"
height="@CardHeigth"> height="@CardHeigth">
<g> <g>
<!--Rect fill = #275950 - researched, #2E353B - unresearched, #66502b - prem--> <!--Rect fill = #275950 - researched, #2E353B - unresearched, #66502b - prem-->
<rect <rect
x="0" x="0"
y="0" y="0"
@@ -24,7 +37,7 @@
rx="10" rx="10"
ry="10" ry="10"
fill="@(i == 0 ? "#275950" : (i == 1 ? "#2E353B" : "#66502b"))" fill="@(i == 0 ? "#275950" : (i == 1 ? "#2E353B" : "#66502b"))"
stroke="#4a8777"> >
</rect> </rect>
<!--Tank type--> <!--Tank type-->
@@ -41,7 +54,7 @@
</text> </text>
<!--Researched: Mastery, Winrate, AvgDmg, Battles, LastBattle--> <!--Researched: Mastery, Winrate, AvgDmg, Battles, LastBattle-->
@if(i == 0 || i == 2) @if (i == 0 || i == 2)
{ {
<g> <g>
<!--Mastery--> <!--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"> <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"))% @(TanksList.ToArray()[i].WinRate.ToString("N0"))%
</text> </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--> <!--AvgDmg-->
<image x="@(CardWidth - 62)" y="40" width="20" height="20" href="icons/damage.scale-200.png"/> <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"> <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> </g>
} }
<!--Unresearched: XP, Credits--> <!--Unresearched: XP, Credits-->
@if(i == 1) @if (i == 1)
{ {
<g> <g>
<!--XP--> <!--XP-->
@@ -64,7 +64,7 @@ namespace WotBlitzStatisticsPro.Blazor.Pages
Notifications.ReportError("Can not get data from backend", e.Message); 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) public int GetTextWidth(string text, string fontFace, int fontSize)