Initial Commit
This commit is contained in:
@@ -0,0 +1,50 @@
|
||||
<button class="buttonContainer @MyButtonType.ToString().ToLower()" @onclick="ButtonClicked">@ChildContent</button>
|
||||
|
||||
<style>
|
||||
.buttonContainer {
|
||||
padding: 16px;
|
||||
border: 1px solid;
|
||||
border-radius: 8px;
|
||||
font-weight: 800;
|
||||
font-size: 1.2rem;
|
||||
}
|
||||
|
||||
.@(MyButtonType.Primary.ToString().ToLower()) {
|
||||
border-color: var(--primary);
|
||||
background-color: var(--primary);
|
||||
}
|
||||
|
||||
.@MyButtonType.Secondary.ToString().ToLower() {
|
||||
border-color: var(--secondary);
|
||||
background-color: var(--secondary);
|
||||
}
|
||||
|
||||
.@MyButtonType.Primary.ToString().ToLower():hover {
|
||||
background-color: var(--primary-hover);
|
||||
border-color: var(--primary-border-hover);
|
||||
color: white;
|
||||
}
|
||||
|
||||
.@MyButtonType.Secondary.ToString().ToLower():hover {
|
||||
background-color: var(--secondary-hover);
|
||||
border-color: var(--secondary-border-hover);
|
||||
color: white;
|
||||
}
|
||||
|
||||
</style>
|
||||
|
||||
|
||||
@code {
|
||||
|
||||
[Parameter] public RenderFragment ChildContent { get; set; } = default!;
|
||||
|
||||
[Parameter] public EventCallback<EventArgs> OnClick { get; set; }
|
||||
|
||||
[Parameter] public MyButtonType MyButtonType { get; set; }
|
||||
|
||||
private void ButtonClicked(EventArgs eventArgs)
|
||||
{
|
||||
OnClick.InvokeAsync(eventArgs);
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,92 @@
|
||||
<div class="groupButtonContainerContainer">
|
||||
<div class="groupButtonContainer">
|
||||
@foreach (var choice in Choices)
|
||||
{
|
||||
var styleClass = "";
|
||||
if (choice.Equals(Choice))
|
||||
{
|
||||
styleClass = "selected";
|
||||
}
|
||||
|
||||
<button @onclick="@(e => OnChangeChoice(choice))" class="groupChoiceButton @styleClass">@choice</button>
|
||||
}
|
||||
</div>
|
||||
</div>
|
||||
<style>
|
||||
|
||||
.groupButtonContainerContainer {
|
||||
margin: auto;
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
justify-content: flex-start;
|
||||
justify-items: flex-start;
|
||||
}
|
||||
|
||||
.groupButtonContainer {
|
||||
display: flex;
|
||||
background-color: var(--background);
|
||||
gap: 2px;
|
||||
margin-right: auto;
|
||||
border-radius: 8px;
|
||||
}
|
||||
|
||||
.groupChoiceButton {
|
||||
background-color: var(--primary);
|
||||
color: white;
|
||||
padding: 12px;
|
||||
border: 1px solid var(--primary);
|
||||
}
|
||||
|
||||
.groupChoiceButton:hover {
|
||||
background-color: var(--primary-hover);
|
||||
border-color: var(--primary-border-hover);
|
||||
}
|
||||
|
||||
.selected {
|
||||
background-color: var(--secondary);
|
||||
color: white;
|
||||
font-style: normal;
|
||||
font-weight: bold;
|
||||
}
|
||||
|
||||
.selected:hover {
|
||||
background-color: var(--secondary-hover);
|
||||
border-color: var(--secondary-border-hover);
|
||||
}
|
||||
|
||||
|
||||
.groupButtonContainer .groupChoiceButton:first-child {
|
||||
border-top-left-radius: 8px;
|
||||
border-bottom-left-radius: 8px;
|
||||
}
|
||||
|
||||
|
||||
.groupButtonContainer .groupChoiceButton:last-child {
|
||||
border-top-right-radius: 8px;
|
||||
border-bottom-right-radius: 8px;
|
||||
}
|
||||
|
||||
</style>
|
||||
|
||||
|
||||
@code {
|
||||
|
||||
[Parameter] public string Choice { get; set; } = default!;
|
||||
|
||||
[Parameter] public List<string> Choices { get; set; } = default!;
|
||||
|
||||
[Parameter] public EventCallback<string> OnClick { get; set; }
|
||||
|
||||
|
||||
protected override void OnInitialized()
|
||||
{
|
||||
base.OnInitialized();
|
||||
}
|
||||
|
||||
void OnChangeChoice(string choice)
|
||||
{
|
||||
Choice = choice;
|
||||
OnClick.InvokeAsync(choice);
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,28 @@
|
||||
<a href="@Href" target="_blank" class="codeLinkButton">
|
||||
View on GitHub <i class="fa-brands fa-github" style="font-size: 24px; margin-left: 5px;"></i>
|
||||
</a>
|
||||
|
||||
<style>
|
||||
.codeLinkButton {
|
||||
color: white;
|
||||
background-color: var(--info);
|
||||
border: 2px solid var(--info-border);
|
||||
padding: 16px;
|
||||
border-radius: 3px;
|
||||
display: block;
|
||||
width: 200px;
|
||||
text-align: center;
|
||||
}
|
||||
|
||||
.codeLinkButton:hover {
|
||||
color: white;
|
||||
background-color: var(--info-hover);
|
||||
border: 2px solid var(--info-border-hover);
|
||||
}
|
||||
</style>
|
||||
|
||||
@code {
|
||||
|
||||
[Parameter] public string Href { get; set; } = "";
|
||||
|
||||
}
|
||||
@@ -0,0 +1,28 @@
|
||||
<a href="@Href" target="_blank" class="editLinkButton">
|
||||
Edit on GitHub
|
||||
</a>
|
||||
|
||||
<style>
|
||||
.editLinkButton {
|
||||
color: white;
|
||||
background-color: var(--info);
|
||||
border: 1px solid var(--info-border);
|
||||
padding: 16px;
|
||||
border-radius: 3px;
|
||||
display: block;
|
||||
width: 180px;
|
||||
text-align: center;
|
||||
}
|
||||
|
||||
.editLinkButton:hover {
|
||||
color: white;
|
||||
background-color: var(--info-hover);
|
||||
border: 2px solid var(--info-border-hover);
|
||||
}
|
||||
</style>
|
||||
|
||||
@code {
|
||||
|
||||
[Parameter] public string Href { get; set; } = "";
|
||||
|
||||
}
|
||||
@@ -0,0 +1,26 @@
|
||||
@using Model.Entity
|
||||
@using Model.Entity.Data
|
||||
@inject IEntityDialogService entityDialogService
|
||||
|
||||
|
||||
@if (EntityId == null)
|
||||
{
|
||||
<div>Add a entity</div>
|
||||
}
|
||||
else
|
||||
{
|
||||
<button class="entityLabel @Entity.Descriptive.ToLower()" @onclick="EntityLabelClicked">@Entity.Info().Name</button>
|
||||
}
|
||||
|
||||
@code {
|
||||
|
||||
[Parameter] public string EntityId { get; set; } = default!;
|
||||
|
||||
private EntityModel Entity => EntityData.Get()[EntityId];
|
||||
|
||||
void EntityLabelClicked()
|
||||
{
|
||||
entityDialogService.AddDialog(EntityId);
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,27 @@
|
||||
|
||||
.entityLabel {
|
||||
font-weight: bolder;
|
||||
box-shadow: 1px 1px 0 0 rgba(0, 0, 0, 0.2);
|
||||
padding-right: 4px;
|
||||
}
|
||||
|
||||
.entityLabel:hover {
|
||||
background-color: var(--primary-hover);
|
||||
}
|
||||
|
||||
.army {
|
||||
color: cyan;
|
||||
}
|
||||
|
||||
.building {
|
||||
color: greenyellow;
|
||||
}
|
||||
|
||||
.ability {
|
||||
color: red;
|
||||
}
|
||||
|
||||
.passive {
|
||||
color: yellow;
|
||||
}
|
||||
|
||||
@@ -0,0 +1,33 @@
|
||||
<a href="@Href" class="linkButtonContainer">
|
||||
@ChildContent
|
||||
</a>
|
||||
|
||||
<style>
|
||||
.linkButtonContainer {
|
||||
padding: 16px;
|
||||
border: 1px solid;
|
||||
border-radius: 8px;
|
||||
font-weight: 800;
|
||||
font-size: 1.2rem;
|
||||
border-color: var(--primary);
|
||||
background-color: var(--primary);
|
||||
}
|
||||
|
||||
.linkButtonContainer:hover {
|
||||
background-color: var(--primary-hover);
|
||||
border-color: var(--primary-border-hover);
|
||||
color: white;
|
||||
}
|
||||
|
||||
</style>
|
||||
|
||||
|
||||
@code {
|
||||
|
||||
[Parameter] public RenderFragment ChildContent { get; set; } = default!;
|
||||
|
||||
|
||||
[Parameter] public string Href { get; set; } = "";
|
||||
|
||||
|
||||
}
|
||||
@@ -0,0 +1,7 @@
|
||||
namespace Components.Inputs;
|
||||
|
||||
public enum MyButtonType
|
||||
{
|
||||
Primary, // Positive Actions
|
||||
Secondary // Destruction Action
|
||||
}
|
||||
@@ -0,0 +1,66 @@
|
||||
@inject ISearchService SearchService
|
||||
@inject NavigationManager NavigationManager
|
||||
@inject IJSRuntime JsRuntime
|
||||
|
||||
<button id="@Id" class="searchButtonContainer" @onclick="ButtonClicked">
|
||||
<div class="searchText">
|
||||
<i class="fa-solid fa-magnifying-glass" style="margin-left: 3px; margin-right: 6px;"></i> Search...
|
||||
</div>
|
||||
<div class="searchHotkey">
|
||||
@if (IsMac)
|
||||
{
|
||||
<span><i class="fa-solid fa-command"></i>K</span>
|
||||
}
|
||||
else
|
||||
{
|
||||
<span>CTRL + K</span>
|
||||
}
|
||||
|
||||
</div>
|
||||
</button>
|
||||
|
||||
<style>
|
||||
.searchButtonContainer {
|
||||
background-color: var(--primary);
|
||||
border: 2px solid var(--primary-border);
|
||||
border-radius: 8px;
|
||||
font-weight: 800;
|
||||
width: 350px;
|
||||
|
||||
padding: 5px;
|
||||
display: flex;
|
||||
flex-direction: row;
|
||||
justify-content: space-between;
|
||||
align-items: center;
|
||||
|
||||
}
|
||||
|
||||
.searchHotkey {
|
||||
padding: 4px;
|
||||
background-color: rgba(255, 255, 255, 0.05);
|
||||
border: 2px solid rgba(255, 255, 255, 0.25);
|
||||
border-radius: 4px;
|
||||
}
|
||||
</style>
|
||||
|
||||
@code {
|
||||
|
||||
[Parameter] public RenderFragment ChildContent { get; set; } = default!;
|
||||
|
||||
[Parameter] public string Id { get; set; } = default!;
|
||||
|
||||
private string _userAgent = "";
|
||||
|
||||
bool IsMac => _userAgent.Contains("Mac OS");
|
||||
|
||||
private void ButtonClicked(EventArgs eventArgs)
|
||||
{
|
||||
SearchService.Show();
|
||||
}
|
||||
|
||||
protected override async Task OnInitializedAsync()
|
||||
{
|
||||
_userAgent = await JsRuntime.InvokeAsync<string>("getUserAgent");
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,41 @@
|
||||
@inject ISearchService SearchService
|
||||
@inject NavigationManager NavigationManager
|
||||
@inject IJSRuntime JsRuntime
|
||||
|
||||
<button id="@Id" class="searchIconButtonContainer" @onclick="ButtonClicked">
|
||||
<div class="searchIcon">
|
||||
<i class="fa-solid fa-magnifying-glass"></i>
|
||||
</div>
|
||||
</button>
|
||||
|
||||
<style>
|
||||
.searchIconButtonContainer {
|
||||
border-radius: 8px;
|
||||
font-weight: 800;
|
||||
width: 100%;
|
||||
padding: 5px;
|
||||
display: flex;
|
||||
flex-direction: row;
|
||||
justify-content: space-between;
|
||||
align-items: center;
|
||||
}
|
||||
|
||||
.searchIcon {
|
||||
font-size: 28px;
|
||||
text-align: center;
|
||||
margin: auto;
|
||||
}
|
||||
</style>
|
||||
|
||||
@code {
|
||||
|
||||
[Parameter] public RenderFragment ChildContent { get; set; } = default!;
|
||||
|
||||
[Parameter] public string Id { get; set; } = default!;
|
||||
|
||||
private void ButtonClicked(EventArgs eventArgs)
|
||||
{
|
||||
SearchService.Show();
|
||||
}
|
||||
|
||||
}
|
||||
Reference in New Issue
Block a user