Skip to content

Commit b2b034f

Browse files
authored
docs(catalog): a search box over the cards; it fills the ?q= filter the gallery already reads (#7147)
* docs(catalog): every card on screen plays a small looping video instead of a live player * docs(catalog): the preview generator also writes each card's small loop and poster * docs(catalog): a search box over the cards; it fills the ?q= filter the gallery already reads * fix(catalog): end ffprobe options before the card file, as the argv contract requires * fix(catalog): a pause control for the card loops; none play in a hidden tab or under 25% visible
1 parent 054cf4f commit b2b034f

2 files changed

Lines changed: 21 additions & 0 deletions

File tree

‎docs/catalog-gallery.css‎

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -79,6 +79,24 @@
7979
@media(prefers-reduced-motion:reduce){.hfc-gallery .mw .sq path{stroke-dashoffset:0;}}
8080
@media(max-width:600px){.hfc-gallery{padding:0 18px;}.hfc-gallery .hfc-hero{padding:28px 0;}}
8181

82+
/* The catalog's own search: filters the cards below as you type. */
83+
.hfc-search {
84+
display: block;
85+
width: min(560px, 100%);
86+
margin-top: 18px;
87+
padding: 12px 16px;
88+
border: 1px solid color-mix(in srgb, currentColor 18%, transparent);
89+
border-radius: 999px;
90+
background: color-mix(in srgb, currentColor 4%, transparent);
91+
color: inherit;
92+
font: inherit;
93+
font-size: 15px;
94+
}
95+
.hfc-search:focus-visible {
96+
outline: 2px solid color-mix(in srgb, currentColor 40%, transparent);
97+
outline-offset: 2px;
98+
}
99+
82100
/* Pause previews: the visitor's stop for the looping cards. */
83101
.hfc-gallery .hfc-pause {
84102
margin-top: 14px;

‎docs/snippets/catalog-gallery.jsx‎

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -251,6 +251,9 @@ export const CatalogGallery = ({ catalog, initialGroup = "", initialSection = ""
251251
React.createElement(MotionWord, null),
252252
" ready to install."),
253253
React.createElement("p", null, initialGroup ? `${matches.length} items. Preview a piece and open it to explore its controls, code, and installation.` : "Find the scene, caption, or finishing touch for your next video. Preview the motion, pick a favorite, and make it your own."),
254+
// The filter already reads ?q=; this is the place to type it. Every keystroke filters in memory, and the
255+
// URL keeps the words so a search can be shared.
256+
React.createElement("input", { className: "hfc-search", type: "search", value: filters.q, onChange: (event) => update({ q: event.target.value }), placeholder: `Search ${items.length || ""} items: captions, charts, 3D, transitions…`.replace(" ", " "), "aria-label": "Search the catalog" }),
254257
!still && React.createElement("button", { type: "button", className: "hfc-pause", "aria-pressed": paused, onClick: togglePaused }, paused ? "Play previews" : "Pause previews")),
255258
React.createElement("section", { className: "hfc-browser", "aria-label": "Browse catalog", ref: resultsRef }, searching ? React.createElement(React.Fragment, null,
256259
matches.length ? React.createElement("div", { className: "hfc-grid" }, matches.slice(0, limit).map((item) => card(item))) : React.createElement("div", { className: "hfc-empty" },

0 commit comments

Comments
 (0)