fix: breadcrumbs and marquee not observing clones

This commit is contained in:
Oleksandr 2026-03-16 10:59:00 +02:00
parent 0727eccb71
commit 2e505f7606
Signed by: Xanazf
GPG key ID: 821EEC32761AC17C
4 changed files with 23 additions and 19 deletions

View file

@ -1 +1 @@
nodeLinker: pnp nodeLinker: node-modules

View file

@ -11,6 +11,7 @@ import { markdownConfig } from "./src/config/io/markdown.ts";
export default defineConfig({ export default defineConfig({
markdown: markdownConfig, markdown: markdownConfig,
site: "https://quickshell.org", site: "https://quickshell.org",
base: "/",
integrations: [ integrations: [
solidJs({ solidJs({
devtools: false, devtools: false,

View file

@ -192,13 +192,16 @@ document.addEventListener("DOMContentLoaded", () => {
}); });
}, observerOptions); }, observerOptions);
videos.forEach(v => { const startObserving = () => {
videoObserver.observe(v); const allVideos = scroller.querySelectorAll("video");
v.addEventListener("ended", () => { allVideos.forEach(v => {
targetScrollX += itemWidth; videoObserver.observe(v);
startAnimation(); v.addEventListener("ended", () => {
targetScrollX += itemWidth;
startAnimation();
});
}); });
}); };
// events // events
btnLeft?.addEventListener("click", () => { btnLeft?.addEventListener("click", () => {
@ -211,15 +214,15 @@ document.addEventListener("DOMContentLoaded", () => {
startAnimation(); startAnimation();
}); });
container.addEventListener( // container.addEventListener(
"wheel", // "wheel",
e => { // e => {
e.preventDefault(); // e.preventDefault();
targetScrollX += e.deltaY; // targetScrollX += e.deltaY;
startAnimation(); // startAnimation();
}, // },
{ passive: false } // { passive: false }
); // );
container.addEventListener("touchstart", e => { container.addEventListener("touchstart", e => {
isDown = true; isDown = true;
@ -260,6 +263,7 @@ document.addEventListener("DOMContentLoaded", () => {
// init // init
setupClones(); setupClones();
startObserving();
setTimeout(() => { setTimeout(() => {
updateDimensions(); updateDimensions();
container.classList.add("initialized"); container.classList.add("initialized");

View file

@ -21,8 +21,9 @@ let url = Astro.url.pathname.split("/").filter((s: string) => s !== "");
const breadcrumbs = [ const breadcrumbs = [
{ {
text: "custom", text: "Home",
href: "/", href: "/",
slot: "index",
}, },
]; ];
@ -69,7 +70,6 @@ for (const segment of url) {
data-pagefind-ignore data-pagefind-ignore
> >
<svg <svg
<!-- @ts-expect-error -->
slot="index" slot="index"
xmlns="http://www.w3.org/2000/svg" xmlns="http://www.w3.org/2000/svg"
width="1em" width="1em"
@ -83,7 +83,6 @@ for (const segment of url) {
></path> ></path>
</svg> </svg>
<svg <svg
<!-- @ts-expect-error -->
slot="separator" slot="separator"
xmlns="http://www.w3.org/2000/svg" xmlns="http://www.w3.org/2000/svg"
width="1em" width="1em"