hezci disgn katalogu a uvodi stranky

This commit is contained in:
Marek Jarolimek
2026-11-07 09:48:25 +01:00
parent b3a5f42980
commit 1506bfcf09
4 changed files with 763 additions and 43 deletions

View File

@@ -13,10 +13,6 @@
<PageTitle>Školní jarmark | Katalog</PageTitle>
<a href="/kosik" class="catalog-cart-button">
🛒 Zobrazit košík
</a>
@if (showNotification)
{
<div class="cart-notification" role="status" aria-live="polite">
@@ -25,24 +21,104 @@
</div>
}
<div class="shop-page">
<header class="shop-topbar">
<a href="/" class="shop-brand">
<span class="brand-icon">🌿</span>
<span>Školní jarmark</span>
</a>
<a href="/kosik" class="catalog-cart-button">
<span>🛒</span>
<span>Zobrazit košík</span>
</a>
</header>
<main class="market-shell">
<section class="market-heading">
<section class="market-hero">
<div class="hero-content">
<span class="market-eyebrow">
<span class="eyebrow-dot"></span>
TVOŘÍME S RADOSTÍ
</span>
<h1>
Malé výrobky,<br />
<span>velká radost.</span>
</h1>
<p>
Objevte originální výrobky našich žáků.
Každý kousek vznikl s nápadem, péčí a kreativitou.
</p>
<a href="#produkty" class="hero-button">
Prohlédnout nabídku
<span>→</span>
</a>
<div class="hero-note">
<span>✦</span>
Podpořte tvorbu našich žáků
</div>
</div>
<div class="hero-decoration" aria-hidden="true">
<div class="hero-circle hero-circle-one"></div>
<div class="hero-circle hero-circle-two"></div>
<div class="hero-leaf">🌿</div>
<div class="hero-sparkle sparkle-one">✦</div>
<div class="hero-sparkle sparkle-two">✧</div>
<div class="hero-label">
<span>Vyrobeno</span>
<strong>s láskou</strong>
</div>
</div>
</section>
<section class="catalog-section" id="produkty">
<div class="catalog-search">
<span class="search-icon">⌕</span>
<input type="search"
placeholder="Hledat produkt, kategorii nebo popis..."
aria-label="Hledat produkty"
@bind="searchText"
@bind:event="oninput" />
@if (!string.IsNullOrWhiteSpace(searchText))
{
<button type="button"
class="search-clear"
aria-label="Vymazat hledání"
@onclick="ClearSearch">
✕
</button>
}
</div>
<div class="market-heading">
<div>
<span class="market-eyebrow">ŠKOLNÍ JARMARK</span>
<h1>Objevte naše produkty</h1>
<p>Vyberte si z nabídky výrobků našich žáků.</p>
<span class="section-eyebrow">NAŠE NABÍDKA</span>
<h2>Objevte naše produkty</h2>
<p>Vyberte si něco krásného z naší nabídky.</p>
</div>
<div class="market-product-count">
@products.Count produktů
<strong>@FilteredProducts.Count</strong>
<span>@GetProductCountText(FilteredProducts.Count)</span>
</div>
</div>
</section>
@if (isLoading)
{
<div class="market-empty">
Načítám produkty...
<span>⏳</span>
<h3>Načítáme nabídku...</h3>
<p>Za chvilku budou produkty připravené.</p>
</div>
}
else if (products.Count == 0)
@@ -53,10 +129,24 @@
<p>Produkty se zobrazí, jakmile budou přidány do katalogu.</p>
</div>
}
else if (FilteredProducts.Count == 0)
{
<div class="market-empty">
<span>🔎</span>
<h3>Nic jsme nenašli</h3>
<p>Zkus změnit hledaný výraz nebo vymazat hledání.</p>
<button type="button"
class="search-reset-button"
@onclick="ClearSearch">
Zobrazit všechny produkty
</button>
</div>
}
else
{
<section class="market-grid">
@foreach (var product in products)
@foreach (var product in FilteredProducts)
{
<ProductCard @key="product.Id"
Product="product"
@@ -65,9 +155,491 @@
</section>
}
</section>
<footer class="shop-footer">
<span>🌿 Školní jarmark</span>
<span>Vyrobeno s radostí a kreativitou.</span>
</footer>
</main>
</div>
<style>
.shop-page {
min-height: 100vh;
background: #f8f8f3;
color: #24352b;
font-family: inherit;
}
.shop-topbar {
max-width: 1320px;
margin: 0 auto;
padding: 20px 32px;
display: flex;
justify-content: space-between;
align-items: center;
gap: 20px;
}
.shop-brand {
display: flex;
align-items: center;
gap: 11px;
color: #244b35;
text-decoration: none;
font-size: 19px;
font-weight: 800;
letter-spacing: -0.5px;
}
.brand-icon {
width: 39px;
height: 39px;
display: grid;
place-items: center;
background: #e4eddf;
border-radius: 13px;
font-size: 21px;
}
.catalog-cart-button {
display: inline-flex;
align-items: center;
justify-content: center;
gap: 9px;
padding: 12px 19px;
background: #294f38;
color: white;
border: 1px solid #294f38;
border-radius: 12px;
text-decoration: none;
font-size: 14px;
font-weight: 700;
transition: background 0.2s, transform 0.2s;
}
.catalog-cart-button:hover {
background: #1d3d2a;
color: white;
transform: translateY(-2px);
}
.market-shell {
max-width: 1320px;
margin: 0 auto;
padding: 18px 32px 0;
}
.market-hero {
position: relative;
overflow: hidden;
min-height: 370px;
padding: 65px 70px;
display: flex;
align-items: center;
background: #e9efe5;
border: 1px solid #dfe8d9;
border-radius: 25px;
}
.hero-content {
position: relative;
z-index: 2;
max-width: 600px;
}
.market-eyebrow,
.section-eyebrow {
display: inline-flex;
align-items: center;
gap: 9px;
color: #55775c;
font-size: 11px;
font-weight: 800;
letter-spacing: 2px;
}
.eyebrow-dot {
width: 8px;
height: 8px;
background: #739b69;
border-radius: 50%;
}
.market-hero h1 {
margin: 20px 0 15px;
color: #254632;
font-size: clamp(38px, 5vw, 59px);
line-height: 1.08;
letter-spacing: -2.5px;
font-weight: 850;
}
.market-hero h1 span {
color: #729568;
}
.market-hero p {
max-width: 450px;
margin: 0;
color: #617264;
font-size: 16px;
line-height: 1.8;
}
.hero-button {
display: inline-flex;
align-items: center;
gap: 20px;
margin-top: 27px;
padding: 14px 21px;
background: #315b3e;
color: white;
border-radius: 11px;
text-decoration: none;
font-size: 14px;
font-weight: 750;
transition: background 0.2s, transform 0.2s;
}
.hero-button:hover {
background: #21432d;
color: white;
transform: translateY(-2px);
}
.hero-button span {
font-size: 19px;
}
.hero-note {
display: flex;
align-items: center;
gap: 8px;
margin-top: 24px;
color: #6b806b;
font-size: 12px;
font-weight: 650;
}
.hero-note span {
color: #8aab72;
font-size: 17px;
}
.hero-decoration {
position: absolute;
top: 0;
right: 0;
width: 42%;
height: 100%;
}
.hero-circle {
position: absolute;
border-radius: 50%;
}
.hero-circle-one {
width: 290px;
height: 290px;
top: 38px;
right: 65px;
background: #d5e2cc;
}
.hero-circle-two {
width: 210px;
height: 210px;
top: 80px;
right: 105px;
border: 2px solid rgba(87, 126, 80, 0.18);
}
.hero-leaf {
position: absolute;
top: 82px;
right: 128px;
width: 160px;
height: 160px;
display: grid;
place-items: center;
background: #f8f8f0;
border-radius: 45px;
box-shadow: 0 18px 45px rgba(48, 77, 47, 0.12);
font-size: 85px;
transform: rotate(-9deg);
}
.hero-sparkle {
position: absolute;
color: #829b69;
}
.sparkle-one {
top: 47px;
right: 75px;
font-size: 32px;
}
.sparkle-two {
bottom: 52px;
right: 275px;
font-size: 35px;
}
.hero-label {
position: absolute;
right: 35px;
bottom: 45px;
display: flex;
flex-direction: column;
padding: 13px 19px;
background: #fffdf5;
border-radius: 12px;
box-shadow: 0 8px 25px rgba(48, 77, 47, 0.10);
transform: rotate(4deg);
}
.hero-label span {
color: #82917c;
font-size: 10px;
}
.hero-label strong {
color: #315b3e;
font-size: 15px;
}
.catalog-section {
padding-top: 45px;
}
/* Vyhledávání */
.catalog-search {
display: flex;
align-items: center;
gap: 13px;
max-width: 650px;
margin: 0 auto 42px;
padding: 5px 17px;
background: #ffffff;
border: 1px solid #e2e8df;
border-radius: 14px;
box-shadow: 0 5px 20px rgba(37, 62, 43, 0.05);
transition: border-color 0.2s, box-shadow 0.2s;
}
.catalog-search:focus-within {
border-color: #739568;
box-shadow: 0 0 0 3px rgba(115, 149, 104, 0.12);
}
.catalog-search input {
width: 100%;
min-width: 0;
padding: 13px 0;
border: none;
outline: none;
background: transparent;
color: #294632;
font-size: 14px;
}
.catalog-search input::placeholder {
color: #9aa69a;
}
.search-icon {
color: #739568;
font-size: 27px;
}
.search-clear {
border: none;
background: transparent;
color: #758575;
cursor: pointer;
font-size: 17px;
}
.search-clear:hover {
color: #294632;
}
.search-reset-button {
margin-top: 15px;
padding: 11px 17px;
border: none;
border-radius: 9px;
background: #315b3e;
color: white;
font-weight: 700;
cursor: pointer;
}
.search-reset-button:hover {
background: #21432d;
}
.market-heading {
display: flex;
align-items: end;
justify-content: space-between;
gap: 20px;
margin-bottom: 28px;
}
.market-heading h2 {
margin: 10px 0 7px;
color: #263d2d;
font-size: clamp(25px, 3vw, 33px);
font-weight: 800;
letter-spacing: -1px;
}
.market-heading p {
margin: 0;
color: #7b877c;
font-size: 14px;
}
.market-product-count {
display: flex;
flex-direction: column;
align-items: center;
justify-content: center;
min-width: 85px;
padding: 12px 17px;
background: #edf2e9;
border: 1px solid #dfe8d9;
border-radius: 13px;
color: #527052;
}
.market-product-count strong {
font-size: 22px;
line-height: 1.2;
color: #315b3e;
}
.market-product-count span {
margin-top: 3px;
font-size: 11px;
}
.market-grid {
display: grid;
grid-template-columns: repeat(3, minmax(0, 1fr));
gap: 25px;
}
.market-grid .market-card {
overflow: hidden;
background: #ffffff;
border: 1px solid #e8ebe4;
border-radius: 18px;
box-shadow: 0 5px 18px rgba(37, 62, 43, 0.045);
transition: transform 0.22s, box-shadow 0.22s;
}
.market-grid .market-card:hover {
transform: translateY(-5px);
box-shadow: 0 13px 30px rgba(37, 62, 43, 0.10);
}
.market-grid .market-product-picture {
background: #f0f3ec;
}
.market-grid .market-product-tag {
background: #e2ebdc;
color: #426348;
border-radius: 7px;
font-size: 11px;
font-weight: 700;
}
.market-grid .market-card-content {
padding: 19px;
}
.market-grid .market-card-content h3 {
color: #2d4433;
font-size: 17px;
font-weight: 750;
}
.market-grid .market-description {
color: #7b857b;
font-size: 13px;
line-height: 1.6;
}
.market-grid .market-stock {
color: #748174;
font-size: 12px;
}
.market-grid .market-card-bottom strong {
color: #315b3e;
font-size: 20px;
}
.market-grid .product-cart-button {
background: #315b3e;
border: 1px solid #315b3e;
border-radius: 10px;
color: white;
font-weight: 700;
transition: background 0.2s;
}
.market-grid .product-cart-button:hover:not(:disabled) {
background: #21432d;
}
.market-empty {
padding: 65px 20px;
text-align: center;
background: white;
border: 1px solid #e8ebe4;
border-radius: 18px;
}
.market-empty > span {
font-size: 38px;
}
.market-empty h3 {
margin: 14px 0 8px;
color: #31513a;
}
.market-empty p {
color: #7b877c;
font-size: 14px;
}
.shop-footer {
display: flex;
justify-content: space-between;
gap: 15px;
margin-top: 75px;
padding: 24px 0;
border-top: 1px solid #e4e9df;
color: #879186;
font-size: 12px;
}
.shop-footer span:first-child {
color: #49694d;
font-weight: 750;
}
.cart-notification {
position: fixed;
top: 25px;
@@ -125,7 +697,115 @@
}
}
@@media (max-width: 500px) {
@@media (max-width: 900px) {
.market-grid {
grid-template-columns: repeat(2, minmax(0, 1fr));
}
.market-hero {
padding: 50px 40px;
}
.hero-decoration {
opacity: 0.65;
right: -65px;
}
.hero-content {
max-width: 65%;
}
}
@@media (max-width: 600px) {
.shop-topbar {
padding: 15px 17px;
}
.shop-brand {
font-size: 15px;
}
.catalog-cart-button {
padding: 10px 12px;
font-size: 12px;
}
.market-shell {
padding: 10px 15px 0;
}
.market-hero {
min-height: 390px;
padding: 38px 25px;
align-items: flex-start;
border-radius: 19px;
}
.hero-content {
max-width: 100%;
}
.market-hero h1 {
font-size: 42px;
}
.market-hero p {
max-width: 330px;
font-size: 14px;
}
.hero-decoration {
opacity: 0.25;
right: -100px;
top: 100px;
}
.hero-circle-one {
width: 220px;
height: 220px;
}
.hero-leaf {
width: 120px;
height: 120px;
font-size: 65px;
}
.catalog-section {
padding-top: 35px;
}
.catalog-search {
margin-bottom: 30px;
}
.market-heading {
align-items: center;
}
.market-heading h2 {
font-size: 23px;
}
.market-heading p {
font-size: 12px;
}
.market-product-count {
min-width: 65px;
padding: 9px;
}
.market-grid {
grid-template-columns: 1fr;
gap: 17px;
}
.shop-footer {
flex-direction: column;
margin-top: 45px;
}
.cart-notification {
top: 15px;
right: 12px;
@@ -133,6 +813,15 @@
justify-content: center;
}
}
@@media (prefers-reduced-motion: reduce) {
.shop-page *,
.shop-page *::before,
.shop-page *::after {
animation-duration: 0.01ms !important;
transition-duration: 0.01ms !important;
}
}
</style>
@code {
@@ -140,6 +829,8 @@
private bool isLoading = true;
private string? cartToken;
private string searchText = "";
private bool showNotification;
private string notificationMessage = "";
@@ -147,6 +838,37 @@
private PersistingComponentStateSubscription? subscription;
private List<Product> FilteredProducts =>
products
.Where(p =>
string.IsNullOrWhiteSpace(searchText)
|| p.Name.Contains(
searchText.Trim(),
StringComparison.OrdinalIgnoreCase)
|| (p.Description?.Contains(
searchText.Trim(),
StringComparison.OrdinalIgnoreCase) ?? false)
|| (p.Category?.Name.Contains(
searchText.Trim(),
StringComparison.OrdinalIgnoreCase) ?? false))
.ToList();
private void ClearSearch()
{
searchText = "";
}
private string GetProductCountText(int count)
{
if (count == 1)
return "produkt";
if (count >= 2 && count <= 4)
return "produkty";
return "produktů";
}
protected override async Task OnInitializedAsync()
{
try
@@ -220,7 +942,6 @@
await DbContext.SaveChangesAsync();
// Zobrazíme potvrzení až po úspěšném uložení.
await ShowCartNotification(product.Name);
}
@@ -238,7 +959,6 @@
try
{
// 2,5 sekundy zobrazení + 1 sekunda postupného zmizení.
await Task.Delay(3500, currentCts.Token);
if (!currentCts.Token.IsCancellationRequested)

Binary file not shown.