Skip to content

Commit e9ee772

Browse files
committed
login: animate login page, fix vo index #508
1 parent 8241852 commit e9ee772

File tree

5 files changed

+124
-6
lines changed

5 files changed

+124
-6
lines changed

package-lock.json

+103-2
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

+1
Original file line numberDiff line numberDiff line change
@@ -53,6 +53,7 @@
5353
"flowbite-datepicker": "^1.2.2",
5454
"inversify": "^6.0.1",
5555
"iron-session": "^6.3.1",
56+
"motion": "^12.0.1",
5657
"ndjson": "^2.0.0",
5758
"next": "^13.5.6",
5859
"react": "18.2.0",

public/rucio-logo.png

23.5 KB
Loading

src/component-library/pages/legacy/Login/Login.tsx

+19-3
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,8 @@ import { H2 } from '../../../atoms/legacy/text/headings/H2/H2';
1717
import { P } from '../../../atoms/legacy/text/content/P/P';
1818
import { HiArrowRight } from 'react-icons/hi';
1919
import Link from 'next/link';
20+
import Image from 'next/image';
21+
import { motion } from 'motion/react';
2022

2123
const BackToDashboardButton = (props: { account: string }) => {
2224
return (
@@ -103,7 +105,7 @@ export const Login = ({
103105
const isLoggedIn = loginViewModel.isLoggedIn && loginViewModel.accountActive !== undefined;
104106
const [showUserPassLoginForm, setShowUserPassLoginForm] = useState<boolean>(false);
105107

106-
const [selectedVOTab, setSelectedVOTab] = useState<number>(1);
108+
const [selectedVOTab, setSelectedVOTab] = useState<number>(0);
107109

108110
const [username, setUsername] = useState<string>('');
109111
const [password, setPassword] = useState<string>('');
@@ -163,8 +165,19 @@ export const Login = ({
163165
}
164166
}, [loginViewModel, authViewModel]);
165167

168+
const logoVariants = {
169+
hidden: { opacity: 0, scale: 0.8 },
170+
visible: { opacity: 1, scale: 1, transition: { duration: 0.5 } },
171+
};
172+
173+
const formVariants = {
174+
hidden: { opacity: 0, scale: 1.5 },
175+
visible: { opacity: 1, scale: 1, transition: { duration: 0.5 } },
176+
};
177+
166178
const getLoginForm = () => {
167179
return (
180+
<motion.div initial="hidden" animate="visible" variants={formVariants}>
168181
<div
169182
className={twMerge(
170183
'border dark:border-2 rounded-xl p-6 flex flex-col justify-center space-y-4',
@@ -187,8 +200,10 @@ export const Login = ({
187200
}}
188201
/>
189202
</Collapsible>
190-
<div className="text-center text-text-1000 dark:text-text-0">
191-
<H1 className="mt-4 mb-2">Rucio Login</H1>
203+
<div className="flex flex-col items-center justify-between w-64 text-center text-text-1000 dark:text-text-0">
204+
<motion.div initial="hidden" animate="visible" variants={logoVariants}>
205+
<Image src="/rucio-logo.png" alt="Rucio Logo" width={146} height={176} />
206+
</motion.div>
192207
</div>
193208

194209
<div
@@ -283,6 +298,7 @@ export const Login = ({
283298
</div>
284299
</div>
285300
</div>
301+
</motion.div>
286302
);
287303
};
288304

src/middleware.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ export const config = {
1919
* - _next/image (image optimization files)
2020
* - favicon.ico (favicon file)
2121
*/
22-
'/((?!api/auth|_next/static|_next/image|favicon.ico|auth/.*).*)',
22+
'/((?!api/auth|_next/static|_next/image|.*\\.png$|.*\\.jpg$|favicon.ico|auth/.*).*)',
2323
],
2424
};
2525

0 commit comments

Comments
 (0)