Merge branch 'develop' of https://gitlab.steamware.net/egalware-web/special/webdoorcreator into develop
This commit is contained in:
@@ -1,5 +1,4 @@
|
||||
|
||||
<svg viewBox="0 0 @ObjW @ObjH" width="100%" height="100%" xmlns="http://www.w3.org/2000/svg">
|
||||
<svg viewBox="0 0 @ObjW @ObjH" width="100%" height="100%" xmlns="http://www.w3.org/2000/svg">
|
||||
<g transform="translate(0,@LineDist)">
|
||||
<text id="TitleElem" style="@TextStyle" x="0" y="0">@Text01</text>
|
||||
<text id="TitleElem" style="@TextStyle" x="0" y="@(1*LineDist)">@Text02</text>
|
||||
|
||||
@@ -0,0 +1,7 @@
|
||||
<svg viewBox="0 0 @ObjW @ObjH" width="100%" height="100%" xmlns="http://www.w3.org/2000/svg">
|
||||
<rect width="@rectW" height="@rectH" style="@BlockStyle" transform="skewX(@step)" />
|
||||
<g transform="translate(@step,@rectH)">
|
||||
<rect width="@rectW" height="@rectH" style="@BlockStyle" transform="skewX(@(-step))" />
|
||||
</g>
|
||||
<text x="50%" y="50%" dominant-baseline="middle" text-anchor="middle" style="@TextStyle">@StepText</text>
|
||||
</svg>
|
||||
@@ -0,0 +1,49 @@
|
||||
using Microsoft.AspNetCore.Components;
|
||||
|
||||
namespace WebDoorCreator.UI.Components.SvgComp
|
||||
{
|
||||
public partial class StepArrow
|
||||
{
|
||||
#region Public Properties
|
||||
|
||||
[Parameter]
|
||||
public int ObjH { get; set; } = 100;
|
||||
|
||||
[Parameter]
|
||||
public int ObjId { get; set; } = 0;
|
||||
|
||||
[Parameter]
|
||||
public int ObjW { get; set; } = 500;
|
||||
|
||||
[Parameter]
|
||||
public string StepText { get; set; } = "Arrow Stepped";
|
||||
|
||||
[Parameter]
|
||||
public string TextStyle { get; set; } = "font-size: 2.5em; font-weight:bold; fill: white;";
|
||||
|
||||
|
||||
[Parameter]
|
||||
public string BlockStyle { get; set; } = "fill:rgb(0,0,255);stroke-width:0;stroke:rgb(0,0,0);";
|
||||
|
||||
#endregion Public Properties
|
||||
|
||||
#region Protected Properties
|
||||
|
||||
protected int rectH
|
||||
{
|
||||
get => ObjH / 2;
|
||||
}
|
||||
|
||||
protected int rectW
|
||||
{
|
||||
get => ObjW - ObjH / 2;
|
||||
}
|
||||
|
||||
protected int step
|
||||
{
|
||||
get => ObjH / 3;
|
||||
}
|
||||
|
||||
#endregion Protected Properties
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,40 @@
|
||||
@using WebDoorCreator.UI.Components.SvgComp
|
||||
@page "/TestPage"
|
||||
|
||||
<h3>TestPage</h3>
|
||||
|
||||
|
||||
<div class="row mx-2">
|
||||
@for (int i = 0; i < 8; i++)
|
||||
{
|
||||
stepText = $"Block_{idxObj:00}";
|
||||
<div class="col px-0">
|
||||
<StepArrow ObjId="@idxObj" StepText="@stepText" BlockStyle="@blockStyle(idxObj)" ObjW="500" ObjH="100"></StepArrow>
|
||||
</div>
|
||||
idxObj++;
|
||||
}
|
||||
</div>
|
||||
|
||||
@code {
|
||||
protected int idxObj { get; set; } = 1;
|
||||
protected string stepText { get; set; } = "---";
|
||||
protected string blockStyle(int idx)
|
||||
{
|
||||
string answ = "";
|
||||
int resto = idx % 3;
|
||||
switch (resto)
|
||||
{
|
||||
case 1:
|
||||
answ = "fill:rgb(0,255,0);";
|
||||
break;
|
||||
case 2:
|
||||
answ = "fill:rgb(0,0,255);";
|
||||
break;
|
||||
case 0:
|
||||
default:
|
||||
answ = "fill:rgb(255,0,0)";
|
||||
break;
|
||||
}
|
||||
return answ;
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user