Skip to content

Commit fce136f

Browse files
Add Custom Loading Animation
1 parent fe2c6f6 commit fce136f

File tree

5 files changed

+933
-15
lines changed

5 files changed

+933
-15
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/public/locales/en.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -116,6 +116,7 @@
116116
"imagePrompt": "Image Prompt",
117117
"imageFailedToLoad": "Unable to Load Image",
118118
"img2img": "Image To Image",
119+
"initializingInvokeAI": "Initializing Invoke AI ...",
119120
"inpaint": "inpaint",
120121
"input": "Input",
121122
"installed": "Installed",

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

Lines changed: 30 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -1,23 +1,38 @@
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, Text } from '@invoke-ai/ui-library';
2+
// import AnimatedVideoSpinner from 'public/assets/videos/LogoAnim.webm';
33
import { memo } from 'react';
4+
import { useTranslation } from 'react-i18next';
5+
import type { Options } from 'react-lottie';
6+
import Lottie from 'react-lottie';
47

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

19+
// This component loads before the theme so we cannot use theme tokens here
720
const Loading = () => {
21+
const { t } = useTranslation();
822
return (
9-
<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-
/>
23+
<Flex
24+
position="relative"
25+
flexDir="column"
26+
width="100vw"
27+
height="100vh"
28+
alignItems="center"
29+
justifyContent="center"
30+
bg="#151519"
31+
>
32+
<Lottie options={options} width={200} height={200} />
33+
<Text color="#535a65" fontFamily="sans-serif" fontSize="small" fontWeight={600}>
34+
{t('common.initializingInvokeAI')}
35+
</Text>
2136
</Flex>
2237
);
2338
};

0 commit comments

Comments
 (0)