diff --git a/src/routes/+layout.svelte b/src/routes/+layout.svelte index 9057876..b857f75 100644 --- a/src/routes/+layout.svelte +++ b/src/routes/+layout.svelte @@ -1,56 +1,159 @@
- Kochwas - {#if showHeaderSearch} - - {/if} -
- 🍽️ - ⚙️ - +
+ Kochwas + {#if showHeaderSearch} + + {/if} +
+ 🍽️ + ⚙️ + +
@@ -77,12 +180,16 @@ position: sticky; top: 0; z-index: 10; + background: white; + border-bottom: 1px solid #e4eae7; + } + .bar-inner { + max-width: 760px; + margin: 0 auto; display: flex; align-items: center; gap: 0.6rem; padding: 0.6rem 1rem; - background: white; - border-bottom: 1px solid #e4eae7; } .brand { font-size: 1.15rem; @@ -91,9 +198,12 @@ color: #2b6a3d; flex-shrink: 0; } - .nav-search { + .nav-search-wrap { + position: relative; flex: 1; min-width: 0; + } + .nav-search { display: flex; } .nav-search input { @@ -110,12 +220,113 @@ outline-offset: 1px; background: white; } + .dropdown { + position: absolute; + top: calc(100% + 0.4rem); + left: 0; + right: 0; + background: white; + border: 1px solid #e4eae7; + border-radius: 12px; + box-shadow: 0 14px 40px rgba(0, 0, 0, 0.18); + max-height: 70vh; + overflow-y: auto; + z-index: 50; + } + .dd-list { + list-style: none; + padding: 0.35rem; + margin: 0; + display: flex; + flex-direction: column; + gap: 0.1rem; + } + .dd-item { + display: flex; + align-items: center; + gap: 0.65rem; + padding: 0.45rem 0.55rem; + text-decoration: none; + color: #1a1a1a; + border-radius: 10px; + min-height: 52px; + } + .dd-item:hover { + background: #f4f8f5; + } + .dd-item img, + .dd-placeholder { + width: 44px; + height: 44px; + object-fit: cover; + border-radius: 8px; + background: #eef3ef; + display: grid; + place-items: center; + font-size: 1.3rem; + flex-shrink: 0; + } + .dd-body { + min-width: 0; + flex: 1; + } + .dd-title { + font-weight: 600; + font-size: 0.95rem; + line-height: 1.25; + overflow: hidden; + text-overflow: ellipsis; + white-space: nowrap; + } + .dd-domain { + font-size: 0.78rem; + color: #888; + margin-top: 0.1rem; + } + .dd-status { + text-align: center; + color: #888; + padding: 0.9rem 0.6rem; + margin: 0; + font-size: 0.9rem; + } + .dd-web { + display: block; + padding: 0.75rem 0.85rem; + text-align: center; + border-top: 1px solid #e4eae7; + text-decoration: none; + color: #2b6a3d; + font-size: 0.95rem; + background: #fafdfb; + } + .dd-web:hover { + background: #eaf4ed; + } .bar-right { display: flex; align-items: center; gap: 0.4rem; flex-shrink: 0; } + .nav-link { + display: inline-flex; + align-items: center; + justify-content: center; + width: 40px; + height: 40px; + border-radius: 999px; + text-decoration: none; + font-size: 1.15rem; + } + .nav-link:hover { + background: #f4f8f5; + } + main { + padding: 0 1rem 4rem; + max-width: 760px; + margin: 0 auto; + } @media (max-width: 520px) { .brand { font-size: 0; @@ -139,22 +350,4 @@ font-size: 1.05rem; } } - .nav-link { - display: inline-flex; - align-items: center; - justify-content: center; - width: 40px; - height: 40px; - border-radius: 999px; - text-decoration: none; - font-size: 1.15rem; - } - .nav-link:hover { - background: #f4f8f5; - } - main { - padding: 0 1rem 4rem; - max-width: 760px; - margin: 0 auto; - } diff --git a/src/routes/+page.svelte b/src/routes/+page.svelte index ca7c74d..ace0500 100644 --- a/src/routes/+page.svelte +++ b/src/routes/+page.svelte @@ -1,23 +1,61 @@

Kochwas

-
+
-{#if recent.length > 0} +{#if activeSearch} +
+ {#if searching && hits.length === 0} +

Suche läuft …

+ {:else if hits.length > 0} + + {:else if searchedFor === query.trim()} +
+

Keine lokalen Rezepte für „{searchedFor}".

+ + 🌐 Im Internet weitersuchen + +
+ {/if} +
+{:else if recent.length > 0}

Zuletzt hinzugefügt