Skip to content

Commit

Permalink
cool bg added
Browse files Browse the repository at this point in the history
  • Loading branch information
Zain-ul-din committed Jun 10, 2023
1 parent f24949c commit 31e500e
Show file tree
Hide file tree
Showing 5 changed files with 71 additions and 1 deletion.
12 changes: 12 additions & 0 deletions public/images/gradient-left-dark.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
20 changes: 20 additions & 0 deletions public/images/gradient-right-dark.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
36 changes: 36 additions & 0 deletions src/components/BgGlow.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
import { Flex, useMediaQuery } from "@chakra-ui/react";

export default function BgGlow () {

const [isUnder100] = useMediaQuery("(max-width: 100px");

if (isUnder100) return <></>

return <>

{/*eslint-disable-next-line @next/next/no-img-element */}
<img src="/images/gradient-left-dark.svg" alt="gradient_img_left"
style={{
position: 'fixed',
top: "0%",
left: "-10%",
right: "-50%",
bottom: '0%',
zIndex: -10,
opacity: '80%'
}}
/>

{/*eslint-disable-next-line @next/next/no-img-element */}
<img src="/images/gradient-right-dark.svg" alt="gradient_img_right"
style={{
position: 'fixed',
top: "-50%",
right: "-50%",
zIndex: -10,
opacity: '60%'
}}
/>
</>
}

2 changes: 2 additions & 0 deletions src/pages/_app.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ import { UserCredentialsContext } from '~/hooks/UserCredentialsContext';
import { useUserCredentials } from '~/hooks/hooks';
import { AppStyleProvider, appTheme } from '~/styles/Style';
import { useRouter } from 'next/router';
import BgGlow from '~/components/BgGlow';

const footerPages = ['/', '/contribute', '/developer', '/notifications', '/freeclassrooms'];

Expand All @@ -34,6 +35,7 @@ export default function App({ Component, pageProps }: AppProps) {
<>
<TimeTableInputContext.Provider value={{ timeTableInput, setTimeTableInput }}>
<UserCredentialsContext.Provider value={{ user, setUser }}>
<BgGlow />
<NextNProgress color="var(--loader-color)" />
<AppStyleProvider theme={appTheme}>
<DarkTheme />
Expand Down
2 changes: 1 addition & 1 deletion src/styles/globals.css
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@
--violet: rgb(103, 58, 183);
--pink: rgb(244, 143, 177);

--bg-color: rgb(20, 20, 20);
--bg-color: rgba(20, 20, 20, 0);

--card-color: rgb(255, 255, 255, 0.02);
--card-color-dark: rgb(255, 255, 255, 0.09);
Expand Down

1 comment on commit 31e500e

@vercel
Copy link

@vercel vercel bot commented on 31e500e Jun 10, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please sign in to comment.