Page MenuHomeSealhub

horizontal-scroller-demo.page.tsx
No OneTemporary

Authored By
Unknown
Size
1 KB
Referenced Files
None
Subscribers
None

horizontal-scroller-demo.page.tsx

import type { Context } from "koa";
import { TempstreamJSX } from "tempstream";
import { Page } from "@sealcode/sealgen";
import html from "../html.js";
import { horizontalScroller } from "./common/horizontal-scroller/horizontal-scroller.js";
export const actionName = "HorizontalScrollerDemo";
export default new (class HorizontalScrollerDemoPage extends Page {
// eslint-disable-next-line @typescript-eslint/no-unused-vars
async canAccess(_: Context) {
return { canAccess: true, message: "" };
}
async render(ctx: Context) {
return html(
ctx,
"HorizontalScrollerDemo",
<div>
{horizontalScroller({
elements: [1, 2, 3, 4, 5, 6, 7, 9, 10, 11, 12, 13].map((n) => (
<div class="bignum">{n}</div>
)),
render: async ({ scroller, markers }) => (
<div>
<div>
<button
class="prev-button"
type="button"
data-action="horizontal-scroller#scrollLeft"
>
{" "}
←{" "}
</button>
<button
class="next-button"
type="button"
data-action="horizontal-scroller#scrollRight"
>
{" "}
→{" "}
</button>
</div>
{scroller}
{markers}
</div>
),
})}
</div>
);
}
})();

File Metadata

Mime Type
application/javascript
Expires
Sat, Nov 28, 02:07 (2 h, 16 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
1223245
Default Alt Text
horizontal-scroller-demo.page.tsx (1 KB)

Event Timeline