mirror of
https://github.com/muerwre/vault-frontend.git
synced 2025-04-25 04:46:40 +07:00
login: made scene static
This commit is contained in:
parent
02dd66a6af
commit
b0d9e8f8ba
5 changed files with 32 additions and 12 deletions
|
@ -1,6 +1,6 @@
|
|||
import { FC, memo, useCallback, useEffect, useRef, useState } from 'react';
|
||||
|
||||
import { debounce, throttle } from 'throttle-debounce';
|
||||
import { throttle } from 'throttle-debounce';
|
||||
|
||||
import { useWindowSize } from '~/hooks/dom/useWindowSize';
|
||||
|
||||
|
@ -48,7 +48,7 @@ const layers: Layer[] = [
|
|||
},
|
||||
];
|
||||
|
||||
const LoginScene: FC<LoginSceneProps> = memo(() => {
|
||||
const LoginAnimatedScene: FC<LoginSceneProps> = memo(() => {
|
||||
const containerRef = useRef<HTMLDivElement>(null);
|
||||
const [loaded, setLoaded] = useState(false);
|
||||
const imageRefs = useRef<Array<SVGImageElement | null>>([]);
|
||||
|
@ -73,9 +73,9 @@ const LoginScene: FC<LoginSceneProps> = memo(() => {
|
|||
const target = imageRefs.current[index];
|
||||
|
||||
if (target) {
|
||||
target.style.transform = `translate(${shift *
|
||||
it.velocity *
|
||||
200}px, 0)`;
|
||||
target.style.transform = `translate(${
|
||||
shift * it.velocity * 200
|
||||
}px, 0)`;
|
||||
}
|
||||
});
|
||||
},
|
||||
|
@ -124,9 +124,9 @@ const LoginScene: FC<LoginSceneProps> = memo(() => {
|
|||
fill="url(#fallbackGradient)"
|
||||
/>
|
||||
|
||||
{layers.map(it => (
|
||||
{layers.map((it) => (
|
||||
<image
|
||||
ref={it => imageRefs.current.push(it)}
|
||||
ref={(it) => imageRefs.current.push(it)}
|
||||
key={it.src}
|
||||
href={it.src}
|
||||
width={it.width}
|
||||
|
@ -143,4 +143,4 @@ const LoginScene: FC<LoginSceneProps> = memo(() => {
|
|||
);
|
||||
});
|
||||
|
||||
export { LoginScene };
|
||||
export { LoginAnimatedScene };
|
11
src/components/auth/login/LoginStaticScene/index.tsx
Normal file
11
src/components/auth/login/LoginStaticScene/index.tsx
Normal file
|
@ -0,0 +1,11 @@
|
|||
import React, { FC } from 'react';
|
||||
|
||||
import styles from './styles.module.scss';
|
||||
|
||||
interface LoginStaticSceneProps {}
|
||||
|
||||
const LoginStaticScene: FC<LoginStaticSceneProps> = () => (
|
||||
<div className={styles.scene} />
|
||||
);
|
||||
|
||||
export { LoginStaticScene };
|
|
@ -0,0 +1,9 @@
|
|||
@import 'src/styles/mixins';
|
||||
|
||||
.scene {
|
||||
position: absolute;
|
||||
inset: 0;
|
||||
|
||||
background: url('/images/clouds.svg') no-repeat 50% 50%;
|
||||
background-size: cover;
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue