From 2bec4a2d2608d355fed4871ea0e102b5e05a13a1 Mon Sep 17 00:00:00 2001 From: Hera Zhao Date: Tue, 7 Apr 2026 10:34:01 +0000 Subject: [PATCH] Revert recipe detail to modal overlay with tab switching MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Restore the original modal popup (卡片预览/编辑 tabs) instead of the inline detail panel, and bring back category carousel, personal recipes, and favorites sections on the search page. Co-Authored-By: Claude Opus 4.6 (1M context) --- .../src/components/RecipeDetailOverlay.vue | 935 ++++++++++-------- frontend/src/views/RecipeSearch.vue | 465 ++++++--- 2 files changed, 859 insertions(+), 541 deletions(-) diff --git a/frontend/src/components/RecipeDetailOverlay.vue b/frontend/src/components/RecipeDetailOverlay.vue index 9437b7c..20a4d26 100644 --- a/frontend/src/components/RecipeDetailOverlay.vue +++ b/frontend/src/components/RecipeDetailOverlay.vue @@ -1,94 +1,155 @@ @@ -96,9 +157,10 @@ diff --git a/frontend/src/views/RecipeSearch.vue b/frontend/src/views/RecipeSearch.vue index d4ede12..a56620c 100644 --- a/frontend/src/views/RecipeSearch.vue +++ b/frontend/src/views/RecipeSearch.vue @@ -1,43 +1,121 @@ @@ -117,101 +231,228 @@ function clearSearch() { padding: 0 12px 24px; } -.search-box { - background: white; - border-radius: 16px; - padding: 20px 24px; - box-shadow: 0 4px 20px rgba(90, 60, 30, 0.08); - margin-bottom: 20px; +.cat-wrap { + position: relative; + margin: 0 -12px 20px; + overflow: hidden; } -.search-label { - font-size: 13px; - font-weight: 500; - color: #9a8570; - margin-bottom: 10px; -} - -.search-row { +.cat-track { display: flex; - gap: 10px; + transition: transform 0.4s ease; + will-change: transform; +} + +.cat-card { + flex: 0 0 100%; + min-height: 200px; + position: relative; + overflow: hidden; + cursor: pointer; + background-size: cover; + background-position: center; +} + +.cat-card::after { + content: ''; + position: absolute; + inset: 0; + background: linear-gradient(135deg, rgba(0,0,0,0.45), rgba(0,0,0,0.25)); +} + +.cat-inner { + position: relative; + z-index: 1; + height: 100%; + display: flex; + flex-direction: column; + justify-content: center; align-items: center; - flex-wrap: wrap; + padding: 36px 24px; + color: white; + text-align: center; +} + +.cat-icon { + font-size: 48px; + margin-bottom: 10px; + filter: drop-shadow(0 2px 6px rgba(0,0,0,0.3)); +} + +.cat-name { + font-family: 'Noto Serif SC', serif; + font-size: 24px; + font-weight: 700; + letter-spacing: 3px; + text-shadow: 0 2px 8px rgba(0,0,0,0.5); +} + +.cat-sub { + font-size: 13px; + margin-top: 6px; + opacity: 0.9; + letter-spacing: 1px; +} + +.cat-arrow { + position: absolute; + top: 50%; + transform: translateY(-50%); + z-index: 2; + width: 36px; + height: 36px; + border-radius: 50%; + background: rgba(255,255,255,0.25); + border: none; + color: white; + font-size: 18px; + cursor: pointer; + backdrop-filter: blur(4px); + display: flex; + align-items: center; + justify-content: center; + transition: background 0.2s; +} +.cat-arrow:hover { background: rgba(255,255,255,0.45); } +.cat-arrow.left { left: 12px; } +.cat-arrow.right { right: 12px; } + +.cat-dots { + display: flex; + justify-content: center; + gap: 8px; + margin-bottom: 14px; +} +.cat-dot { + width: 8px; + height: 8px; + border-radius: 50%; + background: var(--border, #e0d4c0); + cursor: pointer; + transition: all 0.25s; +} +.cat-dot.active { + background: var(--sage, #7a9e7e); + width: 22px; + border-radius: 4px; +} + +.cat-filter-bar { + display: flex; + align-items: center; + justify-content: space-between; + background: var(--sage-mist, #eef4ee); + border-radius: 10px; + padding: 10px 16px; + margin-bottom: 16px; + font-size: 14px; + font-weight: 600; + color: var(--sage-dark, #5a7d5e); +} + +.cat-label { + font-size: 12px; +} + +.search-box { + display: flex; + align-items: center; + gap: 8px; + margin-bottom: 16px; + background: #f8f7f5; + border-radius: 12px; + padding: 4px 8px; + border: 1.5px solid #e5e4e7; } .search-input { flex: 1; - min-width: 200px; - padding: 11px 16px; - border: 1.5px solid #e0d4c0; - border-radius: 10px; - font-size: 15px; - font-family: inherit; + border: none; + background: transparent; + padding: 10px 8px; + font-size: 14px; outline: none; - color: #2c2416; - background: white; - transition: border-color 0.2s; -} - -.search-input:focus { - border-color: #7a9e7e; + font-family: inherit; + color: #3e3a44; } .search-input::placeholder { - color: #c4a882; + color: #b0aab5; +} + +.search-btn, +.search-clear-btn { + border: none; + background: transparent; + cursor: pointer; + font-size: 16px; + padding: 6px 8px; + border-radius: 8px; + color: #6b6375; +} + +.search-clear-btn:hover, +.search-btn:hover { + background: #eae8e5; +} + +.personal-section { + margin-bottom: 20px; +} + +.section-header { + display: flex; + align-items: center; + justify-content: space-between; + padding: 10px 12px; + background: #f8f7f5; + border-radius: 10px; + cursor: pointer; + margin-bottom: 10px; + font-size: 14px; + font-weight: 600; + color: #3e3a44; +} + +.section-header:hover { + background: #f0eeeb; +} + +.toggle-icon { + font-size: 12px; + color: #999; +} + +.section-label { + font-size: 14px; + font-weight: 600; + color: #3e3a44; + padding: 8px 4px; + margin-bottom: 8px; +} + +.search-results-section { + margin-bottom: 20px; } .recipe-grid { display: grid; - grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); - gap: 16px; - margin-bottom: 24px; + grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); + gap: 12px; + margin-bottom: 16px; } .empty-hint { grid-column: 1 / -1; text-align: center; - color: #9a8570; - font-size: 14px; - padding: 40px 0; -} - -/* Buttons */ -.btn { - padding: 11px 22px; - border-radius: 10px; - font-size: 14px; - font-family: inherit; - cursor: pointer; - border: none; - transition: all 0.2s; - font-weight: 500; - white-space: nowrap; -} - -.btn-outline { - background: transparent; - border: 1.5px solid #7a9e7e; - color: #5a7d5e; -} - -.btn-outline:hover { - background: #eef4ee; -} - -.btn-outline.active { - background: #eef4ee; - border-color: #5a7d5e; - font-weight: 600; + color: #b0aab5; + font-size: 13px; + padding: 24px 0; } @media (max-width: 600px) { .recipe-grid { grid-template-columns: 1fr; } - - .search-box { - padding: 14px 16px; - } }