Fixed voice work supported language search. Include supported languages and original circle in the search result item. Several UI style updates.
This commit is contained in:
@@ -3,12 +3,12 @@
|
||||
@if (string.IsNullOrWhiteSpace(Url))
|
||||
{
|
||||
<div class="@GetClasses()" @onclick="@OnClickAsync">
|
||||
@if (Graphic != null)
|
||||
@if (Graphic != null && Graphic != Enums.Graphic.None)
|
||||
{
|
||||
<Icon Graphic="@Graphic.Value"
|
||||
Varient="@(IconVarient ?? Enums.IconVarient.None)"
|
||||
Size="@(IconSize ?? Enums.SizeVarient.Small)"
|
||||
Color="@Color">
|
||||
UseCurrentColor>
|
||||
</Icon>
|
||||
}
|
||||
<span>@ChildContent</span>
|
||||
@@ -23,7 +23,7 @@ else
|
||||
Graphic="@Graphic.Value"
|
||||
Varient="@(IconVarient ?? Enums.IconVarient.None)"
|
||||
Size="@(IconSize ?? Enums.SizeVarient.Small)"
|
||||
Color="@Color">
|
||||
UseCurrentColor>
|
||||
</Icon>
|
||||
}
|
||||
<span>@ChildContent</span>
|
||||
@@ -94,6 +94,11 @@ else
|
||||
break;
|
||||
}
|
||||
|
||||
if (Varient == ElementVarient.Filled && Tone == ToneVarient.Tint)
|
||||
{
|
||||
classNames.Add($"varient-tint");
|
||||
}
|
||||
|
||||
if (Click.HasDelegate || string.IsNullOrWhiteSpace(Url) == false)
|
||||
{
|
||||
classNames.Add("is-clickable");
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
@using JSMR.UI.Blazor.Enums
|
||||
|
||||
<div class="@GetIconClasses()"></div>
|
||||
<div class="@GetIconClasses()" style="@GetStyle()"></div>
|
||||
|
||||
@code {
|
||||
[Parameter]
|
||||
@@ -15,20 +15,33 @@
|
||||
[Parameter]
|
||||
public ColorVarient Color { get; set; }
|
||||
|
||||
[Parameter]
|
||||
public bool UseCurrentColor { get; set; }
|
||||
|
||||
private string GetIconClasses()
|
||||
{
|
||||
string graphic = Varient == IconVarient.None
|
||||
? Graphic.ToString().ToLower()
|
||||
: $"{Graphic.ToString().ToLower()}-{Varient.ToString().ToLower()}";
|
||||
|
||||
|
||||
List<string> classNames =
|
||||
[
|
||||
$"j-icon",
|
||||
$"j-icon-{graphic}",
|
||||
$"size-{Size.ToString().ToLower()}",
|
||||
$"background-color-{Color.ToString().ToLower()}"
|
||||
//$"background-color-{Color.ToString().ToLower()}"
|
||||
];
|
||||
|
||||
if (!UseCurrentColor)
|
||||
{
|
||||
classNames.Add($"background-color-{Color.ToString().ToLower()}");
|
||||
}
|
||||
|
||||
return string.Join(" ", classNames);
|
||||
}
|
||||
|
||||
private string? GetStyle()
|
||||
{
|
||||
return UseCurrentColor ? "background-color: currentColor;" : null;
|
||||
}
|
||||
}
|
||||
@@ -15,34 +15,66 @@
|
||||
<div class="j-product-title">
|
||||
<a href="@Product.ProductUrl" target="_blank">@Product.ProductName</a>
|
||||
</div>
|
||||
<div class="j-product-contributors">
|
||||
<span class="j-circle">
|
||||
<MudChip T="string"
|
||||
<BitStack Horizontal="true" Gap="0.5em" AutoHeight Wrap>
|
||||
@* <MudChip T="string"
|
||||
Href=@($"https://www.dlsite.com/maniax/circle/profile/=/maker_id/{Product.MakerId}.html")
|
||||
Target="_blank"
|
||||
Variant="MudBlazor.Variant.Filled"
|
||||
Icon="@Icons.Material.Outlined.Circle">@Product.Maker</MudChip>
|
||||
@* <CircleChip Circle="@Product.Circle"></CircleChip> *@
|
||||
@foreach (var creator in Product.Creators)
|
||||
{
|
||||
<MudChip T="string"
|
||||
Icon="@Icons.Material.Outlined.Circle">@Product.Maker</MudChip> *@
|
||||
@* <CircleChip Circle="@Product.Circle"></CircleChip> *@
|
||||
<Chip Graphic="Graphic.Circle" Varient="ElementVarient.Outlined" Color="ColorVarient.Secondary" Url=@($"https://www.dlsite.com/maniax/circle/profile/=/maker_id/{Product.MakerId}.html")>@Product.Maker</Chip>
|
||||
|
||||
@if (Product.OriginalCircle is not null)
|
||||
{
|
||||
<Chip Graphic="Graphic.Circle" Varient="ElementVarient.Outlined" Color="ColorVarient.Secondary" Url=@($"https://www.dlsite.com/maniax/circle/profile/=/maker_id/{Product.OriginalCircle.MakerId}.html")>@Product.OriginalCircle.Name</Chip>
|
||||
}
|
||||
|
||||
@foreach (var creator in Product.Creators)
|
||||
{
|
||||
@* <MudChip T="string"
|
||||
Href=@($"https://www.dlsite.com/maniax/fsr/=/keyword_creater/{creator.Name}")
|
||||
Target="_blank"
|
||||
Variant="MudBlazor.Variant.Filled"
|
||||
Icon="@Icons.Material.Filled.Person">@creator.Name</MudChip>
|
||||
@* <CreatorChip Creator="@creator"></CreatorChip> *@
|
||||
}
|
||||
</span>
|
||||
</div>
|
||||
Icon="@Icons.Material.Filled.Person">@creator.Name</MudChip> *@
|
||||
@* <CreatorChip Creator="@creator"></CreatorChip> *@
|
||||
<Chip Graphic="Graphic.Person" Varient="ElementVarient.Outlined" IconVarient="IconVarient.Fill" Color="ColorVarient.Secondary" Url=@($"https://www.dlsite.com/maniax/fsr/=/keyword_creater/{creator.Name}")>@creator.Name</Chip>
|
||||
}
|
||||
</BitStack>
|
||||
<BitStack Horizontal="true" Gap="0.5em" AutoHeight Wrap>
|
||||
@foreach (string supportedLanguage in Product.SupportedLanguages)
|
||||
{
|
||||
<Chip Graphic="Graphic.Globe" Varient="ElementVarient.Outlined" Color="ColorVarient.Secondary">@GetSupportedLanguageDescription(supportedLanguage)</Chip>
|
||||
}
|
||||
@if (Product.OriginalProductId is not null)
|
||||
{
|
||||
<Chip Graphic="Graphic.Translate" Varient="ElementVarient.Outlined" Color="ColorVarient.Secondary">Translation</Chip>
|
||||
}
|
||||
@if (Product.Rating == AgeRating.AllAges)
|
||||
{
|
||||
<Chip Graphic="Graphic.Age" Color="ColorVarient.Green" Varient="ElementVarient.Outlined">All Ages</Chip>
|
||||
}
|
||||
else if (Product.Rating == AgeRating.R15)
|
||||
{
|
||||
<Chip Graphic="Graphic.Age" Color="ColorVarient.Blue" Varient="ElementVarient.Outlined">R-15</Chip>
|
||||
}
|
||||
@if (Product.HasTrial || Product.HasChobit)
|
||||
{
|
||||
<Chip Graphic="Graphic.Download" Color="ColorVarient.Yellow" Varient="ElementVarient.Outlined">Trial</Chip>
|
||||
}
|
||||
@if (Product.Favorite)
|
||||
{
|
||||
<Chip Graphic="Graphic.Star" Color="ColorVarient.Teal" Varient="ElementVarient.Outlined">Favorite</Chip>
|
||||
}
|
||||
</BitStack>
|
||||
<div class="j-product-description">@Product.Description</div>
|
||||
<div class="j-tags">
|
||||
@foreach (var tag in Product.Tags)
|
||||
{
|
||||
@* <div class="j-tag">@tag.Name</div> *@
|
||||
@* <div class="j-tag">@tag.Name</div> *@
|
||||
<ProductTag Tag="tag"></ProductTag>
|
||||
}
|
||||
</div>
|
||||
@* <div class="j-tags">
|
||||
@* <div class="j-tags">
|
||||
@foreach (var tag in Product.Tags)
|
||||
{
|
||||
<TagChip Tag="tag"></TagChip>
|
||||
@@ -149,4 +181,17 @@
|
||||
return "jp";
|
||||
}
|
||||
}
|
||||
|
||||
private string GetSupportedLanguageDescription(string code)
|
||||
{
|
||||
switch (code)
|
||||
{
|
||||
case "JPN": return "Japanese";
|
||||
case "ENG": return "English";
|
||||
case "CHI_HANS": return "Chinese (Simplified)";
|
||||
case "CHI_HANT": return "Chinese (Traditional)";
|
||||
case "KO_KR": return "Korean";
|
||||
default: return code;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,11 +1,13 @@
|
||||
@using JSMR.Application.Tags.Queries.Search.Contracts
|
||||
@using JSMR.Application.VoiceWorks.Queries.Search
|
||||
@using JSMR.UI.Blazor.Enums
|
||||
@using JSMR.UI.Blazor.Filters
|
||||
@using JSMR.UI.Blazor.Services
|
||||
@using Microsoft.AspNetCore.WebUtilities
|
||||
|
||||
<a class="@Classes" @onclick="@OnClick"><Icon Graphic="Enums.Graphic.Tag" Color="Enums.ColorVarient.Primary"></Icon>@Tag.Name</a>
|
||||
@* <a class="@Classes" @onclick="@OnClick"><Icon Graphic="Enums.Graphic.Tag" Color="Enums.ColorVarient.Primary"></Icon>@Tag.Name</a> *@
|
||||
@* <MudChip T="string" Icon="@Icons.Material.Outlined.Tag" @onclick="@OnClick" Variant="@MudBlazor.Variant.Filled" Color="@MudBlazor.Color.Surface">@Tag.Name</MudChip> *@
|
||||
<Chip Graphic="Graphic.Tag" Varient="ElementVarient.Outlined" Color="@GetColorVarient()" Tone="ToneVarient.None" Click="@OnClick">@Tag.Name</Chip>
|
||||
|
||||
@code {
|
||||
[Inject]
|
||||
@@ -33,6 +35,21 @@
|
||||
return string.Join(" ", classNames);
|
||||
}
|
||||
|
||||
private ColorVarient GetColorVarient()
|
||||
{
|
||||
if (Tag.IsFavorite)
|
||||
{
|
||||
return ColorVarient.Mint;
|
||||
}
|
||||
|
||||
if (Tag.IsFavorite)
|
||||
{
|
||||
return ColorVarient.Orange;
|
||||
}
|
||||
|
||||
return ColorVarient.Primary;
|
||||
}
|
||||
|
||||
private void OnClick()
|
||||
{
|
||||
VoiceWorkFilterState state = new()
|
||||
|
||||
Reference in New Issue
Block a user