Skip to content

Commit 4d7fa85

Browse files
committed
feat(demo): enable native player controls on hover
Flip the asciinema-player from controls:false to controls:"auto" so visitors can pause/seek the hero scan demo via the native control bar. The bar reveals on hover and auto-hides otherwise, keeping the hero clean; autoPlay/loop are unchanged. The bar is transparent with icons inheriting --term-color-foreground, so it adapts to both cast themes with no extra CSS.
1 parent 52aa1a1 commit 4d7fa85

2 files changed

Lines changed: 7 additions & 1 deletion

File tree

src/components/DemoSection.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,7 @@ export function DemoSection() {
5353
autoPlay: true,
5454
loop: true,
5555
preload: true,
56-
controls: false,
56+
controls: "auto",
5757
poster: "npt:0:0.1",
5858
theme: demoTheme,
5959
terminalFontFamily: "'JetBrains Mono', monospace",

src/components/__tests__/DemoSection.test.tsx

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -68,6 +68,12 @@ describe("DemoSection", () => {
6868
expect(lastCreateOptions().theme).toBe("opentaint-dark");
6969
});
7070

71+
it("enables the native control bar in hover-reveal mode", async () => {
72+
render(<DemoSection />);
73+
await flushAsync();
74+
expect(lastCreateOptions().controls).toBe("auto");
75+
});
76+
7177
it("uses the light cast theme on a dark page", async () => {
7278
document.documentElement.classList.add("dark");
7379
render(<DemoSection />);

0 commit comments

Comments
 (0)