From 644950510604a5e043799d5dca666b7aedabdae8 Mon Sep 17 00:00:00 2001 From: Akhmad Najmuddin Date: Mon, 12 Dec 2022 23:49:37 +0700 Subject: [PATCH] Improve loading page --- Types.d.ts | 5 ++ package.json | 2 +- packages/renderer/src/assets/128x128.png | Bin 0 -> 9334 bytes .../renderer/src/components/Layout/Layout.tsx | 3 +- .../src/components/Loading/Loading.module.css | 50 ++++++++++++++++++ .../src/components/Loading/Loading.tsx | 14 +++++ .../renderer/src/components/Loading/index.ts | 1 + packages/renderer/src/index.css | 34 ++++++------ 8 files changed, 90 insertions(+), 19 deletions(-) create mode 100644 packages/renderer/src/assets/128x128.png create mode 100644 packages/renderer/src/components/Loading/Loading.module.css create mode 100644 packages/renderer/src/components/Loading/Loading.tsx create mode 100644 packages/renderer/src/components/Loading/index.ts diff --git a/Types.d.ts b/Types.d.ts index 42ccefe..ceb8ddf 100644 --- a/Types.d.ts +++ b/Types.d.ts @@ -1,5 +1,10 @@ declare module '*.module.css' +declare module '*.png' { + const value: any + export = value +} + interface ObjectConstructor { typedKeys(obj: T): Array } diff --git a/package.json b/package.json index bf8d0a1..30b3796 100644 --- a/package.json +++ b/package.json @@ -1,7 +1,7 @@ { "name": "my-personal-list", "description": "My personal anime tracking list", - "version": "2.1.2", + "version": "2.2.0", "scripts": { "start": "concurrently \"yarn start:renderer\" \"yarn start:main\" --kill-others", "start:main": "tsc && electron .", diff --git a/packages/renderer/src/assets/128x128.png b/packages/renderer/src/assets/128x128.png new file mode 100644 index 0000000000000000000000000000000000000000..84ab567167a32e3fc4805a3fd7600255bd2e05c6 GIT binary patch literal 9334 zcmaiacT|&Kvu@}?AcP)zl`ar^ZwXDRfP(a@(n|mp={0mvkS@I|MLI|?0R#jUkzNFe zbOZ#c=jHd^@7(X6b=JCnB!RV(+0UNYGxO|c-WUTt4YFGdw?H5enU*Hf5cmwad4UOm z_dZ42k0212f)-N6_!-Vl&vT0@-%h3d>GMN{4bKPCM38p2xUevi@)pGEOY=C#Y$x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NlOz+(-j!}+9R6?Am+O9@O~c+voJ3rxllJ zSoRuBB*4APd4~W#k7H`Ssf=XfumBWN;Jya%Fkt)_Y)@VI@-qdXj8PC%0dq_Lkw;Dq zK>W$)l6FQGN6>l^5fQ0(tUKrHyw~r}gCiJqDvU)-4Cx)}Ox2x^*`4ZHN6f^%u6|Hu zvQbTF0|Umdmhy>bzrTo>&=r*IasZkabVU@GLWt8RDI8@n*dvo~;A{(KB?P*ysy&7c z;P3!jz}{)D>I-~wXijtzbdYBbT!;b^)KNlwd=(PH!utJWNEn+c0zvbjN@CuPtQLF5f|uOfD&#oR zKgRX;^|^Fd)zp`k65i`zmu0Ci*oXx{ea47mEsJ#2vyZE1tlfxe%%nyS22l++;IaOK0ZEA&_h`7 z)?QEqoEtxSATcJ60S;FLly^}+!f6FJCJ)$=~WhMR4GVtoj zL&W`iG8=ZB6jSg)9Z=Tlj~{Y^v~gwC)etGFUfoy}BvLhWr7xNUc$6b{e%>O1H`c#q znsG>m96z5Z|Gv|)f8fxB&2>IFoVy!ab0Af@em5acXO}0PFBP|Y#Y?7xCB1LQ`#V#U zWc|YI?8LWk#&h$t1~b@(W^+&jUM=+AD>m>LNbu_FN-_!a1DM57<^}$F2&HgWk6=xS zh`|3kJuNognm^^d4iu;$?^cUne(m>jP&6AB#L76z<1%zuQHwztx|ku7ZnAEIZWSbR zd>tgbXSvo?P!C{(uZJBLCngN6Oij@$QYlAAJ`s_TDL{D`d!vwjn~MwRJtFMV(x%{B zw?oM&KMl%nJopLCjx1y=^?9CZNmNw DO|DxC literal 0 HcmV?d00001 diff --git a/packages/renderer/src/components/Layout/Layout.tsx b/packages/renderer/src/components/Layout/Layout.tsx index bbe5f83..8c7dac6 100644 --- a/packages/renderer/src/components/Layout/Layout.tsx +++ b/packages/renderer/src/components/Layout/Layout.tsx @@ -1,5 +1,6 @@ import React from 'react' +import Loading from '../Loading' import Navigation from '../Navigation' import styles from './Layout.module.css' @@ -7,7 +8,7 @@ type Props = { children?: React.ReactNode } const Layout: React.FC = ({ children }) => (
- Loading...
}> + }>
{children}
diff --git a/packages/renderer/src/components/Loading/Loading.module.css b/packages/renderer/src/components/Loading/Loading.module.css new file mode 100644 index 0000000..07cce67 --- /dev/null +++ b/packages/renderer/src/components/Loading/Loading.module.css @@ -0,0 +1,50 @@ +.loading { + position: absolute; + top: 0; + left: 0; + right: 0; + bottom: 0; + display: flex; + align-items: center; + justify-content: center; + background-color: var(--background); +} + +.loading .center { + position: relative; +} + +.loading .center img { + display: block; + position: relative; + z-index: 1; +} + +.loading .center .ripple { + position: absolute; + top: 50%; + left: 50%; + transform: translate(-50%, -50%); + width: 50px; + height: 50px; + background-color: var(--background-light); + border-radius: 200px; + animation-name: ripple; + animation-duration: 2s; + animation-iteration-count: infinite; + animation-timing-function: ease-in-out; +} + +@keyframes ripple { + 0% { + width: 50px; + height: 50px; + opacity: 3; + } + + 100% { + width: 175px; + height: 175px; + opacity: 0; + } +} diff --git a/packages/renderer/src/components/Loading/Loading.tsx b/packages/renderer/src/components/Loading/Loading.tsx new file mode 100644 index 0000000..72669dd --- /dev/null +++ b/packages/renderer/src/components/Loading/Loading.tsx @@ -0,0 +1,14 @@ +import React from 'react' +import icon from '@/assets/128x128.png' +import styles from './Loading.module.css' + +const Loading: React.FC = () => ( +
+
+ Loading +
+
+
+) + +export default Loading diff --git a/packages/renderer/src/components/Loading/index.ts b/packages/renderer/src/components/Loading/index.ts new file mode 100644 index 0000000..c81dfe7 --- /dev/null +++ b/packages/renderer/src/components/Loading/index.ts @@ -0,0 +1 @@ +export { default } from './Loading' diff --git a/packages/renderer/src/index.css b/packages/renderer/src/index.css index 6fd8076..226c7b7 100644 --- a/packages/renderer/src/index.css +++ b/packages/renderer/src/index.css @@ -9,15 +9,15 @@ /* foreground is for: contrast buttons */ :root { - --background: #fff; - --background-secondary: #ddd; - --background-light: rgba(0, 0, 0, 0.075); - --border: rgba(0, 0, 0, 0.15); + --background: #25292d; + --background-secondary: #191c1f; + --background-light: rgba(255, 255, 255, 0.1); + --border: rgba(255, 255, 255, 0.15); - --foreground: #1b262c; - --text-primary: #1b262c; - --text-secondary: rgba(0, 0, 0, 0.65); - --text-contrast: #fff; + --foreground: #fff; + --text-primary: #fff; + --text-secondary: rgba(255, 255, 255, 0.65); + --text-contrast: #1b262c; --color-primary: #2f80ed; --color-green: rgba(33, 150, 83); @@ -30,16 +30,16 @@ --border-radius: 2px; } -[data-theme='dark'] { - --background: #25292d; - --background-secondary: #191c1f; - --background-light: rgba(255, 255, 255, 0.1); - --border: rgba(255, 255, 255, 0.15); +[data-theme='light'] { + --background: #fff; + --background-secondary: #ddd; + --background-light: rgba(0, 0, 0, 0.075); + --border: rgba(0, 0, 0, 0.15); - --foreground: #fff; - --text-primary: #fff; - --text-secondary: rgba(255, 255, 255, 0.65); - --text-contrast: #1b262c; + --foreground: #1b262c; + --text-primary: #1b262c; + --text-secondary: rgba(0, 0, 0, 0.65); + --text-contrast: #fff; } body {