diff --git a/src/App.tsx b/src/App.tsx index ef58566..5787089 100644 --- a/src/App.tsx +++ b/src/App.tsx @@ -1,7 +1,7 @@ import urlJoin from 'url-join'; import mime from 'mime'; import moment from 'moment'; -import { createResource, For, Show } from 'solid-js'; +import { createResource, createSignal, For, Show } from 'solid-js'; import tippy from 'tippy.js'; import 'tippy.js/dist/tippy.css'; @@ -47,9 +47,24 @@ function getParent(level: number) } export default function App() { + let bcWheel: HTMLDivElement const [api] = createResource(fetchApi) + const [bcLeft, setBcLeft] = createSignal(0) const paths = [window.location.host, ...path.split("/").filter(it => it)] + function wheel(e: WheelEvent) + { + let direction = (e.detail < 0 || e.deltaY > 0) ? 1 : -1 + let dx = direction * 15 + + const rect = bcWheel.getBoundingClientRect() + const prect = bcWheel.parentElement.getBoundingClientRect() + const max = Math.round(rect.width - prect.width) + + setBcLeft(Math.min(Math.max(bcLeft() + dx, 0), max)) + console.log(e) + } + return ( // Full screen container
@@ -60,15 +75,21 @@ export default function App() {

File Listing

{/* Breadcrumbs */} -