diff --git a/Web-Jarmark/Web-Jarmark/Components/Pages/Kosik.razor b/Web-Jarmark/Web-Jarmark/Components/Pages/Kosik.razor index b798990..406c0de 100644 --- a/Web-Jarmark/Web-Jarmark/Components/Pages/Kosik.razor +++ b/Web-Jarmark/Web-Jarmark/Components/Pages/Kosik.razor @@ -10,45 +10,113 @@ Můj košík | Školní jarmark
-

Můj košík

- @if (isLoading) - { -

Načítám košík...

- } - else if (cartItems.Count == 0) - { -
-

Tvůj košík je prázdný

-

Vyber si něco z našeho katalogu.

- Zpět do katalogu +
+
+
+ ŠKOLNÍ JARMARK +

Můj košík

+

Vše, co sis vybral, na jednom místě.

+
+ + ← Pokračovat v nákupu
- } - else - { -
- @foreach (var item in cartItems) - { -
-
-

@item.Product.Name

-

@item.Product.Price.ToString("N0") Kč / ks

-

Množství: @item.Quantity ks

+ + @if (isLoading) + { +

Načítám košík...

+ } + else if (cartItems.Count == 0) + { +
+
🛒
+

Košík je zatím prázdný

+

V katalogu na tebe čeká spousta zajímavých produktů.

+ Prohlédnout katalog +
+ } + else + { +
+
+
+

Vybrané produkty

+ @cartItems.Count položek
- - @((item.Product.Price * item.Quantity).ToString("N0")) Kč - -
- } -
+ @foreach (var item in cartItems) + { +
+
+ @if (!string.IsNullOrWhiteSpace(item.Product.ImageUrl)) + { + @item.Product.Name + } + else + { + 🎁 + } +
-
-

- Celkem: @totalPrice.ToString("N0") Kč -

-
- } +
+

@item.Product.Name

+ @if (item.Product.Category != null) + { + + @item.Product.Category.Name + + } +

@item.Product.Price.ToString("N0") Kč / ks

+
+ +
+ Množství + @item.Quantity ks +
+ +
+ + @((item.Product.Price * item.Quantity).ToString("N0")) Kč + +
+
+ } + + + +
+ } +
+ + @code { diff --git a/Web-Jarmark/Web-Jarmark/jarmark.db-shm b/Web-Jarmark/Web-Jarmark/jarmark.db-shm index fbd59aa..4132def 100644 Binary files a/Web-Jarmark/Web-Jarmark/jarmark.db-shm and b/Web-Jarmark/Web-Jarmark/jarmark.db-shm differ diff --git a/Web-Jarmark/Web-Jarmark/jarmark.db-wal b/Web-Jarmark/Web-Jarmark/jarmark.db-wal index df3e667..7ffadc7 100644 Binary files a/Web-Jarmark/Web-Jarmark/jarmark.db-wal and b/Web-Jarmark/Web-Jarmark/jarmark.db-wal differ diff --git a/Web-Jarmark/Web-Jarmark/wwwroot/app.css b/Web-Jarmark/Web-Jarmark/wwwroot/app.css index 3874325..27b7006 100644 --- a/Web-Jarmark/Web-Jarmark/wwwroot/app.css +++ b/Web-Jarmark/Web-Jarmark/wwwroot/app.css @@ -2376,3 +2376,270 @@ textarea.wj-input { height: 210px; } } + +/* CART PAGE */ + +.cart-page { + padding-top: 40px; + padding-bottom: 70px; +} + +.cart-header { + display: flex; + justify-content: space-between; + align-items: center; + gap: 20px; + margin-bottom: 35px; +} + +.cart-eyebrow { + font-size: 12px; + font-weight: 700; + letter-spacing: 2px; + color: #888; +} + +.cart-header h1 { + font-size: 36px; + font-weight: 800; + margin: 8px 0; +} + +.cart-header p { + color: #777; + margin: 0; +} + +.cart-back-link { + color: inherit; + text-decoration: none; + font-weight: 600; +} + +.cart-layout { + display: grid; + grid-template-columns: minmax(0, 1fr) 340px; + gap: 28px; + align-items: start; +} + +.cart-list-heading { + display: flex; + justify-content: space-between; + align-items: center; + margin-bottom: 18px; +} + + .cart-list-heading h2, + .cart-summary h2 { + font-size: 20px; + font-weight: 750; + } + + .cart-list-heading span { + color: #888; + font-size: 14px; + } + +.cart-product { + display: grid; + grid-template-columns: 100px minmax(0, 1fr) 100px 130px; + align-items: center; + gap: 20px; + padding: 18px; + margin-bottom: 14px; + background: white; + border: 1px solid #eaeaea; + border-radius: 16px; +} + +.cart-product-image { + width: 100px; + height: 100px; + display: flex; + align-items: center; + justify-content: center; + background: #f5f5f5; + border-radius: 12px; + overflow: hidden; + font-size: 35px; +} + + .cart-product-image img { + width: 100%; + height: 100%; + object-fit: cover; + } + +.cart-product-info h3 { + font-size: 17px; + font-weight: 700; + margin: 0 0 7px; +} + +.cart-product-info p { + margin: 8px 0 0; + color: #777; + font-size: 14px; +} + +.cart-category { + display: inline-block; + padding: 4px 9px; + background: #f1f1f1; + border-radius: 20px; + font-size: 12px; + color: #666; +} + +.cart-product-quantity span { + display: block; + color: #888; + font-size: 12px; + margin-bottom: 5px; +} + +.cart-product-quantity strong { + font-size: 15px; +} + +.cart-product-price { + text-align: right; + font-size: 17px; + font-weight: 750; +} + +.cart-summary { + background: white; + border: 1px solid #eaeaea; + border-radius: 18px; + padding: 24px; + position: sticky; + top: 25px; +} + + .cart-summary h2 { + margin: 0 0 25px; + } + +.cart-summary-row { + display: flex; + justify-content: space-between; + margin-bottom: 16px; + font-size: 14px; + color: #777; +} + + .cart-summary-row strong { + color: #222; + } + +.cart-summary-divider { + height: 1px; + background: #eaeaea; + margin: 22px 0; +} + +.cart-summary-total { + display: flex; + justify-content: space-between; + align-items: center; + margin-bottom: 22px; +} + + .cart-summary-total strong { + font-size: 23px; + font-weight: 800; + } + +.cart-primary-button { + display: block; + width: 100%; + padding: 14px 18px; + border: none; + border-radius: 11px; + background: #222; + color: white; + text-align: center; + text-decoration: none; + font-weight: 700; + cursor: pointer; +} + + .cart-primary-button:disabled { + opacity: 0.5; + cursor: not-allowed; + } + +.cart-summary-note { + margin: 14px 0 0; + text-align: center; + font-size: 12px; + color: #888; +} + +.cart-empty { + padding: 75px 20px; + text-align: center; + background: white; + border: 1px solid #eaeaea; + border-radius: 18px; +} + +.cart-empty-icon { + font-size: 55px; + margin-bottom: 15px; +} + +.cart-empty h2 { + font-size: 24px; + font-weight: 750; +} + +.cart-empty p { + color: #777; + margin-bottom: 25px; +} + +.cart-empty .cart-primary-button { + width: auto; + display: inline-block; +} + +/* RESPONSIVE */ + +@media (max-width: 850px) { + .cart-layout { + grid-template-columns: 1fr; + } + + .cart-summary { + position: static; + } +} + +@media (max-width: 600px) { + .cart-header { + align-items: flex-start; + flex-direction: column; + } + + .cart-product { + grid-template-columns: 75px 1fr; + gap: 12px; + } + + .cart-product-image { + width: 75px; + height: 75px; + } + + .cart-product-quantity { + grid-column: 2; + } + + .cart-product-price { + grid-column: 2; + text-align: left; + } +}