Skip to content

Visualize Your Ideas With Code

feat(ui): add goto start and goto end buttons (#814)

Naveen K R449f1946474a
diff --git a/packages/ui/src/components/icons/FastForward.tsx b/packages/ui/src/components/icons/FastForward.tsx
new file mode 100644
index 00000000..6c847725
--- /dev/null
+++ b/packages/ui/src/components/icons/FastForward.tsx
@@ -0,0 +1,7 @@
+export function FastForward() {
+ return (
+ <svg viewBox="0 0 24 24" fill="currentColor">
+ <path d="M4 18l8.5-6L4 6v12zm9-12v12l8.5-6L13 6z" />
+ </svg>
+ );
+}
diff --git a/packages/ui/src/components/icons/FastRewind.tsx b/packages/ui/src/components/icons/FastRewind.tsx
new file mode 100644
index 00000000..0f4273ce
--- /dev/null
+++ b/packages/ui/src/components/icons/FastRewind.tsx
@@ -0,0 +1,7 @@
+export function FastRewind() {
+ return (
+ <svg viewBox="0 0 24 24" fill="currentColor">
+ <path d="M11 18V6l-8.5 6 8.5 6zm.5-6l8.5 6V6l-8.5 6z" />
+ </svg>
+ );
+}
diff --git a/packages/ui/src/components/icons/index.ts b/packages/ui/src/components/icons/index.ts
index 68662986..6ec97bb2 100644
--- a/packages/ui/src/components/icons/index.ts
+++ b/packages/ui/src/components/icons/index.ts
@@ -21,6 +21,8 @@ export * from './Schedule';
export * from './Settings';
export * from './SkipNext';
export * from './SkipPrevious';
+export * from './FastForward';
+export * from './FastRewind';
export * from './Tune';
export * from './UnfoldMore';
export * from './Videocam';
diff --git a/packages/ui/src/components/playback/PlaybackControls.tsx b/packages/ui/src/components/playback/PlaybackControls.tsx
index 1252ff44..54576817 100644
--- a/packages/ui/src/components/playback/PlaybackControls.tsx
+++ b/packages/ui/src/components/playback/PlaybackControls.tsx
@@ -12,6 +12,8 @@ import {
Repeat,
SkipNext,
SkipPrevious,
+ FastForward,
+ FastRewind,
VolumeOff,
VolumeOn,
} from '../icons';
@@ -84,11 +86,17 @@ export function PlaybackControls() {
>
{state.muted ? <VolumeOff /> : <VolumeOn />}
</IconCheckbox>
+ <IconButton
+ title="Start [Shift + Left arrow]"
+ onClick={() => player.requestReset()}
+ >
+ <SkipPrevious />
+ </IconButton>
<IconButton
title="Previous frame [Left arrow]"
onClick={() => player.requestPreviousFrame()}
>
- <SkipPrevious />
+ <FastRewind />
</IconButton>
<IconCheckbox
main
@@ -102,6 +110,12 @@ export function PlaybackControls() {
<IconButton
title="Next frame [Right arrow]"
onClick={() => player.requestNextFrame()}
+ >
+ <FastForward />
+ </IconButton>
+ <IconButton
+ title="End [Shift + Right arrow]"
+ onClick={() => player.requestSeek(Infinity)}
>
<SkipNext />
</IconButton>