diff --git a/frontend/src/assets/Splash.png b/frontend/src/assets/Splash.png new file mode 100644 index 00000000..174f8ed9 Binary files /dev/null and b/frontend/src/assets/Splash.png differ diff --git a/frontend/src/common/components/Router/AppRouter.tsx b/frontend/src/common/components/Router/AppRouter.tsx index 01718539..ad2bc0af 100644 --- a/frontend/src/common/components/Router/AppRouter.tsx +++ b/frontend/src/common/components/Router/AppRouter.tsx @@ -11,6 +11,7 @@ import VerificationPage from 'pages/Auth/Verify/VerificationPage'; import OAuthRedirectHandler from 'pages/Auth/OAuth/OAuthRedirectHandler'; import ForgotPasswordPage from 'pages/Auth/ForgotPassword/ForgotPasswordPage'; import ResetPasswordPage from 'pages/Auth/ResetPassword/ResetPasswordPage'; +import SplashPage from 'pages/Auth/Splash/SplashPage'; /** * The application router. This is the main router for the Ionic React @@ -40,10 +41,11 @@ const AppRouter = (): JSX.Element => { } /> } /> } /> + } /> - + - } /> + } /> ); diff --git a/frontend/src/common/utils/i18n/resources/en/common.json b/frontend/src/common/utils/i18n/resources/en/common.json index df17ccd5..b8faad32 100644 --- a/frontend/src/common/utils/i18n/resources/en/common.json +++ b/frontend/src/common/utils/i18n/resources/en/common.json @@ -2,6 +2,13 @@ "app": { "name": "MEDReport AI" }, + "splash": { + "background-alt": "Application background", + "logo-alt": "MEDReport AI logo" + }, + "signin": { + "logo-alt": "MEDReport AI logo" + }, "confirm-prompt": "Are you sure?", "created": "created", "deleted": "deleted", diff --git a/frontend/src/pages/Auth/SignIn/SignInPage.scss b/frontend/src/pages/Auth/SignIn/SignInPage.scss index c20dc175..ecd90124 100644 --- a/frontend/src/pages/Auth/SignIn/SignInPage.scss +++ b/frontend/src/pages/Auth/SignIn/SignInPage.scss @@ -1,5 +1,5 @@ .ls-signin-page { - --ion-background-color: #1a233f; + --ion-background-color: transparent; &__background { width: 100%; @@ -7,7 +7,13 @@ display: flex; flex-direction: column; align-items: center; + justify-content: flex-start; padding: 2rem 1.5rem; + background-color: #1c1e2e; + background-image: url('../../../../src/assets/Splash.png'); + background-size: cover; + background-position: center; + position: relative; } &__logo-container { @@ -15,6 +21,7 @@ align-items: center; justify-content: center; margin-bottom: 2.5rem; + margin-top: 2rem; } &__logo { @@ -35,7 +42,8 @@ background-color: white; border-radius: 1.5rem; padding: 2.5rem 2rem; - box-shadow: 0 0.5rem 1.5rem rgba(0, 0, 0, 0.15); + box-shadow: 0 0.5rem 1.5rem rgb(0 0 0 / 15%); + z-index: 1; } &__header { diff --git a/frontend/src/pages/Auth/SignIn/SignInPage.tsx b/frontend/src/pages/Auth/SignIn/SignInPage.tsx index 3eb5540b..d6f12b7d 100644 --- a/frontend/src/pages/Auth/SignIn/SignInPage.tsx +++ b/frontend/src/pages/Auth/SignIn/SignInPage.tsx @@ -5,7 +5,7 @@ import './SignInPage.scss'; import { PropsWithTestId } from 'common/components/types'; import ProgressProvider from 'common/providers/ProgressProvider'; import SignInForm from './components/SignInForm'; -import logo from 'assets/logo_ls.png'; +import logo from '../../../assets/logo_ls.png'; /** * Properties for the `SignInPage` component. @@ -23,10 +23,14 @@ const SignInPage = ({ testid = 'page-signin' }: SignInPageProps): JSX.Element => return ( - +
- + {t('app.name', { ns: 'common' })}
diff --git a/frontend/src/pages/Auth/Splash/SplashPage.scss b/frontend/src/pages/Auth/Splash/SplashPage.scss new file mode 100644 index 00000000..625de3b5 --- /dev/null +++ b/frontend/src/pages/Auth/Splash/SplashPage.scss @@ -0,0 +1,57 @@ +.ls-splash-page { + --ion-background-color: transparent; + + &__container { + width: 100%; + height: 100%; + display: flex; + align-items: center; + justify-content: center; + position: relative; + overflow: hidden; + background-color: #101828; /* Dark background color as fallback */ + } + + &__background { + position: absolute; + top: 0; + left: 0; + width: 100%; + height: 100%; + object-fit: cover; + z-index: 0; + } + + &__logo-container { + display: flex; + flex-direction: column; + align-items: center; + justify-content: center; + z-index: 2; /* Increased z-index to appear above the overlay */ + padding: 2rem; + animation: fade-in 1s ease-in; + } + + &__logo { + width: 120px; + height: auto; + margin-bottom: 1rem; + } + + &__app-name { + color: white; + font-size: 2rem; + font-weight: 600; + text-align: center; + } +} + +@keyframes fade-in { + from { + opacity: 0; + } + + to { + opacity: 1; + } +} diff --git a/frontend/src/pages/Auth/Splash/SplashPage.tsx b/frontend/src/pages/Auth/Splash/SplashPage.tsx new file mode 100644 index 00000000..32499269 --- /dev/null +++ b/frontend/src/pages/Auth/Splash/SplashPage.tsx @@ -0,0 +1,51 @@ +import { IonContent, IonPage } from '@ionic/react'; +import { useEffect } from 'react'; +import { useIonRouter } from '@ionic/react'; +import { useTranslation } from 'react-i18next'; + +import './SplashPage.scss'; +import splashBg from '../../../../src/assets/Splash.png'; +import { PropsWithTestId } from 'common/components/types'; + +/** + * Properties for the `SplashPage` component. + */ +interface SplashPageProps extends PropsWithTestId {} + +/** + * The `SplashPage` renders the initial splash screen with the app logo. + * It automatically redirects to the login page after a short delay. + * + * @param {SplashPageProps} props - Component properties. + * @returns {JSX.Element} JSX + */ +const SplashPage = ({ testid = 'page-splash' }: SplashPageProps): JSX.Element => { + const router = useIonRouter(); + const { t } = useTranslation(); + + useEffect(() => { + // Redirect to login page after a delay + const timer = setTimeout(() => { + router.push('/auth/signin', 'forward', 'replace'); + }, 2000); + + return () => clearTimeout(timer); + }, [router]); + + return ( + + +
+ {t('splash.background-alt', +
+
+
+
+ ); +}; + +export default SplashPage; diff --git a/frontend/src/theme/theme-overrides.css b/frontend/src/theme/theme-overrides.css index dd476a9a..888dfe5e 100644 --- a/frontend/src/theme/theme-overrides.css +++ b/frontend/src/theme/theme-overrides.css @@ -64,8 +64,7 @@ ion-content { /* Background for the entire app */ body, -ion-app, -ion-content { +ion-app { background: url('../assets/Reports_bg.png') no-repeat center center fixed !important; background-size: cover !important; }