Skip to content

Visualize Your Ideas With Code

refactor(ui): switch icons to svg (#132)

Jacob62f3118739d5
diff --git a/packages/ui/src/components/console/Console.tsx b/packages/ui/src/components/console/Console.tsx
index 855bd56f..d80d27b6 100644
--- a/packages/ui/src/components/console/Console.tsx
+++ b/packages/ui/src/components/console/Console.tsx
@@ -5,9 +5,10 @@ import {capitalize} from '@motion-canvas/core/lib/utils';
import {Pane} from '../tabs';
import {useLogs} from '../../contexts';
import {useState} from 'preact/hooks';
-import {IconButton, IconType, Pill} from '../controls';
+import {IconButton, Pill} from '../controls';
import {Log} from './Log';
import clsx from 'clsx';
+import {Clear} from '../icons';
const LOG_LEVELS: Record<string, boolean> = {
[LogLevel.Error]: true,
@@ -42,11 +43,9 @@ export function Console() {
})}
</div>
{logs.length > 0 && (
- <IconButton
- icon={IconType.clear}
- onClick={clear}
- title={'Clear console'}
- />
+ <IconButton onClick={clear} title={'Clear console'}>
+ <Clear />
+ </IconButton>
)}
</div>
<div
diff --git a/packages/ui/src/components/console/Log.tsx b/packages/ui/src/components/console/Log.tsx
index 27443ca8..9317ffad 100644
--- a/packages/ui/src/components/console/Log.tsx
+++ b/packages/ui/src/components/console/Log.tsx
@@ -5,10 +5,11 @@ import {useEffect, useMemo, useState} from 'preact/hooks';
import {resolveStackTrace, StackTraceEntry} from '../../utils';
import {useInspection} from '../../contexts';
import {useFormattedNumber} from '../../hooks';
-import {IconButton, IconType, Toggle} from '../controls';
+import {IconButton, Toggle} from '../controls';
import {StackTrace} from './StackTrace';
import {SourceCodeFrame} from './SourceCodeFrame';
import clsx from 'clsx';
+import {Locate} from '../icons';
export interface LogProps {
payload: LogPayload;
@@ -53,9 +54,10 @@ export function Log({payload}: LogProps) {
{payload.inspect && (
<IconButton
title="Select related node"
- icon={IconType.locate}
onClick={() => setInspectedElement(payload.inspect)}
- />
+ >
+ <Locate />
+ </IconButton>
)}
</div>
{hasBody && open && (
diff --git a/packages/ui/src/components/controls/Controls.module.scss b/packages/ui/src/components/controls/Controls.module.scss
index 25919507..1691235c 100644
--- a/packages/ui/src/components/controls/Controls.module.scss
+++ b/packages/ui/src/components/controls/Controls.module.scss
@@ -1,20 +1,16 @@
-.icon {
- &:after {
- width: 24px;
- height: 24px;
- display: block;
- content: '';
- background: var(--icon-color);
- }
-}
-
.iconCheckbox {
width: 24px;
height: 24px;
+ position: relative;
}
.iconInput {
- display: none;
+ position: absolute;
+ top: 0;
+ right: 0;
+ bottom: 0;
+ left: 0;
+ appearance: none;
}
.iconLabel {
@@ -22,25 +18,21 @@
height: 24px;
display: block;
cursor: pointer;
+ color: rgba(255, 255, 255, 0.54);
- &::after {
- background-color: rgba(255, 255, 255, 0.54);
- }
-
- &.main::after {
- background-color: var(--icon-color);
+ &.main {
+ color: #fff;
}
- .iconInput + &:hover::after {
- background-color: var(--icon-color);
+ .iconInput + &:hover {
+ color: #fff;
}
.iconInput:checked + & {
- &:after {
- background: var(--theme);
- }
- &.main:after {
- background: var(--icon-color);
+ color: var(--theme);
+
+ &.main {
+ color: #fff;
}
}
}
@@ -55,13 +47,10 @@
background: transparent;
padding: 0;
margin: 0;
+ color: rgba(255, 255, 255, 0.54);
- &::after {
- background-color: rgba(255, 255, 255, 0.54);
- }
-
- &:hover::after {
- background-color: var(--icon-color);
+ &:hover {
+ color: #fff;
}
}
@@ -168,22 +157,17 @@
width: 24px;
height: 24px;
cursor: pointer;
+ color: rgba(255, 255, 255, 0.6);
&:hover {
background-color: var(--surface-color-hover);
}
- &:after {
- width: 24px;
- height: 24px;
- display: block;
- content: '';
- -webkit-mask-image: url('../../img/icons/chevron_right.svg');
- background-color: rgba(255, 255, 255, 0.6);
+ svg {
transition: rotate 0.2s;
}
- &.open:after {
+ &.open svg {
rotate: 90deg;
}
}
@@ -211,61 +195,3 @@
}
}
}
-
-.motionCanvas:after {
- -webkit-mask-image: url('../../img/icons/motion_canvas.svg');
-}
-.pause:after {
- -webkit-mask-image: url('../../img/icons/pause.svg');
-}
-.photoCamera:after {
- -webkit-mask-image: url('../../img/icons/photo_camera.svg');
-}
-.play:after {
- -webkit-mask-image: url('../../img/icons/play_arrow.svg');
-}
-.repeat:after {
- -webkit-mask-image: url('../../img/icons/repeat.svg');
-}
-.skipNext:after {
- -webkit-mask-image: url('../../img/icons/skip_next.svg');
-}
-.skipPrevious:after {
- -webkit-mask-image: url('../../img/icons/skip_previous.svg');
-}
-.volumeOn:after {
- -webkit-mask-image: url('../../img/icons/volume_on.svg');
-}
-.volumeOff:after {
- -webkit-mask-image: url('../../img/icons/volume_off.svg');
-}
-.schedule:after {
- -webkit-mask-image: url('../../img/icons/schedule.svg');
-}
-.tune:after {
- -webkit-mask-image: url('../../img/icons/tune.svg');
-}
-.videoSettings:after {
- -webkit-mask-image: url('../../img/icons/video_settings.svg');
-}
-.dragIndicator:after {
- -webkit-mask-image: url('../../img/icons/drag_indicator.svg');
-}
-.warning:after {
- -webkit-mask-image: url('../../img/icons/warning.svg');
-}
-.bug:after {
- -webkit-mask-image: url('../../img/icons/bug.svg');
-}
-.clear:after {
- -webkit-mask-image: url('../../img/icons/clear.svg');
-}
-.locate:after {
- -webkit-mask-image: url('../../img/icons/locate.svg');
-}
-.add:after {
- -webkit-mask-image: url('../../img/icons/add.svg');
-}
-.unfoldMore:after {
- -webkit-mask-image: url('../../img/icons/unfold_more.svg');
-}
diff --git a/packages/ui/src/components/controls/Icon.tsx b/packages/ui/src/components/controls/Icon.tsx
deleted file mode 100644
index d80c59ba..00000000
--- a/packages/ui/src/components/controls/Icon.tsx
+++ /dev/null
@@ -1,25 +0,0 @@
-import styles from './Controls.module.scss';
-
-import {IconType} from './IconType';
-import {JSX} from 'preact';
-import clsx from 'clsx';
-
-type IntrinsicTag = keyof JSX.IntrinsicElements;
-
-type IconProps<T extends IntrinsicTag> = JSX.IntrinsicElements[T] & {
- type: IconType;
- className?: string;
- as?: T;
-};
-
-export function Icon<T extends IntrinsicTag = 'div'>({
- type,
- className,
- as = 'div' as T,
- ...rest
-}: IconProps<T>) {
- const As = as as string;
- return (
- <As className={clsx(styles.icon, styles[type], className)} {...rest} />
- );
-}
diff --git a/packages/ui/src/components/controls/IconButton.tsx b/packages/ui/src/components/controls/IconButton.tsx
index 010032b3..9aaab1a8 100644
--- a/packages/ui/src/components/controls/IconButton.tsx
+++ b/packages/ui/src/components/controls/IconButton.tsx
@@ -1,21 +1,23 @@
import styles from './Controls.module.scss';
-import {IconType} from './IconType';
import clsx from 'clsx';
+import {ComponentChildren} from 'preact';
interface IconButtonProps {
- icon: IconType;
title?: string;
onClick?: () => void;
+ children: ComponentChildren;
}
-export function IconButton({icon, onClick, title}: IconButtonProps) {
+export function IconButton({children, onClick, title}: IconButtonProps) {
return (
<button
title={title}
- className={clsx(styles.iconButton, styles.icon, styles[icon])}
+ className={clsx(styles.iconButton)}
type="button"
onClick={onClick}
- />
+ >
+ {children}
+ </button>
);
}
diff --git a/packages/ui/src/components/controls/IconCheckbox.tsx b/packages/ui/src/components/controls/IconCheckbox.tsx
index 7c126753..76e8f7d0 100644
--- a/packages/ui/src/components/controls/IconCheckbox.tsx
+++ b/packages/ui/src/components/controls/IconCheckbox.tsx
@@ -1,11 +1,10 @@
import styles from './Controls.module.scss';
-import {IconType} from './IconType';
import clsx from 'clsx';
+import {ComponentChildren} from 'preact';
interface IconCheckboxProps {
- iconOn?: IconType;
- iconOff?: IconType;
+ children: ComponentChildren;
titleOn?: string;
titleOff?: string;
id: string;
@@ -15,8 +14,7 @@ interface IconCheckboxProps {
}
export function IconCheckbox({
- iconOn,
- iconOff,
+ children,
titleOn,
titleOff,
id,
@@ -26,26 +24,22 @@ export function IconCheckbox({
}: IconCheckboxProps) {
return (
<div className={styles.iconCheckbox}>
- <input
- className={styles.iconInput}
- type="checkbox"
- id={id}
- checked={checked}
- onChange={event => {
- onChange?.((event.target as HTMLInputElement).checked);
- }}
- />
<label
title={titleOff && !checked ? titleOff : titleOn}
- className={clsx(
- styles.icon,
- styles.iconLabel,
- main && styles.main,
- (checked || !iconOff) && styles[iconOn],
- iconOff && !checked && styles[iconOff],
- )}
+ className={clsx(styles.iconLabel, main && styles.main)}
htmlFor={id}
- />
+ >
+ <input
+ className={styles.iconInput}
+ type="checkbox"
+ id={id}
+ checked={checked}
+ onChange={event => {
+ onChange?.((event.target as HTMLInputElement).checked);
+ }}
+ />
+ {children}
+ </label>
</div>
);
}
diff --git a/packages/ui/src/components/controls/IconType.ts b/packages/ui/src/components/controls/IconType.ts
deleted file mode 100644
index c62b530a..00000000
--- a/packages/ui/src/components/controls/IconType.ts
+++ /dev/null
@@ -1,21 +0,0 @@
-export enum IconType {
- dragIndicator = 'dragIndicator',
- motionCanvas = 'motionCanvas',
- pause = 'pause',
- photoCamera = 'photoCamera',
- play = 'play',
- repeat = 'repeat',
- skipNext = 'skipNext',
- skipPrevious = 'skipPrevious',
- tune = 'tune',
- videoSettings = 'videoSettings',
- volumeOn = 'volumeOn',
- volumeOff = 'volumeOff',
- schedule = 'schedule',
- warning = 'warning',
- bug = 'bug',
- clear = 'clear',
- locate = 'locate',
- add = 'add',
- unfoldMore = 'unfoldMore',
-}
diff --git a/packages/ui/src/components/controls/Toggle.tsx b/packages/ui/src/components/controls/Toggle.tsx
index 719e1017..f9de085f 100644
--- a/packages/ui/src/components/controls/Toggle.tsx
+++ b/packages/ui/src/components/controls/Toggle.tsx
@@ -1,5 +1,6 @@
import styles from './Controls.module.scss';
import clsx from 'clsx';
+import {ChevronRight} from '../icons/ChevronRight';
export interface ToggleProps {
open?: boolean;
@@ -11,6 +12,8 @@ export function Toggle({open, onToggle}: ToggleProps) {
<div
className={clsx(styles.toggle, open && styles.open)}
onClick={() => onToggle(!open)}
- />
+ >
+ <ChevronRight />
+ </div>
);
}
diff --git a/packages/ui/src/components/controls/index.ts b/packages/ui/src/components/controls/index.ts
index 6d12d5e4..a454532b 100644
--- a/packages/ui/src/components/controls/index.ts
+++ b/packages/ui/src/components/controls/index.ts
@@ -2,10 +2,8 @@ export * from './Button';
export * from './InputSelect';
export * from './Group';
export * from './Input';
-export * from './Icon';
export * from './IconButton';
export * from './IconCheckbox';
-export * from './IconType';
export * from './Label';
export * from './Select';
export * from './Toggle';
diff --git a/packages/ui/src/components/icons/Add.tsx b/packages/ui/src/components/icons/Add.tsx
new file mode 100644
index 00000000..7c04a040
--- /dev/null
+++ b/packages/ui/src/components/icons/Add.tsx
@@ -0,0 +1,9 @@
+import {HTMLAttributes} from 'preact/compat';
+
+export function Add(props: HTMLAttributes<SVGSVGElement>) {
+ return (
+ <svg viewBox="0 0 24 24" fill="currentColor" {...props}>
+ <path d="M19 13h-6v6h-2v-6H5v-2h6V5h2v6h6v2z" />
+ </svg>
+ );
+}
diff --git a/packages/ui/src/components/icons/Bug.tsx b/packages/ui/src/components/icons/Bug.tsx
new file mode 100644
index 00000000..a57f76ae
--- /dev/null
+++ b/packages/ui/src/components/icons/Bug.tsx
@@ -0,0 +1,7 @@
+export function Bug() {
+ return (
+ <svg viewBox="0 0 24 24" fill="currentColor">
+ <path d="M20 8h-2.81c-.45-.78-1.07-1.45-1.82-1.96L17 4.41 15.59 3l-2.17 2.17C12.96 5.06 12.49 5 12 5s-.96.06-1.41.17L8.41 3 7 4.41l1.62 1.63C7.88 6.55 7.26 7.22 6.81 8H4v2h2.09c-.05.33-.09.66-.09 1v1H4v2h2v1c0 .34.04.67.09 1H4v2h2.81c1.04 1.79 2.97 3 5.19 3s4.15-1.21 5.19-3H20v-2h-2.09c.05-.33.09-.66.09-1v-1h2v-2h-2v-1c0-.34-.04-.67-.09-1H20V8zm-4 4v3c0 .22-.03.47-.07.7l-.1.65-.37.65c-.72 1.24-2.04 2-3.46 2s-2.74-.77-3.46-2l-.37-.64-.1-.65C8.03 15.48 8 15.23 8 15v-4c0-.23.03-.48.07-.7l.1-.65.37-.65c.3-.52.72-.97 1.21-1.31l.57-.39.74-.18c.31-.08.63-.12.94-.12.32 0 .63.04.95.12l.68.16.61.42c.5.34.91.78 1.21 1.31l.38.65.1.65c.04.22.07.47.07.69v1zm-6 2h4v2h-4zm0-4h4v2h-4z" />
+ </svg>
+ );
+}
diff --git a/packages/ui/src/components/icons/ChevronRight.tsx b/packages/ui/src/components/icons/ChevronRight.tsx
new file mode 100644
index 00000000..05f0c373
--- /dev/null
+++ b/packages/ui/src/components/icons/ChevronRight.tsx
@@ -0,0 +1,9 @@
+import {HTMLAttributes} from 'preact/compat';
+
+export function ChevronRight(props: HTMLAttributes<SVGSVGElement>) {
+ return (
+ <svg viewBox="0 0 24 24" fill="currentColor" {...props}>
+ <polygon points="10.71 16.71 9.29 15.29 12.59 12 9.29 8.71 10.71 7.29 15.41 12 10.71 16.71" />
+ </svg>
+ );
+}
diff --git a/packages/ui/src/components/icons/Clear.tsx b/packages/ui/src/components/icons/Clear.tsx
new file mode 100644
index 00000000..3c1b2bd7
--- /dev/null
+++ b/packages/ui/src/components/icons/Clear.tsx
@@ -0,0 +1,7 @@
+export function Clear() {
+ return (
+ <svg viewBox="0 0 24 24" fill="currentColor">
+ <path d="M12 2C6.48 2 2 6.48 2 12s4.48 10 10 10 10-4.48 10-10S17.52 2 12 2zm0 18c-4.42 0-8-3.58-8-8 0-1.85.63-3.55 1.69-4.9L16.9 18.31C15.55 19.37 13.85 20 12 20zm6.31-3.1L7.1 5.69C8.45 4.63 10.15 4 12 4c4.42 0 8 3.58 8 8 0 1.85-.63 3.55-1.69 4.9z" />
+ </svg>
+ );
+}
diff --git a/packages/ui/src/components/icons/DragIndicator.tsx b/packages/ui/src/components/icons/DragIndicator.tsx
new file mode 100644
index 00000000..538a1e87
--- /dev/null
+++ b/packages/ui/src/components/icons/DragIndicator.tsx
@@ -0,0 +1,9 @@
+import {HTMLAttributes} from 'preact/compat';
+
+export function DragIndicator(props: HTMLAttributes<SVGSVGElement>) {
+ return (
+ <svg viewBox="0 0 24 24" fill="currentColor" {...props}>
+ <path d="M11 18c0 1.1-.9 2-2 2s-2-.9-2-2 .9-2 2-2 2 .9 2 2zm-2-8c-1.1 0-2 .9-2 2s.9 2 2 2 2-.9 2-2-.9-2-2-2zm0-6c-1.1 0-2 .9-2 2s.9 2 2 2 2-.9 2-2-.9-2-2-2zm6 4c1.1 0 2-.9 2-2s-.9-2-2-2-2 .9-2 2 .9 2 2 2zm0 2c-1.1 0-2 .9-2 2s.9 2 2 2 2-.9 2-2-.9-2-2-2zm0 6c-1.1 0-2 .9-2 2s.9 2 2 2 2-.9 2-2-.9-2-2-2z" />
+ </svg>
+ );
+}
diff --git a/packages/ui/src/components/icons/Locate.tsx b/packages/ui/src/components/icons/Locate.tsx
new file mode 100644
index 00000000..bbe54bf5
--- /dev/null
+++ b/packages/ui/src/components/icons/Locate.tsx
@@ -0,0 +1,7 @@
+export function Locate() {
+ return (
+ <svg viewBox="0 0 24 24" fill="currentColor">
+ <path d="M12 8c-2.21 0-4 1.79-4 4s1.79 4 4 4 4-1.79 4-4-1.79-4-4-4zm8.94 3c-.46-4.17-3.77-7.48-7.94-7.94V1h-2v2.06C6.83 3.52 3.52 6.83 3.06 11H1v2h2.06c.46 4.17 3.77 7.48 7.94 7.94V23h2v-2.06c4.17-.46 7.48-3.77 7.94-7.94H23v-2h-2.06zM12 19c-3.87 0-7-3.13-7-7s3.13-7 7-7 7 3.13 7 7-3.13 7-7 7z" />
+ </svg>
+ );
+}
diff --git a/packages/ui/src/components/icons/MotionCanvas.tsx b/packages/ui/src/components/icons/MotionCanvas.tsx
new file mode 100644
index 00000000..62c5968d
--- /dev/null
+++ b/packages/ui/src/components/icons/MotionCanvas.tsx
@@ -0,0 +1,25 @@
+export function MotionCanvas() {
+ return (
+ <svg viewBox="0 0 24 24" fill="currentColor">
+ <path
+ d="M23.6,17c-0.1,0.7-0.7,1.1-1.3,1.1c-0.1,0-0.1,0-0.2,0l-4.8-0.8l0.8,4.8c0.1,0.7-0.4,1.4-1.1,1.5c-0.1,0-0.1,0-0.2,0
+ c-0.7,0-1.2-0.5-1.3-1.1l-0.7-4.8l-4.3,2.2c-0.7,0.3-1.5,0.1-1.8-0.6c-0.1-0.2-0.1-0.4-0.1-0.6c0-0.5,0.3-0.9,0.7-1.2l4.3-2.2
+ L10.1,12c-0.5-0.5-0.5-1.4,0-1.9c0.3-0.3,0.6-0.4,0.9-0.4s0.7,0.1,0.9,0.4l3.4,3.4l2.2-4.3c0.3-0.7,1.1-0.9,1.8-0.6
+ c0.5,0.2,0.7,0.7,0.7,1.2c0,0.2-0.1,0.4-0.1,0.6l-2.2,4.3l4.8,0.7C23.3,15.6,23.7,16.3,23.6,17z"
+ />
+ <path
+ d="M15.5,8.9L15.5,8.9c-0.5,0.5-1.4,0.5-1.9,0l-2.8-2.8c-0.5-0.5-0.5-1.4,0-1.9l0,0c0.5-0.5,1.4-0.5,1.9,0L15.5,7
+ C16,7.5,16,8.4,15.5,8.9z"
+ />
+ <path d="M9.4,2.8L9.4,2.8C8.8,3.3,8,3.3,7.5,2.8l0,0C7,2.2,7,1.4,7.5,0.9l0,0c0.5-0.5,1.4-0.5,1.9,0l0,0C9.9,1.4,9.9,2.2,9.4,2.8z" />
+ <path
+ d="M8.4,8.4L8.4,8.4c-0.5,0.5-1.4,0.5-1.9,0L2.3,4.2c-0.5-0.5-0.5-1.4,0-1.9l0,0c0.5-0.5,1.4-0.5,1.9,0l4.2,4.2
+ C8.9,7.1,8.9,7.9,8.4,8.4z"
+ />
+ <path
+ d="M8.9,15.5L8.9,15.5C8.4,16,7.5,16,7,15.5L1.3,9.8c-0.5-0.5-0.5-1.4,0-1.9l0,0c0.5-0.5,1.4-0.5,1.9,0l5.7,5.7
+ C9.4,14.1,9.4,15,8.9,15.5z"
+ />
+ </svg>
+ );
+}
diff --git a/packages/ui/src/components/icons/Pause.tsx b/packages/ui/src/components/icons/Pause.tsx
new file mode 100644
index 00000000..4c29ab9d
--- /dev/null
+++ b/packages/ui/src/components/icons/Pause.tsx
@@ -0,0 +1,7 @@
+export function Pause() {
+ return (
+ <svg viewBox="0 0 24 24" fill="currentColor">
+ <path d="M6 19h4V5H6v14zm8-14v14h4V5h-4z" />
+ </svg>
+ );
+}
diff --git a/packages/ui/src/components/icons/PhotoCamera.tsx b/packages/ui/src/components/icons/PhotoCamera.tsx
new file mode 100644
index 00000000..571c38b5
--- /dev/null
+++ b/packages/ui/src/components/icons/PhotoCamera.tsx
@@ -0,0 +1,8 @@
+export function PhotoCamera() {
+ return (
+ <svg viewBox="0 0 24 24" fill="currentColor">
+ <circle cx="12" cy="12" r="3.2" />
+ <path d="M9 2L7.17 4H4c-1.1 0-2 .9-2 2v12c0 1.1.9 2 2 2h16c1.1 0 2-.9 2-2V6c0-1.1-.9-2-2-2h-3.17L15 2H9zm3 15c-2.76 0-5-2.24-5-5s2.24-5 5-5 5 2.24 5 5-2.24 5-5 5z" />
+ </svg>
+ );
+}
diff --git a/packages/ui/src/components/icons/PlayArrow.tsx b/packages/ui/src/components/icons/PlayArrow.tsx
new file mode 100644
index 00000000..6d75b87f
--- /dev/null
+++ b/packages/ui/src/components/icons/PlayArrow.tsx
@@ -0,0 +1,7 @@
+export function PlayArrow() {
+ return (
+ <svg viewBox="0 0 24 24" fill="currentColor">
+ <path d="M8 5v14l11-7z" />
+ </svg>
+ );
+}
diff --git a/packages/ui/src/components/icons/Repeat.tsx b/packages/ui/src/components/icons/Repeat.tsx
new file mode 100644
index 00000000..22ee31a8
--- /dev/null
+++ b/packages/ui/src/components/icons/Repeat.tsx
@@ -0,0 +1,7 @@
+export function Repeat() {
+ return (
+ <svg viewBox="0 0 24 24" fill="currentColor">
+ <path d="M7 7h10v3l4-4-4-4v3H5v6h2V7zm10 10H7v-3l-4 4 4 4v-3h12v-6h-2v4z" />
+ </svg>
+ );
+}
diff --git a/packages/ui/src/components/icons/Schedule.tsx b/packages/ui/src/components/icons/Schedule.tsx
new file mode 100644
index 00000000..f17a042a
--- /dev/null
+++ b/packages/ui/src/components/icons/Schedule.tsx
@@ -0,0 +1,8 @@
+export function Schedule() {
+ return (
+ <svg viewBox="0 0 24 24" fill="currentColor">
+ <path d="M11.99 2C6.47 2 2 6.48 2 12s4.47 10 9.99 10C17.52 22 22 17.52 22 12S17.52 2 11.99 2zM12 20c-4.42 0-8-3.58-8-8s3.58-8 8-8 8 3.58 8 8-3.58 8-8 8z" />
+ <path d="M12.5 7H11v6l5.25 3.15.75-1.23-4.5-2.67z" />
+ </svg>
+ );
+}
diff --git a/packages/ui/src/components/icons/SkipNext.tsx b/packages/ui/src/components/icons/SkipNext.tsx
new file mode 100644
index 00000000..e2fef0e9
--- /dev/null
+++ b/packages/ui/src/components/icons/SkipNext.tsx
@@ -0,0 +1,7 @@
+export function SkipNext() {
+ return (
+ <svg viewBox="0 0 24 24" fill="currentColor">
+ <path d="M6 18l8.5-6L6 6v12zM16 6v12h2V6h-2z" />
+ </svg>
+ );
+}
diff --git a/packages/ui/src/components/icons/SkipPrevious.tsx b/packages/ui/src/components/icons/SkipPrevious.tsx
new file mode 100644
index 00000000..6ff9b316
--- /dev/null
+++ b/packages/ui/src/components/icons/SkipPrevious.tsx
@@ -0,0 +1,7 @@
+export function SkipPrevious() {
+ return (
+ <svg viewBox="0 0 24 24" fill="currentColor">
+ <path d="M6 6h2v12H6zm3.5 6l8.5 6V6z" />
+ </svg>
+ );
+}
diff --git a/packages/ui/src/components/icons/Tune.tsx b/packages/ui/src/components/icons/Tune.tsx
new file mode 100644
index 00000000..50412e23
--- /dev/null
+++ b/packages/ui/src/components/icons/Tune.tsx
@@ -0,0 +1,7 @@
+export function Tune() {
+ return (
+ <svg viewBox="0 0 24 24" fill="currentColor">
+ <path d="M3 17v2h6v-2H3zM3 5v2h10V5H3zm10 16v-2h8v-2h-8v-2h-2v6h2zM7 9v2H3v2h4v2h2V9H7zm14 4v-2H11v2h10zm-6-4h2V7h4V5h-4V3h-2v6z" />
+ </svg>
+ );
+}
diff --git a/packages/ui/src/components/icons/UnfoldMore.tsx b/packages/ui/src/components/icons/UnfoldMore.tsx
new file mode 100644
index 00000000..35e0f7b9
--- /dev/null
+++ b/packages/ui/src/components/icons/UnfoldMore.tsx
@@ -0,0 +1,7 @@
+export function UnfoldMore() {
+ return (
+ <svg viewBox="0 0 24 24" fill="currentColor">
+ <path d="M12 5.83L15.17 9l1.41-1.41L12 3 7.41 7.59 8.83 9 12 5.83zm0 12.34L8.83 15l-1.41 1.41L12 21l4.59-4.59L15.17 15 12 18.17z" />
+ </svg>
+ );
+}
diff --git a/packages/ui/src/components/icons/VideoSettings.tsx b/packages/ui/src/components/icons/VideoSettings.tsx
new file mode 100644
index 00000000..ac825b8b
--- /dev/null
+++ b/packages/ui/src/components/icons/VideoSettings.tsx
@@ -0,0 +1,13 @@
+export function VideoSettings() {
+ return (
+ <svg viewBox="0 0 24 24" fill="currentColor">
+ <g>
+ <g>
+ <path d="M3,6h18v5h2V6c0-1.1-0.9-2-2-2H3C1.9,4,1,4.9,1,6v12c0,1.1,0.9,2,2,2h9v-2H3V6z" />
+ <polygon points="15,12 9,8 9,16" />
+ <path d="M22.71,18.43c0.03-0.29,0.04-0.58,0.01-0.86l1.07-0.85c0.1-0.08,0.12-0.21,0.06-0.32l-1.03-1.79 c-0.06-0.11-0.19-0.15-0.31-0.11L21.23,15c-0.23-0.17-0.48-0.31-0.75-0.42l-0.2-1.36C20.26,13.09,20.16,13,20.03,13h-2.07 c-0.12,0-0.23,0.09-0.25,0.21l-0.2,1.36c-0.26,0.11-0.51,0.26-0.74,0.42l-1.28-0.5c-0.12-0.05-0.25,0-0.31,0.11l-1.03,1.79 c-0.06,0.11-0.04,0.24,0.06,0.32l1.07,0.86c-0.03,0.29-0.04,0.58-0.01,0.86l-1.07,0.85c-0.1,0.08-0.12,0.21-0.06,0.32l1.03,1.79 c0.06,0.11,0.19,0.15,0.31,0.11l1.27-0.5c0.23,0.17,0.48,0.31,0.75,0.42l0.2,1.36c0.02,0.12,0.12,0.21,0.25,0.21h2.07 c0.12,0,0.23-0.09,0.25-0.21l0.2-1.36c0.26-0.11,0.51-0.26,0.74-0.42l1.28,0.5c0.12,0.05,0.25,0,0.31-0.11l1.03-1.79 c0.06-0.11,0.04-0.24-0.06-0.32L22.71,18.43z M19,19.5c-0.83,0-1.5-0.67-1.5-1.5s0.67-1.5,1.5-1.5s1.5,0.67,1.5,1.5 S19.83,19.5,19,19.5z" />
+ </g>
+ </g>
+ </svg>
+ );
+}
diff --git a/packages/ui/src/components/icons/VolumeOff.tsx b/packages/ui/src/components/icons/VolumeOff.tsx
new file mode 100644
index 00000000..304858c8
--- /dev/null
+++ b/packages/ui/src/components/icons/VolumeOff.tsx
@@ -0,0 +1,7 @@
+export function VolumeOff() {
+ return (
+ <svg viewBox="0 0 24 24" fill="currentColor">
+ <path d="M16.5 12c0-1.77-1.02-3.29-2.5-4.03v2.21l2.45 2.45c.03-.2.05-.41.05-.63zm2.5 0c0 .94-.2 1.82-.54 2.64l1.51 1.51C20.63 14.91 21 13.5 21 12c0-4.28-2.99-7.86-7-8.77v2.06c2.89.86 5 3.54 5 6.71zM4.27 3L3 4.27 7.73 9H3v6h4l5 5v-6.73l4.25 4.25c-.67.52-1.42.93-2.25 1.18v2.06c1.38-.31 2.63-.95 3.69-1.81L19.73 21 21 19.73l-9-9L4.27 3zM12 4L9.91 6.09 12 8.18V4z" />
+ </svg>
+ );
+}
diff --git a/packages/ui/src/components/icons/VolumeOn.tsx b/packages/ui/src/components/icons/VolumeOn.tsx
new file mode 100644
index 00000000..7b86538a
--- /dev/null
+++ b/packages/ui/src/components/icons/VolumeOn.tsx
@@ -0,0 +1,7 @@
+export function VolumeOn() {
+ return (
+ <svg viewBox="0 0 24 24" fill="currentColor">
+ <path d="M3 9v6h4l5 5V4L7 9H3zm13.5 3c0-1.77-1.02-3.29-2.5-4.03v8.05c1.48-.73 2.5-2.25 2.5-4.02zM14 3.23v2.06c2.89.86 5 3.54 5 6.71s-2.11 5.85-5 6.71v2.06c4.01-.91 7-4.49 7-8.77s-2.99-7.86-7-8.77z" />
+ </svg>
+ );
+}
diff --git a/packages/ui/src/components/icons/Warning.tsx b/packages/ui/src/components/icons/Warning.tsx
new file mode 100644
index 00000000..8734fdc8
--- /dev/null
+++ b/packages/ui/src/components/icons/Warning.tsx
@@ -0,0 +1,7 @@
+export function Warning() {
+ return (
+ <svg viewBox="0 0 24 24" fill="currentColor">
+ <path d="M1 21h22L12 2 1 21zm12-3h-2v-2h2v2zm0-4h-2v-4h2v4z" />
+ </svg>
+ );
+}
diff --git a/packages/ui/src/components/icons/index.ts b/packages/ui/src/components/icons/index.ts
new file mode 100644
index 00000000..6d3e1899
--- /dev/null
+++ b/packages/ui/src/components/icons/index.ts
@@ -0,0 +1,19 @@
+export * from './Add';
+export * from './Bug';
+export * from './Clear';
+export * from './DragIndicator';
+export * from './Locate';
+export * from './MotionCanvas';
+export * from './Pause';
+export * from './PhotoCamera';
+export * from './PlayArrow';
+export * from './Repeat';
+export * from './Schedule';
+export * from './SkipNext';
+export * from './SkipPrevious';
+export * from './Tune';
+export * from './UnfoldMore';
+export * from './VideoSettings';
+export * from './VolumeOff';
+export * from './VolumeOn';
+export * from './Warning';
diff --git a/packages/ui/src/components/playback/PlaybackControls.tsx b/packages/ui/src/components/playback/PlaybackControls.tsx
index 14fe18f6..d88cf61b 100644
--- a/packages/ui/src/components/playback/PlaybackControls.tsx
+++ b/packages/ui/src/components/playback/PlaybackControls.tsx
@@ -1,12 +1,23 @@
import styles from './Playback.module.scss';
-import {IconType, IconButton, IconCheckbox} from '../controls';
+import {IconButton, IconCheckbox} from '../controls';
import {useDocumentEvent, usePlayerState} from '../../hooks';
import {Select, Input} from '../controls';
import {Framerate} from './Framerate';
import {useCallback} from 'preact/hooks';
import {usePlayer} from '../../contexts';
import clsx from 'clsx';
+import React from 'react';
+import {
+ Pause,
+ PhotoCamera,
+ PlayArrow,
+ Repeat,
+ SkipNext,
+ SkipPrevious,
+ VolumeOff,
+ VolumeOn,
+} from '../icons';
export function PlaybackControls() {
const player = usePlayer();
@@ -61,41 +72,40 @@ export function PlaybackControls() {
/>
<IconCheckbox
id={'audio'}
- iconOn={IconType.volumeOn}
- iconOff={IconType.volumeOff}
titleOn="Mute audio"
titleOff="Unmute audio"
checked={!state.muted}
onChange={value => player.toggleAudio(value)}
- />
+ >
+ {state.muted ? <VolumeOff /> : <VolumeOn />}
+ </IconCheckbox>
<IconButton
title="Previous frame"
- icon={IconType.skipPrevious}
onClick={() => player.requestPreviousFrame()}
- />
+ >
+ <SkipPrevious />
+ </IconButton>
<IconCheckbox
id={'play'}
main
- iconOn={IconType.pause}
- iconOff={IconType.play}
titleOn="Play"
titleOff="Pause"
checked={!state.paused}
onChange={value => player.togglePlayback(value)}
- />
- <IconButton
- title="Next frame"
- icon={IconType.skipNext}
- onClick={() => player.requestNextFrame()}
- />
+ >
+ {state.paused ? <PlayArrow /> : <Pause />}
+ </IconCheckbox>
+ <IconButton title="Next frame" onClick={() => player.requestNextFrame()}>
+ <SkipNext />
+ </IconButton>
<IconCheckbox
id={'loop'}
- iconOn={IconType.repeat}
- iconOff={IconType.repeat}
titleOn="Loop video"
checked={state.loop}
onChange={() => player.toggleLoop()}
- />
+ >
+ <Repeat />
+ </IconCheckbox>
<Framerate
render={(framerate, paused) => (
<Input
@@ -108,9 +118,10 @@ export function PlaybackControls() {
/>
<IconButton
title="Save snapshot"
- icon={IconType.photoCamera}
onClick={() => player.exportCurrentFrame()}
- />
+ >
+ <PhotoCamera />
+ </IconButton>
</div>
);
}
diff --git a/packages/ui/src/components/sidebar/Rendering.tsx b/packages/ui/src/components/sidebar/Rendering.tsx
index e1cb2d1e..a553a3a4 100644
--- a/packages/ui/src/components/sidebar/Rendering.tsx
+++ b/packages/ui/src/components/sidebar/Rendering.tsx
@@ -1,22 +1,14 @@
import styles from './Sidebar.module.scss';
import {usePlayerState} from '../../hooks';
-import {
- Button,
- Group,
- Icon,
- IconType,
- Input,
- InputSelect,
- Label,
- Select,
-} from '../controls';
+import {Button, Group, Input, InputSelect, Label, Select} from '../controls';
import {Pane} from '../tabs';
import {usePlayer} from '../../contexts';
import type {
CanvasColorSpace,
CanvasOutputMimeType,
} from '@motion-canvas/core/lib/types';
+import {Add} from '../icons';
export function Rendering() {
const player = usePlayer();
@@ -93,7 +85,7 @@ export function Rendering() {
player.project.setSize(value, height);
}}
/>
- <Icon className={styles.times} type={IconType.add} />
+ <Add className={styles.times} />
<Input
type="number"
min={1}
diff --git a/packages/ui/src/components/sidebar/Sidebar.module.scss b/packages/ui/src/components/sidebar/Sidebar.module.scss
index 3d58dc1c..31356200 100644
--- a/packages/ui/src/components/sidebar/Sidebar.module.scss
+++ b/packages/ui/src/components/sidebar/Sidebar.module.scss
@@ -4,8 +4,9 @@
.times {
rotate: 45deg;
- --icon-color: rgba(255, 255, 255, 0.32);
+ color: rgba(255, 255, 255, 0.32);
margin: 0 -4px;
+ flex-shrink: 0;
}
.thread {
diff --git a/packages/ui/src/components/sidebar/Sidebar.tsx b/packages/ui/src/components/sidebar/Sidebar.tsx
index 5d1aaa74..7617b9b6 100644
--- a/packages/ui/src/components/sidebar/Sidebar.tsx
+++ b/packages/ui/src/components/sidebar/Sidebar.tsx
@@ -1,4 +1,3 @@
-import {IconType} from '../controls';
import {Badge, Tabs, TabType} from '../tabs';
import {Properties} from './Properties';
import {Rendering} from './Rendering';
@@ -8,6 +7,7 @@ import {useInspection, useLogger} from '../../contexts';
import {useEffect, useRef, useState} from 'preact/hooks';
import {shake} from '../animations';
import {useStorage} from '../../hooks';
+import {MotionCanvas, Bug, Tune, VideoSettings, Schedule} from '../icons';
interface SidebarProps {
setOpen?: (value: boolean) => void;
@@ -49,7 +49,7 @@ export function Sidebar({setOpen}: SidebarProps) {
title: 'Project Selection',
id: 'project-selection-link',
type: TabType.Link,
- icon: IconType.motionCanvas,
+ icon: <MotionCanvas />,
url: window.location.pathname === '/' ? undefined : '/',
}}
{{
@@ -59,28 +59,28 @@ export function Sidebar({setOpen}: SidebarProps) {
title: 'Inspector',
id: 'inspector-tab',
type: TabType.Pane,
- icon: IconType.tune,
+ icon: <Tune />,
pane: <Properties />,
}}
{{
title: 'Video Settings',
id: 'rendering-tab',
type: TabType.Pane,
- icon: IconType.videoSettings,
+ icon: <VideoSettings />,
pane: <Rendering />,
}}
{{
title: 'Thread Debugger',
id: 'threads-tab',
type: TabType.Pane,
- icon: IconType.schedule,
+ icon: <Schedule />,
pane: <Threads />,
}}
{{
title: errorCount > 0 ? `Console (${errorCount})` : 'Console',
id: 'console-tab',
type: TabType.Pane,
- icon: IconType.bug,
+ icon: <Bug />,
pane: <Console />,
badge: errorCount > 0 && (
<Badge badgeRef={badge}>
diff --git a/packages/ui/src/components/tabs/Tabs.module.scss b/packages/ui/src/components/tabs/Tabs.module.scss
index 64c0f421..d64fd1ca 100644
--- a/packages/ui/src/components/tabs/Tabs.module.scss
+++ b/packages/ui/src/components/tabs/Tabs.module.scss
@@ -17,25 +17,25 @@
}
.tab {
- padding: 12px;
- margin: 0;
- border-radius: 0 4px 4px 0;
+ padding: 8px;
+ margin: 4px;
+ border-radius: 4px;
cursor: pointer;
position: relative;
- --icon-color: rgba(255, 255, 255, 0.54);
+ color: rgba(255, 255, 255, 0.54);
&:hover {
- --icon-color: white;
+ color: white;
}
&.active {
background: var(--surface-color);
- --icon-color: white;
+ color: white;
}
&.disabled {
pointer-events: none;
- --icon-color: rgba(255, 255, 255, 0.16);
+ color: rgba(255, 255, 255, 0.16);
}
}
diff --git a/packages/ui/src/components/tabs/Tabs.tsx b/packages/ui/src/components/tabs/Tabs.tsx
index 443a3435..a03b65e1 100644
--- a/packages/ui/src/components/tabs/Tabs.tsx
+++ b/packages/ui/src/components/tabs/Tabs.tsx
@@ -1,6 +1,5 @@
import styles from './Tabs.module.scss';
-import {Icon, IconType} from '../controls';
import {ComponentChildren} from 'preact';
import {useCallback, useLayoutEffect} from 'preact/hooks';
import clsx from 'clsx';
@@ -14,7 +13,7 @@ export enum TabType {
type Tab =
| {
type: TabType.Pane;
- icon: IconType;
+ icon: ComponentChildren;
pane: ComponentChildren;
badge?: ComponentChildren;
title?: string;
@@ -22,7 +21,7 @@ type Tab =
}
| {
type: TabType.Link;
- icon: IconType;
+ icon: ComponentChildren;
url?: string;
title?: string;
id?: string;
@@ -59,24 +58,24 @@ export function Tabs({children, tab, onToggle}: TabsProps) {
<div className={styles.tabs}>
{children.map((data, index) =>
data.type === TabType.Link ? (
- <Icon
- as="a"
+ <a
title={data.title}
- type={data.icon}
href={data.url}
id={data.id}
className={clsx(styles.tab, !data.url && styles.disabled)}
- />
+ >
+ {data.icon}
+ </a>
) : data.type === TabType.Pane ? (
- <Icon
- type={data.icon}
+ <button
title={data.title}
id={data.id}
onClick={() => toggleTab(index)}
className={clsx(styles.tab, tab === index && styles.active)}
>
+ {data.icon}
{data.badge}
- </Icon>
+ </button>
) : (
<div className={styles.space} />
),
diff --git a/packages/ui/src/components/timeline/RangeSelector.tsx b/packages/ui/src/components/timeline/RangeSelector.tsx
index ff28d5b3..b5ecf2a9 100644
--- a/packages/ui/src/components/timeline/RangeSelector.tsx
+++ b/packages/ui/src/components/timeline/RangeSelector.tsx
@@ -2,8 +2,8 @@ import styles from './Timeline.module.scss';
import {useDrag, usePlayerState} from '../../hooks';
import {useCallback, useEffect, useState} from 'preact/hooks';
-import {Icon, IconType} from '../controls';
import {usePlayer, useTimelineContext} from '../../contexts';
+import {DragIndicator} from '../icons';
export function RangeSelector() {
const {pixelsToFrames, framesToPercents} = useTimelineContext();
@@ -79,17 +79,9 @@ export function RangeSelector() {
}
}}
>
- <Icon
- onMouseDown={handleDragStart}
- className={styles.handle}
- type={IconType.dragIndicator}
- />
+ <DragIndicator onMouseDown={handleDragStart} className={styles.handle} />
<div class={styles.handleSpacer} />
- <Icon
- onMouseDown={handleDragEnd}
- className={styles.handle}
- type={IconType.dragIndicator}
- />
+ <DragIndicator onMouseDown={handleDragEnd} className={styles.handle} />
</div>
);
}
diff --git a/packages/ui/src/components/timeline/Timeline.module.scss b/packages/ui/src/components/timeline/Timeline.module.scss
index eeed9f3a..38c94b9d 100644
--- a/packages/ui/src/components/timeline/Timeline.module.scss
+++ b/packages/ui/src/components/timeline/Timeline.module.scss
@@ -242,18 +242,15 @@
.handle {
cursor: pointer;
margin-top: 2px;
+ color: rgba(255, 255, 255, 0);
- &:after {
- background-color: rgba(255, 255, 255, 0);
+ .range:hover > & {
+ color: rgba(255, 255, 255, 0.24);
}
- .range:hover > &:after {
- background-color: rgba(255, 255, 255, 0.24);
- }
-
- .range > &:hover:after,
- .range > &:active:after {
- background-color: rgba(255, 255, 255, 0.6);
+ .range > &:hover,
+ .range > &:active {
+ color: rgba(255, 255, 255, 0.6);
}
}
diff --git a/packages/ui/src/img/icons/add.svg b/packages/ui/src/img/icons/add.svg
deleted file mode 100644
index 93b8cea7..00000000
--- a/packages/ui/src/img/icons/add.svg
+++ /dev/null
@@ -1 +0,0 @@
-<svg xmlns="http://www.w3.org/2000/svg" height="24px" viewBox="0 0 24 24" width="24px" fill="#000000"><path d="M0 0h24v24H0V0z" fill="none"/><path d="M19 13h-6v6h-2v-6H5v-2h6V5h2v6h6v2z"/></svg>
\ No newline at end of file
diff --git a/packages/ui/src/img/icons/bug.svg b/packages/ui/src/img/icons/bug.svg
deleted file mode 100644
index 0aef9c4b..00000000
--- a/packages/ui/src/img/icons/bug.svg
+++ /dev/null
@@ -1 +0,0 @@
-<svg xmlns="http://www.w3.org/2000/svg" height="24px" viewBox="0 0 24 24" width="24px" fill="#000000"><path d="M0 0h24v24H0V0z" fill="none"/><path d="M20 8h-2.81c-.45-.78-1.07-1.45-1.82-1.96L17 4.41 15.59 3l-2.17 2.17C12.96 5.06 12.49 5 12 5s-.96.06-1.41.17L8.41 3 7 4.41l1.62 1.63C7.88 6.55 7.26 7.22 6.81 8H4v2h2.09c-.05.33-.09.66-.09 1v1H4v2h2v1c0 .34.04.67.09 1H4v2h2.81c1.04 1.79 2.97 3 5.19 3s4.15-1.21 5.19-3H20v-2h-2.09c.05-.33.09-.66.09-1v-1h2v-2h-2v-1c0-.34-.04-.67-.09-1H20V8zm-4 4v3c0 .22-.03.47-.07.7l-.1.65-.37.65c-.72 1.24-2.04 2-3.46 2s-2.74-.77-3.46-2l-.37-.64-.1-.65C8.03 15.48 8 15.23 8 15v-4c0-.23.03-.48.07-.7l.1-.65.37-.65c.3-.52.72-.97 1.21-1.31l.57-.39.74-.18c.31-.08.63-.12.94-.12.32 0 .63.04.95.12l.68.16.61.42c.5.34.91.78 1.21 1.31l.38.65.1.65c.04.22.07.47.07.69v1zm-6 2h4v2h-4zm0-4h4v2h-4z"/></svg>
\ No newline at end of file
diff --git a/packages/ui/src/img/icons/chevron_right.svg b/packages/ui/src/img/icons/chevron_right.svg
deleted file mode 100644
index 08654c0e..00000000
--- a/packages/ui/src/img/icons/chevron_right.svg
+++ /dev/null
@@ -1 +0,0 @@
-<svg xmlns="http://www.w3.org/2000/svg" height="24px" viewBox="0 0 24 24" width="24px" fill="#000000"><path d="M0 0h24v24H0V0z" fill="none"/><polygon points="10.71 16.71 9.29 15.29 12.59 12 9.29 8.71 10.71 7.29 15.41 12 10.71 16.71"/></svg>
diff --git a/packages/ui/src/img/icons/clear.svg b/packages/ui/src/img/icons/clear.svg
deleted file mode 100644
index 6dfdc1d2..00000000
--- a/packages/ui/src/img/icons/clear.svg
+++ /dev/null
@@ -1 +0,0 @@
-<svg xmlns="http://www.w3.org/2000/svg" height="24px" viewBox="0 0 24 24" width="24px" fill="#000000"><path d="M0 0h24v24H0V0z" fill="none"/><path d="M12 2C6.48 2 2 6.48 2 12s4.48 10 10 10 10-4.48 10-10S17.52 2 12 2zm0 18c-4.42 0-8-3.58-8-8 0-1.85.63-3.55 1.69-4.9L16.9 18.31C15.55 19.37 13.85 20 12 20zm6.31-3.1L7.1 5.69C8.45 4.63 10.15 4 12 4c4.42 0 8 3.58 8 8 0 1.85-.63 3.55-1.69 4.9z"/></svg>
\ No newline at end of file
diff --git a/packages/ui/src/img/icons/drag_indicator.svg b/packages/ui/src/img/icons/drag_indicator.svg
deleted file mode 100644
index 2691760e..00000000
--- a/packages/ui/src/img/icons/drag_indicator.svg
+++ /dev/null
@@ -1 +0,0 @@
-<svg xmlns="http://www.w3.org/2000/svg" height="24px" viewBox="0 0 24 24" width="24px" fill="#000000"><path d="M0 0h24v24H0V0z" fill="none"/><path d="M11 18c0 1.1-.9 2-2 2s-2-.9-2-2 .9-2 2-2 2 .9 2 2zm-2-8c-1.1 0-2 .9-2 2s.9 2 2 2 2-.9 2-2-.9-2-2-2zm0-6c-1.1 0-2 .9-2 2s.9 2 2 2 2-.9 2-2-.9-2-2-2zm6 4c1.1 0 2-.9 2-2s-.9-2-2-2-2 .9-2 2 .9 2 2 2zm0 2c-1.1 0-2 .9-2 2s.9 2 2 2 2-.9 2-2-.9-2-2-2zm0 6c-1.1 0-2 .9-2 2s.9 2 2 2 2-.9 2-2-.9-2-2-2z"/></svg>
\ No newline at end of file
diff --git a/packages/ui/src/img/icons/locate.svg b/packages/ui/src/img/icons/locate.svg
deleted file mode 100644
index 92096fb8..00000000
--- a/packages/ui/src/img/icons/locate.svg
+++ /dev/null
@@ -1 +0,0 @@
-<svg xmlns="http://www.w3.org/2000/svg" height="24px" viewBox="0 0 24 24" width="24px" fill="#000000"><path d="M0 0h24v24H0V0z" fill="none"/><path d="M12 8c-2.21 0-4 1.79-4 4s1.79 4 4 4 4-1.79 4-4-1.79-4-4-4zm8.94 3c-.46-4.17-3.77-7.48-7.94-7.94V1h-2v2.06C6.83 3.52 3.52 6.83 3.06 11H1v2h2.06c.46 4.17 3.77 7.48 7.94 7.94V23h2v-2.06c4.17-.46 7.48-3.77 7.94-7.94H23v-2h-2.06zM12 19c-3.87 0-7-3.13-7-7s3.13-7 7-7 7 3.13 7 7-3.13 7-7 7z"/></svg>
\ No newline at end of file
diff --git a/packages/ui/src/img/icons/motion_canvas.svg b/packages/ui/src/img/icons/motion_canvas.svg
deleted file mode 100644
index ba97cc6c..00000000
--- a/packages/ui/src/img/icons/motion_canvas.svg
+++ /dev/null
@@ -1,14 +0,0 @@
-<svg xmlns="http://www.w3.org/2000/svg" height="24px" viewBox="0 0 24 24" width="24px" fill="#000000">
-<path d="M23.6,17c-0.1,0.7-0.7,1.1-1.3,1.1c-0.1,0-0.1,0-0.2,0l-4.8-0.8l0.8,4.8c0.1,0.7-0.4,1.4-1.1,1.5c-0.1,0-0.1,0-0.2,0
- c-0.7,0-1.2-0.5-1.3-1.1l-0.7-4.8l-4.3,2.2c-0.7,0.3-1.5,0.1-1.8-0.6c-0.1-0.2-0.1-0.4-0.1-0.6c0-0.5,0.3-0.9,0.7-1.2l4.3-2.2
- L10.1,12c-0.5-0.5-0.5-1.4,0-1.9c0.3-0.3,0.6-0.4,0.9-0.4s0.7,0.1,0.9,0.4l3.4,3.4l2.2-4.3c0.3-0.7,1.1-0.9,1.8-0.6
- c0.5,0.2,0.7,0.7,0.7,1.2c0,0.2-0.1,0.4-0.1,0.6l-2.2,4.3l4.8,0.7C23.3,15.6,23.7,16.3,23.6,17z"/>
-<path d="M15.5,8.9L15.5,8.9c-0.5,0.5-1.4,0.5-1.9,0l-2.8-2.8c-0.5-0.5-0.5-1.4,0-1.9l0,0c0.5-0.5,1.4-0.5,1.9,0L15.5,7
- C16,7.5,16,8.4,15.5,8.9z"/>
-<path d="M9.4,2.8L9.4,2.8C8.8,3.3,8,3.3,7.5,2.8l0,0C7,2.2,7,1.4,7.5,0.9l0,0c0.5-0.5,1.4-0.5,1.9,0l0,0C9.9,1.4,9.9,2.2,9.4,2.8z"
- />
-<path d="M8.4,8.4L8.4,8.4c-0.5,0.5-1.4,0.5-1.9,0L2.3,4.2c-0.5-0.5-0.5-1.4,0-1.9l0,0c0.5-0.5,1.4-0.5,1.9,0l4.2,4.2
- C8.9,7.1,8.9,7.9,8.4,8.4z"/>
-<path d="M8.9,15.5L8.9,15.5C8.4,16,7.5,16,7,15.5L1.3,9.8c-0.5-0.5-0.5-1.4,0-1.9l0,0c0.5-0.5,1.4-0.5,1.9,0l5.7,5.7
- C9.4,14.1,9.4,15,8.9,15.5z"/>
-</svg>
diff --git a/packages/ui/src/img/icons/pause.svg b/packages/ui/src/img/icons/pause.svg
deleted file mode 100644
index 4104cb00..00000000
--- a/packages/ui/src/img/icons/pause.svg
+++ /dev/null
@@ -1 +0,0 @@
-<svg xmlns="http://www.w3.org/2000/svg" height="24px" viewBox="0 0 24 24" width="24px" fill="#000000"><path d="M0 0h24v24H0z" fill="none"/><path d="M6 19h4V5H6v14zm8-14v14h4V5h-4z"/></svg>
\ No newline at end of file
diff --git a/packages/ui/src/img/icons/photo_camera.svg b/packages/ui/src/img/icons/photo_camera.svg
deleted file mode 100644
index 330c5e78..00000000
--- a/packages/ui/src/img/icons/photo_camera.svg
+++ /dev/null
@@ -1 +0,0 @@
-<svg xmlns="http://www.w3.org/2000/svg" height="24px" viewBox="0 0 24 24" width="24px" fill="#000000"><path d="M0 0h24v24H0z" fill="none"/><circle cx="12" cy="12" r="3.2"/><path d="M9 2L7.17 4H4c-1.1 0-2 .9-2 2v12c0 1.1.9 2 2 2h16c1.1 0 2-.9 2-2V6c0-1.1-.9-2-2-2h-3.17L15 2H9zm3 15c-2.76 0-5-2.24-5-5s2.24-5 5-5 5 2.24 5 5-2.24 5-5 5z"/></svg>
\ No newline at end of file
diff --git a/packages/ui/src/img/icons/play_arrow.svg b/packages/ui/src/img/icons/play_arrow.svg
deleted file mode 100644
index 178bd3a4..00000000
--- a/packages/ui/src/img/icons/play_arrow.svg
+++ /dev/null
@@ -1 +0,0 @@
-<svg xmlns="http://www.w3.org/2000/svg" height="24px" viewBox="0 0 24 24" width="24px" fill="#000000"><path d="M0 0h24v24H0z" fill="none"/><path d="M8 5v14l11-7z"/></svg>
\ No newline at end of file
diff --git a/packages/ui/src/img/icons/repeat.svg b/packages/ui/src/img/icons/repeat.svg
deleted file mode 100644
index cd41e84e..00000000
--- a/packages/ui/src/img/icons/repeat.svg
+++ /dev/null
@@ -1 +0,0 @@
-<svg xmlns="http://www.w3.org/2000/svg" height="24px" viewBox="0 0 24 24" width="24px" fill="#000000"><path d="M0 0h24v24H0z" fill="none"/><path d="M7 7h10v3l4-4-4-4v3H5v6h2V7zm10 10H7v-3l-4 4 4 4v-3h12v-6h-2v4z"/></svg>
\ No newline at end of file
diff --git a/packages/ui/src/img/icons/schedule.svg b/packages/ui/src/img/icons/schedule.svg
deleted file mode 100644
index 0d632671..00000000
--- a/packages/ui/src/img/icons/schedule.svg
+++ /dev/null
@@ -1 +0,0 @@
-<svg xmlns="http://www.w3.org/2000/svg" height="24px" viewBox="0 0 24 24" width="24px" fill="#000000"><path d="M0 0h24v24H0z" fill="none"/><path d="M11.99 2C6.47 2 2 6.48 2 12s4.47 10 9.99 10C17.52 22 22 17.52 22 12S17.52 2 11.99 2zM12 20c-4.42 0-8-3.58-8-8s3.58-8 8-8 8 3.58 8 8-3.58 8-8 8z"/><path d="M12.5 7H11v6l5.25 3.15.75-1.23-4.5-2.67z"/></svg>
\ No newline at end of file
diff --git a/packages/ui/src/img/icons/skip_next.svg b/packages/ui/src/img/icons/skip_next.svg
deleted file mode 100644
index 48b0ea99..00000000
--- a/packages/ui/src/img/icons/skip_next.svg
+++ /dev/null
@@ -1 +0,0 @@
-<svg xmlns="http://www.w3.org/2000/svg" height="24px" viewBox="0 0 24 24" width="24px" fill="#000000"><path d="M0 0h24v24H0z" fill="none"/><path d="M6 18l8.5-6L6 6v12zM16 6v12h2V6h-2z"/></svg>
\ No newline at end of file
diff --git a/packages/ui/src/img/icons/skip_previous.svg b/packages/ui/src/img/icons/skip_previous.svg
deleted file mode 100644
index 73472726..00000000
--- a/packages/ui/src/img/icons/skip_previous.svg
+++ /dev/null
@@ -1 +0,0 @@
-<svg xmlns="http://www.w3.org/2000/svg" height="24px" viewBox="0 0 24 24" width="24px" fill="#000000"><path d="M0 0h24v24H0z" fill="none"/><path d="M6 6h2v12H6zm3.5 6l8.5 6V6z"/></svg>
\ No newline at end of file
diff --git a/packages/ui/src/img/icons/tune.svg b/packages/ui/src/img/icons/tune.svg
deleted file mode 100644
index ad36d1a7..00000000
--- a/packages/ui/src/img/icons/tune.svg
+++ /dev/null
@@ -1 +0,0 @@
-<svg xmlns="http://www.w3.org/2000/svg" height="24px" viewBox="0 0 24 24" width="24px" fill="#000000"><path d="M0 0h24v24H0z" fill="none"/><path d="M3 17v2h6v-2H3zM3 5v2h10V5H3zm10 16v-2h8v-2h-8v-2h-2v6h2zM7 9v2H3v2h4v2h2V9H7zm14 4v-2H11v2h10zm-6-4h2V7h4V5h-4V3h-2v6z"/></svg>
\ No newline at end of file
diff --git a/packages/ui/src/img/icons/unfold_more.svg b/packages/ui/src/img/icons/unfold_more.svg
deleted file mode 100644
index 57a9539c..00000000
--- a/packages/ui/src/img/icons/unfold_more.svg
+++ /dev/null
@@ -1 +0,0 @@
-<svg xmlns="http://www.w3.org/2000/svg" height="24px" viewBox="0 0 24 24" width="24px" fill="#000000"><path d="M0 0h24v24H0V0z" fill="none"/><path d="M12 5.83L15.17 9l1.41-1.41L12 3 7.41 7.59 8.83 9 12 5.83zm0 12.34L8.83 15l-1.41 1.41L12 21l4.59-4.59L15.17 15 12 18.17z"/></svg>
\ No newline at end of file
diff --git a/packages/ui/src/img/icons/video_settings.svg b/packages/ui/src/img/icons/video_settings.svg
deleted file mode 100644
index 1cd53c98..00000000
--- a/packages/ui/src/img/icons/video_settings.svg
+++ /dev/null
@@ -1 +0,0 @@
-<svg xmlns="http://www.w3.org/2000/svg" enable-background="new 0 0 24 24" height="24px" viewBox="0 0 24 24" width="24px" fill="#000000"><g><rect fill="none" height="24" width="24"/></g><g><g><path d="M3,6h18v5h2V6c0-1.1-0.9-2-2-2H3C1.9,4,1,4.9,1,6v12c0,1.1,0.9,2,2,2h9v-2H3V6z"/><polygon points="15,12 9,8 9,16"/><path d="M22.71,18.43c0.03-0.29,0.04-0.58,0.01-0.86l1.07-0.85c0.1-0.08,0.12-0.21,0.06-0.32l-1.03-1.79 c-0.06-0.11-0.19-0.15-0.31-0.11L21.23,15c-0.23-0.17-0.48-0.31-0.75-0.42l-0.2-1.36C20.26,13.09,20.16,13,20.03,13h-2.07 c-0.12,0-0.23,0.09-0.25,0.21l-0.2,1.36c-0.26,0.11-0.51,0.26-0.74,0.42l-1.28-0.5c-0.12-0.05-0.25,0-0.31,0.11l-1.03,1.79 c-0.06,0.11-0.04,0.24,0.06,0.32l1.07,0.86c-0.03,0.29-0.04,0.58-0.01,0.86l-1.07,0.85c-0.1,0.08-0.12,0.21-0.06,0.32l1.03,1.79 c0.06,0.11,0.19,0.15,0.31,0.11l1.27-0.5c0.23,0.17,0.48,0.31,0.75,0.42l0.2,1.36c0.02,0.12,0.12,0.21,0.25,0.21h2.07 c0.12,0,0.23-0.09,0.25-0.21l0.2-1.36c0.26-0.11,0.51-0.26,0.74-0.42l1.28,0.5c0.12,0.05,0.25,0,0.31-0.11l1.03-1.79 c0.06-0.11,0.04-0.24-0.06-0.32L22.71,18.43z M19,19.5c-0.83,0-1.5-0.67-1.5-1.5s0.67-1.5,1.5-1.5s1.5,0.67,1.5,1.5 S19.83,19.5,19,19.5z"/></g></g></svg>
\ No newline at end of file
diff --git a/packages/ui/src/img/icons/volume_off.svg b/packages/ui/src/img/icons/volume_off.svg
deleted file mode 100644
index 6c3d22f2..00000000
--- a/packages/ui/src/img/icons/volume_off.svg
+++ /dev/null
@@ -1 +0,0 @@
-<svg xmlns="http://www.w3.org/2000/svg" height="24px" viewBox="0 0 24 24" width="24px" fill="#000000"><path d="M0 0h24v24H0z" fill="none"/><path d="M16.5 12c0-1.77-1.02-3.29-2.5-4.03v2.21l2.45 2.45c.03-.2.05-.41.05-.63zm2.5 0c0 .94-.2 1.82-.54 2.64l1.51 1.51C20.63 14.91 21 13.5 21 12c0-4.28-2.99-7.86-7-8.77v2.06c2.89.86 5 3.54 5 6.71zM4.27 3L3 4.27 7.73 9H3v6h4l5 5v-6.73l4.25 4.25c-.67.52-1.42.93-2.25 1.18v2.06c1.38-.31 2.63-.95 3.69-1.81L19.73 21 21 19.73l-9-9L4.27 3zM12 4L9.91 6.09 12 8.18V4z"/></svg>
\ No newline at end of file
diff --git a/packages/ui/src/img/icons/volume_on.svg b/packages/ui/src/img/icons/volume_on.svg
deleted file mode 100644
index 0362732c..00000000
--- a/packages/ui/src/img/icons/volume_on.svg
+++ /dev/null
@@ -1 +0,0 @@
-<svg xmlns="http://www.w3.org/2000/svg" height="24px" viewBox="0 0 24 24" width="24px" fill="#000000"><path d="M0 0h24v24H0z" fill="none"/><path d="M3 9v6h4l5 5V4L7 9H3zm13.5 3c0-1.77-1.02-3.29-2.5-4.03v8.05c1.48-.73 2.5-2.25 2.5-4.02zM14 3.23v2.06c2.89.86 5 3.54 5 6.71s-2.11 5.85-5 6.71v2.06c4.01-.91 7-4.49 7-8.77s-2.99-7.86-7-8.77z"/></svg>
\ No newline at end of file
diff --git a/packages/ui/src/img/icons/warning.svg b/packages/ui/src/img/icons/warning.svg
deleted file mode 100644
index aa3f3ca9..00000000
--- a/packages/ui/src/img/icons/warning.svg
+++ /dev/null
@@ -1 +0,0 @@
-<svg xmlns="http://www.w3.org/2000/svg" height="24px" viewBox="0 0 24 24" width="24px" fill="#000000"><path d="M1 21h22L12 2 1 21zm12-3h-2v-2h2v2zm0-4h-2v-4h2v4z"/></svg>
\ No newline at end of file
diff --git a/packages/ui/src/index.scss b/packages/ui/src/index.scss
index 285ffbe0..d437e0b2 100644
--- a/packages/ui/src/index.scss
+++ b/packages/ui/src/index.scss
@@ -3,7 +3,6 @@
:root {
--theme: #33a6ff;
--theme-overlay: rgba(51, 166, 255, 0.24);
- --icon-color: #ffffff;
--background-color: #181818;
--background-color-dark: #141414;
--surface-color: #242424;
@@ -59,3 +58,16 @@ main {
align-items: center;
justify-content: center;
}
+
+svg {
+ display: block;
+ width: 24px;
+ height: 24px;
+}
+
+button {
+ background: none;
+ appearance: none;
+ border: 0;
+ padding: 0;
+}