mirror of
https://github.com/heygen-com/hyperframes.git
synced 2026-11-18 07:50:13 +00:00
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
This commit is contained in:
@@ -79,6 +79,24 @@
|
||||
@media(prefers-reduced-motion:reduce){.hfc-gallery .mw .sq path{stroke-dashoffset:0;}}
|
||||
@media(max-width:600px){.hfc-gallery{padding:0 18px;}.hfc-gallery .hfc-hero{padding:28px 0;}}
|
||||
|
||||
/* The catalog's own search: filters the cards below as you type. */
|
||||
.hfc-search {
|
||||
display: block;
|
||||
width: min(560px, 100%);
|
||||
margin-top: 18px;
|
||||
padding: 12px 16px;
|
||||
border: 1px solid color-mix(in srgb, currentColor 18%, transparent);
|
||||
border-radius: 999px;
|
||||
background: color-mix(in srgb, currentColor 4%, transparent);
|
||||
color: inherit;
|
||||
font: inherit;
|
||||
font-size: 15px;
|
||||
}
|
||||
.hfc-search:focus-visible {
|
||||
outline: 2px solid color-mix(in srgb, currentColor 40%, transparent);
|
||||
outline-offset: 2px;
|
||||
}
|
||||
|
||||
/* Pause previews: the visitor's stop for the looping cards. */
|
||||
.hfc-gallery .hfc-pause {
|
||||
margin-top: 14px;
|
||||
|
||||
@@ -251,6 +251,9 @@ export const CatalogGallery = ({ catalog, initialGroup = "", initialSection = ""
|
||||
React.createElement(MotionWord, null),
|
||||
" ready to install."),
|
||||
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."),
|
||||
// The filter already reads ?q=; this is the place to type it. Every keystroke filters in memory, and the
|
||||
// URL keeps the words so a search can be shared.
|
||||
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" }),
|
||||
!still && React.createElement("button", { type: "button", className: "hfc-pause", "aria-pressed": paused, onClick: togglePaused }, paused ? "Play previews" : "Pause previews")),
|
||||
React.createElement("section", { className: "hfc-browser", "aria-label": "Browse catalog", ref: resultsRef }, searching ? React.createElement(React.Fragment, null,
|
||||
matches.length ? React.createElement("div", { className: "hfc-grid" }, matches.slice(0, limit).map((item) => card(item))) : React.createElement("div", { className: "hfc-empty" },
|
||||
|
||||
Reference in New Issue
Block a user