Skip to content

Commit 7d0c0d6

Browse files
Add Custom Loading Animation
1 parent fe2c6f6 commit 7d0c0d6

File tree

4 files changed

+797
-14
lines changed

4 files changed

+797
-14
lines changed

invokeai/frontend/web/package.json

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -86,6 +86,7 @@
8686
"react-i18next": "^14.0.5",
8787
"react-icons": "^5.0.1",
8888
"react-konva": "^18.2.10",
89+
"react-lottie": "^1.2.4",
8990
"react-redux": "9.1.0",
9091
"react-resizable-panels": "^2.0.11",
9192
"react-select": "5.8.0",
@@ -125,6 +126,7 @@
125126
"@types/node": "^20.11.20",
126127
"@types/react": "^18.2.59",
127128
"@types/react-dom": "^18.2.19",
129+
"@types/react-lottie": "^1.2.10",
128130
"@types/uuid": "^9.0.8",
129131
"@vitejs/plugin-react-swc": "^3.6.0",
130132
"concurrently": "^8.2.2",

invokeai/frontend/web/pnpm-lock.yaml

Lines changed: 44 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

invokeai/frontend/web/src/common/components/Loading/Loading.tsx

Lines changed: 15 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1,23 +1,24 @@
1-
import { Flex, Image, Spinner } from '@invoke-ai/ui-library';
2-
import InvokeLogoWhite from 'public/assets/images/invoke-symbol-wht-lrg.svg';
1+
import { Flex } from '@invoke-ai/ui-library';
2+
// import AnimatedVideoSpinner from 'public/assets/videos/LogoAnim.webm';
33
import { memo } from 'react';
4+
import Lottie from 'react-lottie';
45

5-
// This component loads before the theme so we cannot use theme tokens here
6+
import { LoadingAnimationData } from './LoadingAnimationData';
7+
8+
const options = {
9+
loop: true,
10+
autoplay: true,
11+
animationData: LoadingAnimationData,
12+
rendererSettings: {
13+
preserveAspectRatio: 'xMidYMid slice',
14+
},
15+
};
616

17+
// This component loads before the theme so we cannot use theme tokens here
718
const Loading = () => {
819
return (
920
<Flex position="relative" width="100vw" height="100vh" alignItems="center" justifyContent="center" bg="#151519">
10-
<Image src={InvokeLogoWhite} w="8rem" h="8rem" />
11-
<Spinner
12-
label="Loading"
13-
color="grey"
14-
position="absolute"
15-
size="sm"
16-
width="24px !important"
17-
height="24px !important"
18-
right="1.5rem"
19-
bottom="1.5rem"
20-
/>
21+
<Lottie options={options} width={200} height={200} />
2122
</Flex>
2223
);
2324
};

0 commit comments

Comments
 (0)