diff --git a/src/components/navigation/Search.astro b/src/components/navigation/Search.astro index c5bdb45..8c04fdd 100644 --- a/src/components/navigation/Search.astro +++ b/src/components/navigation/Search.astro @@ -133,10 +133,7 @@ import magnifierIcon from "@icons/magnifier.svg?raw"; //@ts-expect-error "@pagefind/default-ui" ); - const versionMatch = window.location.pathname.match(/^\/docs\/([^/]+)/); - const activeVersion = versionMatch?.[1]; - - const search = new PagefindUI({ + new PagefindUI({ element: "#qs_search", // resetStyles: false, sort: { version: "desc" }, @@ -173,10 +170,6 @@ import magnifierIcon from "@icons/magnifier.svg?raw"; }); }, }); - - if (activeVersion) { - search.triggerFilters({ version: activeVersion }); - } }); }); } diff --git a/src/config/styling/marquee.ts b/src/config/styling/marquee.ts index 61d5df6..39ab972 100644 --- a/src/config/styling/marquee.ts +++ b/src/config/styling/marquee.ts @@ -176,13 +176,12 @@ document.addEventListener("DOMContentLoaded", () => { // video handling const videos = scroller.querySelectorAll("video"); - - const playObserverOptions = { + const observerOptions = { root: container, threshold: 0.5, }; - const playObserver = new IntersectionObserver(entries => { + const videoObserver = new IntersectionObserver(entries => { entries.forEach(entry => { const video = entry.target as HTMLVideoElement; if (entry.isIntersecting) { @@ -191,28 +190,12 @@ document.addEventListener("DOMContentLoaded", () => { video.pause(); } }); - }, playObserverOptions); - - const resetObserverOptions = { - root: container, - threshold: 0.01, - }; - - const resetObserver = new IntersectionObserver(entries => { - entries.forEach(entry => { - const video = entry.target as HTMLVideoElement; - if (!entry.isIntersecting) { - video.currentTime = 0; - video.pause(); - } - }); - }, resetObserverOptions); + }, observerOptions); const startObserving = () => { const allVideos = scroller.querySelectorAll("video"); allVideos.forEach(v => { - playObserver.observe(v); - resetObserver.observe(v); + videoObserver.observe(v); v.addEventListener("ended", () => { targetScrollX += itemWidth; startAnimation(); diff --git a/src/pages/docs/[version]/types/[module]/[type].astro b/src/pages/docs/[version]/types/[module]/[type].astro index 741d33f..fee5249 100644 --- a/src/pages/docs/[version]/types/[module]/[type].astro +++ b/src/pages/docs/[version]/types/[module]/[type].astro @@ -43,14 +43,8 @@ const details = type.details ? await processMarkdown(version.name, type.details) : null; - -const description = type.description - ? await processMarkdown(version.name, type.description) - : null; - const searchWeight = version.name != "master" ? getSearchWeight(version.name) : 999.0; - --- import {module.name}
- {details ? : } + {details ? : ({type.description})} {Object.keys(type.properties ?? {}).length != 0 && (

Properties [?]

diff --git a/src/pages/docs/[version]/types/[module]/index.astro b/src/pages/docs/[version]/types/[module]/index.astro index 374019a..3b7efe4 100644 --- a/src/pages/docs/[version]/types/[module]/index.astro +++ b/src/pages/docs/[version]/types/[module]/index.astro @@ -2,6 +2,7 @@ import DocsLayout from "@layouts/DocsLayout.astro"; import { getVersionsData } from "@config/io/generateTypeData"; import { processMarkdown } from "@src/config/io/markdown"; +import type { TypeData } from "@_types"; export async function getStaticPaths() { return (await getVersionsData()).versions.flatMap(version => { @@ -16,11 +17,6 @@ const { version, module } = Astro.props; const details = module.details ? await processMarkdown(version.name, module.details) : null; - -const types = await Promise.all(module.types.map(async type => ({ - description2: type.description ? await processMarkdown(version.name, type.description) : null, - ...type -}))); --- ({
{module.description}
- {types.map(type => + {module.types.map((type: TypeData) => (
{type.name} - {type.description2 && } + {type.description}
) )} diff --git a/src/styles/docs/docs-types.css b/src/styles/docs/docs-types.css index 451ab1b..d547b05 100644 --- a/src/styles/docs/docs-types.css +++ b/src/styles/docs/docs-types.css @@ -363,9 +363,6 @@ html:has(input#theme-manual-toggle:checked) .typevariants { & .root-nav-desc { padding-left: 1rem; border-left: 1px solid hsl(var(--blue) 10% 15% / 0.6); - - /* for processMarkdown in desc strs*/ - & > p { margin: 0 } } } }