diff --git a/src/App.tsx b/src/App.tsx index 317835b..5f41836 100644 --- a/src/App.tsx +++ b/src/App.tsx @@ -11,6 +11,7 @@ import './app.sass'; import { Icon } from '@iconify-icon/solid'; import { clamp, sizeFmt } from './utils'; +import InfiniteScroll from 'solid-infinite-scroll'; interface File { name: string @@ -52,10 +53,14 @@ function getHref(f: File) export default function App() { let bcMax: number const [api] = createResource(fetchApi) - const [bcLeft, setBcLeft] = createSignal(0) const paths = [window.location.host, ...filePath.split("/").filter(it => it)] + // Infinite Scroll + const [scrollIndex, setScrollIndex] = createSignal(50) + const scrollNext = () => setScrollIndex(Math.min(scrollIndex() + 20, api().length)) + // Handle wheel for breadcrumb + const [bcLeft, setBcLeft] = createSignal(0) function wheel(e: WheelEvent) { e.preventDefault() @@ -104,7 +109,7 @@ export default function App() {