diff --git a/src/components/layout/Background/FloatingBackground.tsx b/src/components/layout/Background/FloatingBackground.tsx new file mode 100644 index 000000000..83ccc4353 --- /dev/null +++ b/src/components/layout/Background/FloatingBackground.tsx @@ -0,0 +1,54 @@ +import { Box, createStyles, useMantineTheme } from '@mantine/core'; +import { useMouse, useViewportSize } from '@mantine/hooks'; + +import { PolkaElement } from './PolkaElement'; + +export const FloatingBackground = () => { + const { classes } = useStyles(); + return ( + + + + + + + + + ); +}; + +const MouseBackdrop = () => { + const { x, y } = useMouse(); + const { width, height } = useViewportSize(); + const smaller = Math.min(width, height); + const radius = Math.max(smaller - 500, 200); + return ( + + { + const dropColor = + theme.colorScheme === 'dark' + ? theme.fn.rgba(theme.colors.red[8], 0.05) + : theme.fn.rgba(theme.colors.red[2], 0.4); + const boxShadow = `0px 0px ${radius}px ${radius}px ${dropColor}`; + return { + width: 50, + height: 50, + borderRadius: '5rem', + boxShadow: boxShadow, + backgroundColor: dropColor, + }; + }} + top={y - 25} + left={x - 25} + pos="absolute" + > + + ); +}; + +const useStyles = createStyles(() => ({ + noOverflow: { + overflow: 'hidden', + }, +})); diff --git a/src/components/layout/Background/PolkaElement.tsx b/src/components/layout/Background/PolkaElement.tsx new file mode 100644 index 000000000..be6dc79db --- /dev/null +++ b/src/components/layout/Background/PolkaElement.tsx @@ -0,0 +1,32 @@ +import { Box } from '@mantine/core'; + +export const PolkaElement = ({ + rotation, + left, + top, + right, + bottom, +}: { + rotation: number; + top?: number; + left?: number; + right?: number; + bottom?: number; +}) => { + return ( + + ); +}; diff --git a/src/pages/_app.tsx b/src/pages/_app.tsx index 7703d5486..590fea91b 100644 --- a/src/pages/_app.tsx +++ b/src/pages/_app.tsx @@ -113,6 +113,7 @@ function App( }} withGlobalStyles withNormalizeCSS + withCSSVariables > diff --git a/src/pages/auth/login.tsx b/src/pages/auth/login.tsx index 356e3f817..238b37d0b 100644 --- a/src/pages/auth/login.tsx +++ b/src/pages/auth/login.tsx @@ -15,9 +15,11 @@ import { GetServerSideProps } from 'next'; import { signIn } from 'next-auth/react'; import { useTranslation } from 'next-i18next'; import Head from 'next/head'; +import Image from 'next/image'; import { useRouter } from 'next/router'; import { useState } from 'react'; import { z } from 'zod'; +import { FloatingBackground } from '~/components/layout/Background/FloatingBackground'; import { getServerAuthSession } from '~/server/auth'; import { getServerSideTranslations } from '~/tools/server/getServerSideTranslations'; import { useI18nZodResolver } from '~/utils/i18n-zod-resolver'; @@ -63,45 +65,62 @@ export default function LoginPage() { - - - {t('title')} - + + + + + ({ + color: theme.colorScheme === 'dark' ? theme.colors.gray[5] : theme.colors.dark[6], + fontSize: '4rem', + fontWeight: 800, + lineHeight: 1, + })} + align="center" + > + Homarr + + + + + {t('title')} + - - {t('text')} - + + {t('text')} + - {isError && ( - } color="red"> - {t('alert')} - - )} + {isError && ( + } color="red"> + {t('alert')} + + )} -
- - + + + - + - - - -
+ +
+ +
+
); diff --git a/src/styles/global.scss b/src/styles/global.scss index 13a8c5dda..de903142d 100644 --- a/src/styles/global.scss +++ b/src/styles/global.scss @@ -96,4 +96,12 @@ .scroll-area-w100 .mantine-ScrollArea-viewport > div:nth-of-type(1) { width: 100%; display: inherit !important; +} + +.polka { + background-image: radial-gradient( + color-mix(in srgb, var(--mantine-color-red-6) 20%, transparent) 6px, + transparent 6px + ); + background-size: 60px 60px; } \ No newline at end of file