Files
webdoorcreator/WebDoorCreator.UI/Components/SvgComp/HwSvgObj.razor
T
2023-05-18 11:12:14 +02:00

44 lines
2.1 KiB
Plaintext

<svg viewBox="0 0 @ObjW @ObjH" width="100%" height="100%" xmlns="http://www.w3.org/2000/svg">
<g transform="translate(0,@LineDist)">
<foreignObject width="@TextAreaWidth" height="100%">
<div class="d-flex justify-content-between rectangle p-3 @cardClass" style="@TextStyle;" @onclick="() => doExecFunc(ActionReq.Select, false)">
<div>
@ItemName
</div>
<div class="pe-4">
@if (ItemCount > 0)
{
<b>@ItemCount</b>
}
else
{
<p>&nbsp;</p>
}
</div>
</div>
</foreignObject>
</g>
<circle id="circleLine" cx="@CircleLine.cx" cy="@CircleLine.cy" r="@CircleLine.rad" stroke="@LineColor" stroke-width="@LineWidth" fill="blue" />
<defs>
<pattern id="@($"contImg_{ObjId}")" patternContentUnits="userSpaceOnUse" width="1" height="1">
<linearGradient id="BckGrad" x1="0" x2="0" y1="0" y2="1">
<stop offset="0%" stop-color="#AFCFD1" />
<stop offset="100%" stop-color="#92B2C4" />
</linearGradient>
<rect fill="url(#BckGrad)" x="0" y="0" height="100%" width="100%" style="opacity: 100%;"></rect>
<image x="@(CircleImg.rad/2)" y="0" href="@ImagePath" width="@CircleImg.rad" height="100%"></image>
@if (ShowPlus)
{
<rect x="0" y="0" width="100%" height="100%" fill="@PlusColor" style="opacity: 30%;" />
}
</pattern>
</defs>
@if (ShowPlus)
{
<circle id="circleCont" cx="@CircleImg.cx" cy="@CircleImg.cy" r="@CircleImg.rad" fill="url(#@($"contImg_{ObjId}"))" style="cursor: pointer;" @onclick="() => doExecFunc(ActionReq.Plus, true)" />
}
else
{
<circle id="circleCont" cx="@CircleImg.cx" cy="@CircleImg.cy" r="@CircleImg.rad" fill="url(#@($"contImg_{ObjId}"))" style="cursor: pointer;" @onclick="() => doExecFunc(ActionReq.Select, true)" />
}
</svg>