From 3054c01f0f09e9aa59385366ac275baa069b022d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Daniel=20Hern=C3=A1ndez=20Alcojor?= Date: Thu, 11 Jul 2024 14:09:38 +0200 Subject: [PATCH] feat: Loading animation --- public/plane.svg | 1 + src/pages/admin/index.module.css | 13 +++++++++++++ src/pages/admin/index.tsx | 4 +++- 3 files changed, 17 insertions(+), 1 deletion(-) create mode 100644 public/plane.svg create mode 100644 src/pages/admin/index.module.css diff --git a/public/plane.svg b/public/plane.svg new file mode 100644 index 0000000..63773b8 --- /dev/null +++ b/public/plane.svg @@ -0,0 +1 @@ + diff --git a/src/pages/admin/index.module.css b/src/pages/admin/index.module.css new file mode 100644 index 0000000..eab5356 --- /dev/null +++ b/src/pages/admin/index.module.css @@ -0,0 +1,13 @@ +.loading { + animation: loading-plane 5s infinite; +} + +@keyframes loading-plane { + from { + transform: translateX(0); + } + + to { + transform: translateX(calc(1200px - 1em)); + } +} diff --git a/src/pages/admin/index.tsx b/src/pages/admin/index.tsx index e56298f..e31874a 100644 --- a/src/pages/admin/index.tsx +++ b/src/pages/admin/index.tsx @@ -4,6 +4,7 @@ import { FormEvent, useEffect, useState } from 'react'; import { useLocalStorage } from 'usehooks-ts'; import { LocalStorageImgUrls, Profile } from '@/types'; import { addUrl } from '@/utils'; +import styles from './index.module.css'; function getPrompt(profileKey: Profile, destination: string): string { const profile = PROFILES[profileKey]; @@ -110,8 +111,9 @@ const AdminPage = () => {
{loading && ( -
+

Generando imagen...

+ AviĆ³n
)} {generatedImgUrl && (