diff --git a/MidrandBookshop/Components/Layout/CartItem.cs b/MidrandBookshop/Components/Layout/CartItem.cs deleted file mode 100644 index 93278d3..0000000 --- a/MidrandBookshop/Components/Layout/CartItem.cs +++ /dev/null @@ -1,10 +0,0 @@ -namespace MidrandBookshop.Components.Layout; - -public class CartItem - { - public int Id { get; set; } - public string Title { get; set; } = string.Empty; - public string Author { get; set; } = string.Empty; - public int Price { get; set; } - public int Quantity { get; set; } - } \ No newline at end of file diff --git a/MidrandBookshop/Components/Pages/Home.razor b/MidrandBookshop/Components/Pages/Home.razor index 5c4f1c7..f57bb0e 100644 --- a/MidrandBookshop/Components/Pages/Home.razor +++ b/MidrandBookshop/Components/Pages/Home.razor @@ -1,7 +1,9 @@ @page "/" @rendermode InteractiveServer -
+
+ +

Discover thoughtfully curated
books for every reader.

@@ -147,7 +149,7 @@ {
@book.Name - by @(ActiveAuthorFilterName ?? "Multiple Authors") + by @(ProductAuthorCache.TryGetValue(book.Id, out var authorName) ? authorName : "Unknown Author") @ProductPrimaryCategoryCache[book.Id].ToUpper()
@@ -196,7 +198,6 @@ + href="#top-target"> \ No newline at end of file diff --git a/MidrandBookshop/Components/Pages/Home.razor.cs b/MidrandBookshop/Components/Pages/Home.razor.cs index aedb677..8c9823e 100644 --- a/MidrandBookshop/Components/Pages/Home.razor.cs +++ b/MidrandBookshop/Components/Pages/Home.razor.cs @@ -19,6 +19,7 @@ public partial class Home : ComponentBase [SupplyParameterFromQuery(Name = "q")] public string? SharedSearchQuery { get; set; } [SupplyParameterFromQuery] public long? AuthorId { get; set; } + private ElementReference topTargetRef; public enum ViewMode { Grid, List } private ViewMode CurrentViewMode = ViewMode.Grid; private string ActiveCategory = "All"; diff --git a/MidrandBookshop/Components/Pages/Home.razor.css b/MidrandBookshop/Components/Pages/Home.razor.css index 82cda5c..071284e 100644 --- a/MidrandBookshop/Components/Pages/Home.razor.css +++ b/MidrandBookshop/Components/Pages/Home.razor.css @@ -170,3 +170,8 @@ html { border-color: #ffffff !important; box-shadow: 0 0 0 2px #1a1a1a, 0 6px 16px rgba(0, 0, 0, 0.25) !important; } + +/* Direct the smooth scroll action straight to the layout viewport boundary */ +#top-target { + scroll-margin-top: 100vh; +} \ No newline at end of file