Adds custom button razor components

This commit is contained in:
BinaryAlley committed 2024-09-04 16:27:40 +03:00
1 parent 0df801d12f
commit 010e532394
5 files changed
+178 -1

No files matched your search

@@ -0,0 +1,8 @@
<button type="submit" class="abort-button f-16 w-100px @CssClass" @onclick="OnClick" disabled="@IsDisabled">@ChildContent</button>
@code {
[Parameter] public RenderFragment? ChildContent { get; set; }
[Parameter] public EventCallback OnClick { get; set; }
[Parameter] public bool IsDisabled { get; set; }
[Parameter] public string? CssClass { get; set; }
}
@@ -0,0 +1,80 @@
.abort-button {
text-decoration: none;
border-radius: 4px;
border: solid 1px;
border-color: #006666 #004030 #003020 #006666;
background: linear-gradient(to bottom, #90AEA6 0%, #336659 50%, #004030 50%, #004030 100%);
color: #999999;
position: relative;
overflow: hidden;
transition: all 0.3s;
cursor: pointer;
outline: none;
box-shadow: 0 4px 4px rgba(0, 0, 0, 0.5);
z-index: 1;
}
.abort-button:before {
content: "";
position: absolute;
bottom: 0;
left: 0;
right: 0;
height: 50%;
background: radial-gradient(circle at center, #00FF00, transparent);
background-size: 120% 100%;
transform: translateY(100%);
background-position: center;
transition: transform 0.3s, opacity 0.8s;
pointer-events: none;
opacity: 0;
filter: blur(8px);
}
.abort-button:hover:before {
transform: translateY(50%);
opacity: 1;
}
.abort-button:active {
background: #CC009F58;
font-style: italic;
}
.abort-button:hover {
color: #fff;
}
.abort-button:disabled {
background: #333333;
border-color: #333333;
color: #777;
cursor: not-allowed;
}
.abort-button:disabled:hover:before {
transform: translateY(100%);
opacity: 0;
}
.abort-button:disabled:active {
font-style: normal;
}
.abort-button[disabled] {
background: #333333;
border-color: #333333;
color: #777;
cursor: not-allowed;
pointer-events: none;
text-decoration: none;
}
.abort-button[disabled]:hover:before {
transform: translateY(100%);
opacity: 0;
}
.abort-button[disabled]:active {
font-style: normal;
}
@@ -0,0 +1,8 @@
<button type="submit" class="confirm-button f-16 w-100px @CssClass" @onclick="OnClick" disabled="@IsDisabled">@ChildContent</button>
@code {
[Parameter] public RenderFragment? ChildContent { get; set; }
[Parameter] public EventCallback OnClick { get; set; }
[Parameter] public bool IsDisabled { get; set; }
[Parameter] public string? CssClass { get; set; }
}
@@ -0,0 +1,80 @@
.confirm-button {
text-decoration: none;
border-radius: 4px;
border: solid 1px;
border-color: #363636 #000 #000 #363636;
background: linear-gradient(to bottom, #AAAAAA 0%, #363636 50%, #000 50%, #000 100%);
color: #AAAAAA;
position: relative;
overflow: hidden;
transition: all 0.3s;
cursor: pointer;
outline: none;
box-shadow: 0 4px 4px rgba(0, 0, 0, 0.5);
z-index: 1;
}
.confirm-button:before {
content: "";
position: absolute;
bottom: 0;
left: 0;
right: 0;
height: 50%;
background: radial-gradient(circle at center, #00FF8B, transparent);
background-size: 120% 100%;
transform: translateY(100%);
background-position: center;
transition: transform 0.3s, opacity 0.8s;
pointer-events: none;
opacity: 0;
filter: blur(8px);
}
.confirm-button:hover {
color: #fff;
}
.confirm-button:hover:before {
transform: translateY(50%);
opacity: 1;
}
.confirm-button:active {
background: #CC000000;
font-style: italic;
}
.confirm-button:disabled {
background: #333333;
border-color: #333333;
color: #777;
cursor: not-allowed;
}
.confirm-button:disabled:hover:before {
transform: translateY(100%);
opacity: 0;
}
.confirm-button:disabled:active {
font-style: normal;
}
confirm-button[disabled] {
background: #333333;
border-color: #333333;
color: #777;
cursor: not-allowed;
pointer-events: none;
text-decoration: none;
}
.confirm-button[disabled]:hover:before {
transform: translateY(100%);
opacity: 0;
}
.confirm-button[disabled]:active {
font-style: normal;
}
@@ -5,7 +5,7 @@
@implements IDisposable
<div class="enlightenment-combobox inline-block w-100 @(IsOpen ? "open" : string.Empty)">
<div class="enlightenment-combobox inline-block w-100 @(IsOpen ? "open" : string.Empty) @CssClass">
<div class="shine-effect"></div>
<input type="checkbox" class="enlightenment-toggle-checkbox" @bind="IsOpen" id="@Id" @onclick="ToggleDropdown">
<label class="enlightenment-toggle" for="@Id">
@@ -28,6 +28,7 @@
[Parameter] public List<ComboboxItem> Items { get; set; } = [];
[Parameter] public ComboboxItem? SelectedItem { get; set; }
[Parameter] public EventCallback<ComboboxItem> SelectedItemChanged { get; set; }
[Parameter] public string? CssClass { get; set; }
private bool IsOpen { get; set; }
private string Id { get; set; } = $"combobox_{Guid.NewGuid()}";