- @foreach (var item in Headers)
+ @foreach (var header in Headers)
{
-
}
diff --git a/src/GameIdeas/Client/GameIdeas.BlazorApp/Shared/Components/Select/SelectList.razor.cs b/src/GameIdeas/Client/GameIdeas.BlazorApp/Shared/Components/Select/SelectList.razor.cs
index ffcd07b..4aa9e5e 100644
--- a/src/GameIdeas/Client/GameIdeas.BlazorApp/Shared/Components/Select/SelectList.razor.cs
+++ b/src/GameIdeas/Client/GameIdeas.BlazorApp/Shared/Components/Select/SelectList.razor.cs
@@ -3,24 +3,25 @@ using Microsoft.AspNetCore.Components;
namespace GameIdeas.BlazorApp.Shared.Components.Select;
-public partial class SelectList
+public partial class SelectList
{
[Parameter] public RenderFragment? ChildContent { get; set; }
[Parameter] public TItem? Value { get; set; }
[Parameter] public EventCallback ValueChanged { get; set; }
- [Parameter] public TItem? Header { get; set; }
- [Parameter] public EventCallback HeaderChanged { get; set; }
+ [Parameter] public THeader? Header { get; set; }
+ [Parameter] public EventCallback HeaderChanged { get; set; }
[Parameter] public IEnumerable> Items { get; set; } = [];
- [Parameter] public IEnumerable> Headers { get; set; } = [];
+ [Parameter] public IEnumerable> Headers { get; set; } = [];
[Parameter] public SelectListTheme Theme { get; set; }
[Parameter] public bool AlignRight { get; set; }
private bool IsContentOpen = false;
- private void HandleButtonClicked()
- {
+ public void Close() =>
+ IsContentOpen = false;
+
+ private void HandleButtonClicked() =>
IsContentOpen = !IsContentOpen;
- }
private void HandleContentClosed()
{
@@ -40,7 +41,7 @@ public partial class SelectList
await ValueChanged.InvokeAsync(Value);
}
- private async Task HandleHeaderClicked(SelectElement selectedValue)
+ private async Task HandleHeaderClicked(SelectElement selectedValue)
{
foreach (var header in Headers)
{
diff --git a/src/GameIdeas/Client/GameIdeas.BlazorApp/Shared/Components/Slider/Slider.razor b/src/GameIdeas/Client/GameIdeas.BlazorApp/Shared/Components/Slider/Slider.razor
new file mode 100644
index 0000000..d4db8aa
--- /dev/null
+++ b/src/GameIdeas/Client/GameIdeas.BlazorApp/Shared/Components/Slider/Slider.razor
@@ -0,0 +1,11 @@
+
+
+
+
+
+
+ @Params.Min
+ @Params.Max
+
+
diff --git a/src/GameIdeas/Client/GameIdeas.BlazorApp/Shared/Components/Slider/Slider.razor.cs b/src/GameIdeas/Client/GameIdeas.BlazorApp/Shared/Components/Slider/Slider.razor.cs
new file mode 100644
index 0000000..007bf0a
--- /dev/null
+++ b/src/GameIdeas/Client/GameIdeas.BlazorApp/Shared/Components/Slider/Slider.razor.cs
@@ -0,0 +1,30 @@
+using Microsoft.AspNetCore.Components;
+
+namespace GameIdeas.BlazorApp.Shared.Components.Slider;
+
+public partial class Slider
+{
+ [Parameter] public SliderParams Params { get; set; } = new();
+ [Parameter] public int Value { get; set; }
+ [Parameter] public EventCallback ValueChanged { get; set; }
+
+ private async Task HandleSlideOnInput()
+ {
+ await ValueChanged.InvokeAsync(Value);
+ }
+
+ private string StatusColor(int value)
+ {
+ string str = "--thumb-color: var({0});";
+
+ int firstTier = (int)Math.Floor(0.33 * Params.Max);
+ int secondTier = (int)Math.Ceiling(0.66 * Params.Max);
+
+ return value switch
+ {
+ int x when x <= firstTier => string.Format(str, "--red"),
+ int x when x >= secondTier => string.Format(str, "--green"),
+ _ => string.Format(str, "--yellow"),
+ };
+ }
+}
\ No newline at end of file
diff --git a/src/GameIdeas/Client/GameIdeas.BlazorApp/Shared/Components/Slider/Slider.razor.css b/src/GameIdeas/Client/GameIdeas.BlazorApp/Shared/Components/Slider/Slider.razor.css
new file mode 100644
index 0000000..5954b37
--- /dev/null
+++ b/src/GameIdeas/Client/GameIdeas.BlazorApp/Shared/Components/Slider/Slider.razor.css
@@ -0,0 +1,89 @@
+.container {
+ position: relative;
+ width: 100%;
+ z-index: var(--index-component)
+}
+
+input[type="range"] {
+ -webkit-appearance: none;
+ -moz-appearance: none;
+ appearance: none;
+ width: 100%;
+ outline: none;
+ margin: auto;
+ position: absolute;
+ top: 0;
+ bottom: 0;
+ background-color: transparent;
+ pointer-events: none;
+}
+
+.slider-track {
+ width: 100%;
+ height: 2px;
+ margin: auto;
+ border-radius: 2px;
+ background: var(--input-primary);
+
+}
+
+input[type="range"]::-webkit-slider-runnable-track {
+ -webkit-appearance: none;
+ height: 2px;
+}
+
+input[type="range"]::-moz-range-track {
+ -moz-appearance: none;
+ height: 2px;
+}
+
+input[type="range"]::-ms-track {
+ appearance: none;
+ height: 2px;
+}
+
+input[type="range"]::-webkit-slider-thumb {
+ -webkit-appearance: none;
+ height: 1em;
+ width: 1em;
+ background-color: var(--thumb-color);
+ cursor: pointer;
+ margin-top: -6px;
+ pointer-events: auto;
+ border-radius: 50%;
+}
+
+input[type="range"]::-moz-range-thumb {
+ -webkit-appearance: none;
+ height: 1em;
+ width: 1em;
+ cursor: pointer;
+ border-radius: 50%;
+ background-color: var(--thumb-color);
+ pointer-events: auto;
+ border: none;
+}
+
+input[type="range"]::-ms-thumb {
+ appearance: none;
+ height: 1em;
+ width: 1em;
+ cursor: pointer;
+ border-radius: 50%;
+ background-color: var(--thumb-color);
+ pointer-events: auto;
+}
+
+.values {
+ display: flex;
+ position: absolute;
+ margin-top: 2px;
+ width: 100%;
+ font-weight: bold;
+ justify-content: space-between;
+}
+
+.value {
+ width: 1em;
+ text-align:center;
+}
diff --git a/src/GameIdeas/Client/GameIdeas.BlazorApp/Shared/Components/Slider/SliderParams.cs b/src/GameIdeas/Client/GameIdeas.BlazorApp/Shared/Components/Slider/SliderParams.cs
new file mode 100644
index 0000000..5ba67e0
--- /dev/null
+++ b/src/GameIdeas/Client/GameIdeas.BlazorApp/Shared/Components/Slider/SliderParams.cs
@@ -0,0 +1,8 @@
+namespace GameIdeas.BlazorApp.Shared.Components.Slider;
+
+public class SliderParams
+{
+ public int Min{ get; set; }
+ public int Max { get; set; }
+ public int Gap { get; set; } = 0;
+}
diff --git a/src/GameIdeas/Client/GameIdeas.BlazorApp/Shared/Components/SliderRange/SliderRange.razor b/src/GameIdeas/Client/GameIdeas.BlazorApp/Shared/Components/SliderRange/SliderRange.razor
index f0eb5ab..ca54e27 100644
--- a/src/GameIdeas/Client/GameIdeas.BlazorApp/Shared/Components/SliderRange/SliderRange.razor
+++ b/src/GameIdeas/Client/GameIdeas.BlazorApp/Shared/Components/SliderRange/SliderRange.razor
@@ -1,13 +1,13 @@

diff --git a/src/GameIdeas/Client/GameIdeas.BlazorApp/Shared/Components/SliderRange/SliderRange.razor.cs b/src/GameIdeas/Client/GameIdeas.BlazorApp/Shared/Components/SliderRange/SliderRange.razor.cs
index 41841cb..2fee237 100644
--- a/src/GameIdeas/Client/GameIdeas.BlazorApp/Shared/Components/SliderRange/SliderRange.razor.cs
+++ b/src/GameIdeas/Client/GameIdeas.BlazorApp/Shared/Components/SliderRange/SliderRange.razor.cs
@@ -13,30 +13,28 @@ public partial class SliderRange
private async Task HandleSlideTwoInput()
{
- if (Params.ValueMax - Params.ValueMin <= Params.Gap)
+ if (Max - Min <= Params.Gap)
{
- Params.ValueMin = Params.ValueMax - Params.Gap;
+ Min = Max - Params.Gap;
}
- Max = Params.Max;
- await MaxChanged.InvokeAsync(Params.Max);
+ await MaxChanged.InvokeAsync(Max);
}
private async Task HandleSlideOnInput()
{
- if (Params.ValueMax - Params.ValueMin <= Params.Gap)
+ if (Max - Min <= Params.Gap)
{
- Params.ValueMax = Params.ValueMin + Params.Gap;
+ Max = Min + Params.Gap;
}
- Min = Params.Min;
- await MinChanged.InvokeAsync(Params.Min);
+ await MinChanged.InvokeAsync(Min);
}
private string FillColor()
{
- var percent1 = (double)(Params.ValueMin - Params.Min) / (Params.Max - Params.Min) * 100;
- var percent2 = (double)(Params.ValueMax - Params.Min) / (Params.Max - Params.Min) * 100;
+ var percent1 = (double)(Min - Params.Min) / (Params.Max - Params.Min) * 100;
+ var percent2 = (double)(Max - Params.Min) / (Params.Max - Params.Min) * 100;
return $"background: linear-gradient(to right, var(--line) {percent1}% , var(--violet) {percent1}% , var(--violet) {percent2}%, var(--line) {percent2}%)";
}
diff --git a/src/GameIdeas/Client/GameIdeas.BlazorApp/Shared/Components/SliderRange/SliderRangeParams.cs b/src/GameIdeas/Client/GameIdeas.BlazorApp/Shared/Components/SliderRange/SliderRangeParams.cs
index b82f00b..7b65539 100644
--- a/src/GameIdeas/Client/GameIdeas.BlazorApp/Shared/Components/SliderRange/SliderRangeParams.cs
+++ b/src/GameIdeas/Client/GameIdeas.BlazorApp/Shared/Components/SliderRange/SliderRangeParams.cs
@@ -4,7 +4,5 @@ public class SliderRangeParams
{
public int Min{ get; set; }
public int Max { get; set; }
- public int ValueMin { get; set; }
- public int ValueMax { get; set; }
public int Gap { get; set; } = 0;
}
diff --git a/src/GameIdeas/Client/GameIdeas.BlazorApp/Shared/Constants/Endpoints.cs b/src/GameIdeas/Client/GameIdeas.BlazorApp/Shared/Constants/Endpoints.cs
new file mode 100644
index 0000000..f07b369
--- /dev/null
+++ b/src/GameIdeas/Client/GameIdeas.BlazorApp/Shared/Constants/Endpoints.cs
@@ -0,0 +1,14 @@
+namespace GameIdeas.BlazorApp.Shared.Constants;
+
+public static class Endpoints
+{
+ public static class Game
+ {
+
+ }
+
+ public static class Category
+ {
+ public static readonly string AllCategories = "api/Category/All";
+ }
+}
diff --git a/src/GameIdeas/GameIdeas.Shared/Constants/Icons.cs b/src/GameIdeas/Client/GameIdeas.BlazorApp/Shared/Constants/Icons.cs
similarity index 62%
rename from src/GameIdeas/GameIdeas.Shared/Constants/Icons.cs
rename to src/GameIdeas/Client/GameIdeas.BlazorApp/Shared/Constants/Icons.cs
index 5c2f030..26ade56 100644
--- a/src/GameIdeas/GameIdeas.Shared/Constants/Icons.cs
+++ b/src/GameIdeas/Client/GameIdeas.BlazorApp/Shared/Constants/Icons.cs
@@ -1,4 +1,6 @@
-namespace GameIdeas.Shared.Constants;
+using Microsoft.AspNetCore.Components;
+
+namespace GameIdeas.BlazorApp.Shared.Constants;
public static class Icons
{
@@ -8,16 +10,19 @@ public static class Icons
public static class Search
{
- public const string Clear = OpenBraket +
- "" +
- CloseBraket;
-
- public const string Glass = OpenBraket +
+ public readonly static MarkupString Glass = new(OpenBraket +
"" +
- CloseBraket;
+ CloseBraket);
- public const string Triangle = OpenBraket +
+ public readonly static MarkupString Triangle = new(OpenBraket +
"" +
- CloseBraket;
+ CloseBraket);
+ }
+
+ public static class Shared
+ {
+ public readonly static MarkupString Close = new(OpenBraket +
+ "" +
+ CloseBraket);
}
}
diff --git a/src/GameIdeas/Client/GameIdeas.BlazorApp/Shared/Exceptions/CategoryNotFoundException.cs b/src/GameIdeas/Client/GameIdeas.BlazorApp/Shared/Exceptions/CategoryNotFoundException.cs
new file mode 100644
index 0000000..e0b6d9e
--- /dev/null
+++ b/src/GameIdeas/Client/GameIdeas.BlazorApp/Shared/Exceptions/CategoryNotFoundException.cs
@@ -0,0 +1,3 @@
+namespace GameIdeas.BlazorApp.Shared.Exceptions;
+
+public class CategoryNotFoundException(string message) : Exception(message);
diff --git a/src/GameIdeas/Client/GameIdeas.BlazorApp/wwwroot/css/app.css b/src/GameIdeas/Client/GameIdeas.BlazorApp/wwwroot/css/app.css
index 54720d9..7580dab 100644
--- a/src/GameIdeas/Client/GameIdeas.BlazorApp/wwwroot/css/app.css
+++ b/src/GameIdeas/Client/GameIdeas.BlazorApp/wwwroot/css/app.css
@@ -33,7 +33,6 @@ html {
font-family: 'Noto Sans', sans-serif;
font-size: 12px;
color: var(--white);
- overflow: hidden;
}
html, body, #app {
diff --git a/src/GameIdeas/Client/GameIdeas.BlazorApp/wwwroot/index.html b/src/GameIdeas/Client/GameIdeas.BlazorApp/wwwroot/index.html
index 13a0479..bc8684e 100644
--- a/src/GameIdeas/Client/GameIdeas.BlazorApp/wwwroot/index.html
+++ b/src/GameIdeas/Client/GameIdeas.BlazorApp/wwwroot/index.html
@@ -28,6 +28,7 @@
+