blob: a94db648fdd2c0a8714d5d5efe5ffdb2bcab9c3b [file] [log] [blame]
pineafandf39fd42021-09-04 16:05:27 +01001import '../styles/globals.css';
2import NavBar from '../Components/NavBar';
Skyler Turner16c08d32021-11-04 20:06:50 +00003import { ThemeProvider } from 'theme-ui';
pineafan7bd0ad62022-10-26 22:11:29 +01004import React from 'react';
pineafanff3d4522022-05-06 19:51:02 +01005import Styles from '../styles/globals.module.css';
pineafandf39fd42021-09-04 16:05:27 +01006
Skyler Turner16c08d32021-11-04 20:06:50 +00007const theme = {
8 config: {
9 useColorSchemeMediaQuery: true,
10 initialColorModeName: 'light',
11 },
12 colors: {
13 text: '#424242',
14 background: '#ffffff',
15 primary: '#6576CC',
16 cardText: '#ffffff',
17 cardBackground: 'rgba(255, 255, 255, 0.65)',
18 cardBorder: '#C4C4C4',
19 cardFilter: 'rgba(0, 0, 0, 0)',
20 cardOverlay: '#00000080',
pineafane0283a82022-02-13 10:05:56 +000021 hint: '#E4E4E4',
22 panelColor: "#F0F0F0",
pineafan46270162022-02-13 12:06:17 +000023 fadeGradient: "rgba(240, 240, 240, 1)",
pineafan7bd0ad62022-10-26 22:11:29 +010024 offset: "2.5px",
pineafandf39fd42021-09-04 16:05:27 +010025
pineafanb18f0192022-10-27 22:08:36 +010026 borders: "#FFFFFF",
27 borderHint: "#E4E4E4",
28
Skyler Turner16c08d32021-11-04 20:06:50 +000029 modes: {
30 dark: {
31 text: '#ffffff',
pineafan74f16742022-11-07 21:57:55 +000032 background: '#000000',
Skyler Turner16c08d32021-11-04 20:06:50 +000033 primary: '#6576CC',
34 cardText: '#424242',
35 cardBackground: 'rgba(0, 0, 0, 0.65)',
36 cardBorder: '#424242',
pineafana841c762021-11-14 21:21:04 +000037 cardFilter: 'brightness(0.5)',
Skyler Turner16c08d32021-11-04 20:06:50 +000038 cardOverlay: '#42424280',
pineafane0283a82022-02-13 10:05:56 +000039 hint: '#242424',
pineafan46270162022-02-13 12:06:17 +000040 panelColor: "rgba(255, 255, 255, 0.05)",
41 fadeGradient: "rgba(48, 48, 48, 1)",
pineafanb18f0192022-10-27 22:08:36 +010042 offset: "-20px",
43
44 borders: "#000000",
45 borderHint: "#424242",
Skyler Turner16c08d32021-11-04 20:06:50 +000046 }
47 }
48 },
49};
50
Samuel Shuert016ea022021-09-01 16:17:24 -050051
pineafana5ce9102021-09-02 17:21:31 +010052function App({ Component, pageProps }) {
pineafanb18f0192022-10-27 22:08:36 +010053 const [subBar, setSubBar] = React.useState(false);
54 const [currentElement, setElement] = React.useState(<></>);
pineafan7bd0ad62022-10-26 22:11:29 +010055
pineafanb7c79742022-11-06 18:08:36 +000056 const showSubBar = (element, timeout, positioning="left") => {
pineafanb18f0192022-10-27 22:08:36 +010057 setSubBar(true);
pineafanb7c79742022-11-06 18:08:36 +000058 if (positioning === "center") {
59 element = <div className={Styles.centeredSubBar}>{element}</div>
60 }
pineafanb18f0192022-10-27 22:08:36 +010061 setElement(element);
62 if (timeout) {
63 setTimeout(() => {
64 setSubBar(false);
65 setTimeout(() => {
66 setElement(<></>);
67 }, 0.31 * 1000)
68 }, timeout * 1000)
69 }
70 }
pineafan7bd0ad62022-10-26 22:11:29 +010071
pineafanb18f0192022-10-27 22:08:36 +010072 const hideSubBar = () => {
73 setSubBar(false);
74 }
75
pineafanb7c79742022-11-06 18:08:36 +000076 const showMessage = (text, positioning="left") => {
77 showSubBar(<p className={Styles.message}>{text}</p>, 5, positioning);
pineafanb18f0192022-10-27 22:08:36 +010078 }
79
80 return <>
81 <ThemeProvider theme={theme}>
82 <NavBar
83 subBar={subBar}
84 setSubBar={setSubBar}
85 element={currentElement}
86 setElement={setElement}
87 showMessage={showMessage}
88 showSubBar={showSubBar}
89 />
90 <Component
91 {...pageProps}
92 showSubBar={showSubBar}
93 hideSubBar={hideSubBar}
94 showMessage={showMessage}
95 />
96 <div className={Styles.container} />
97 </ThemeProvider>
98 </>
Samuel Shuert016ea022021-09-01 16:17:24 -050099}
100
pineafana5ce9102021-09-02 17:21:31 +0100101export default App