Move recipe filter tabs from nav into page content
Build and Deploy / build-and-deploy (push) Failing after 1m33s
Build and Deploy / build-and-deploy (push) Failing after 1m33s
- A-Z, By Tag, By Course now render as .roux-filter-tabs above the search box, not in the navigation header - Index page nav matches all other pages: Home | Recipes | Import | Cook History - JS active-tab tracking targets filter links instead of nav links
This commit is contained in:
+13
-4
@@ -163,6 +163,12 @@ page title content =
|
|||||||
, ".roux-header-links a:hover { color: var(--roux-accent); }"
|
, ".roux-header-links a:hover { color: var(--roux-accent); }"
|
||||||
, ".roux-header-links a.active { color: var(--roux-accent); }"
|
, ".roux-header-links a.active { color: var(--roux-accent); }"
|
||||||
, ""
|
, ""
|
||||||
|
, "/* Recipe filter tabs */"
|
||||||
|
, ".roux-filter-tabs { display: flex; gap: 20px; margin-bottom: 1.25rem; font-size: 11px; letter-spacing: 0.12em; text-transform: uppercase; }"
|
||||||
|
, ".roux-filter-tabs a { color: #6B5847; text-decoration: none; }"
|
||||||
|
, ".roux-filter-tabs a:hover { color: var(--roux-accent); }"
|
||||||
|
, ".roux-filter-tabs a.active { color: var(--roux-accent); }"
|
||||||
|
, ""
|
||||||
, "/* Search input */"
|
, "/* Search input */"
|
||||||
, "input[type=search] { background: var(--roux-bg); color: var(--roux-text); border-color: rgba(61, 44, 30, 0.2); }"
|
, "input[type=search] { background: var(--roux-bg); color: var(--roux-text); border-color: rgba(61, 44, 30, 0.2); }"
|
||||||
, "input[type=search]:focus { border-color: var(--roux-accent); box-shadow: 0 0 0 1px var(--roux-accent); }"
|
, "input[type=search]:focus { border-color: var(--roux-accent); box-shadow: 0 0 0 1px var(--roux-accent); }"
|
||||||
@@ -422,7 +428,7 @@ searchJs =
|
|||||||
, "// Set active tab style based on hash"
|
, "// Set active tab style based on hash"
|
||||||
, "function updateActiveNav() {"
|
, "function updateActiveNav() {"
|
||||||
, " const mode = getSortMode();"
|
, " const mode = getSortMode();"
|
||||||
, " document.querySelectorAll('.roux-header-links a').forEach(a => {"
|
, " document.querySelectorAll('.roux-filter-tabs a').forEach(a => {"
|
||||||
, " a.classList.toggle('active', a.getAttribute('href') === '#' + mode);"
|
, " a.classList.toggle('active', a.getAttribute('href') === '#' + mode);"
|
||||||
, " });"
|
, " });"
|
||||||
, "}"
|
, "}"
|
||||||
@@ -757,12 +763,15 @@ indexPage _mode recipes =
|
|||||||
page "Roux — Recipes" $ do
|
page "Roux — Recipes" $ do
|
||||||
renderHeader
|
renderHeader
|
||||||
[ ("/", "Home", False)
|
[ ("/", "Home", False)
|
||||||
, ("#alpha", "A-Z", True)
|
, ("/recipes", "Recipes", True)
|
||||||
, ("#tags", "By Tag", False)
|
|
||||||
, ("#course", "By Course", False)
|
|
||||||
, ("/import", "Import", False)
|
, ("/import", "Import", False)
|
||||||
, ("/cook-history", "Cook History", False)
|
, ("/cook-history", "Cook History", False)
|
||||||
]
|
]
|
||||||
|
-- Filter tabs
|
||||||
|
H.div ! A.class_ "roux-filter-tabs" $ do
|
||||||
|
H.a ! A.href "#alpha" $ "A-Z"
|
||||||
|
H.a ! A.href "#tags" $ "By Tag"
|
||||||
|
H.a ! A.href "#course" $ "By Course"
|
||||||
-- Search input
|
-- Search input
|
||||||
H.input
|
H.input
|
||||||
! A.type_ "search"
|
! A.type_ "search"
|
||||||
|
|||||||
Reference in New Issue
Block a user