blob: 59fdadb20cc90987c5f043fe2a6c093fe9f75148 [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',
32 background: '#252525',
33 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
pineafanb18f0192022-10-27 22:08:36 +010056 const showSubBar = (element, timeout) => {
57 setSubBar(true);
58 setElement(element);
59 if (timeout) {
60 setTimeout(() => {
61 setSubBar(false);
62 setTimeout(() => {
63 setElement(<></>);
64 }, 0.31 * 1000)
65 }, timeout * 1000)
66 }
67 }
pineafan7bd0ad62022-10-26 22:11:29 +010068
pineafanb18f0192022-10-27 22:08:36 +010069 const hideSubBar = () => {
70 setSubBar(false);
71 }
72
73 const showMessage = (text) => {
74 showSubBar(<p className={Styles.message}>{text}</p>, 5);
75 }
76
77 return <>
78 <ThemeProvider theme={theme}>
79 <NavBar
80 subBar={subBar}
81 setSubBar={setSubBar}
82 element={currentElement}
83 setElement={setElement}
84 showMessage={showMessage}
85 showSubBar={showSubBar}
86 />
87 <Component
88 {...pageProps}
89 showSubBar={showSubBar}
90 hideSubBar={hideSubBar}
91 showMessage={showMessage}
92 />
93 <div className={Styles.container} />
94 </ThemeProvider>
95 </>
Samuel Shuert016ea022021-09-01 16:17:24 -050096}
97
pineafana5ce9102021-09-02 17:21:31 +010098export default App