pineafan | df39fd4 | 2021-09-04 16:05:27 +0100 | [diff] [blame] | 1 | import '../styles/globals.css'; |
| 2 | import NavBar from '../Components/NavBar'; |
Skyler Turner | 16c08d3 | 2021-11-04 20:06:50 +0000 | [diff] [blame] | 3 | import { ThemeProvider } from 'theme-ui'; |
pineafan | 7bd0ad6 | 2022-10-26 22:11:29 +0100 | [diff] [blame] | 4 | import React from 'react'; |
pineafan | ff3d452 | 2022-05-06 19:51:02 +0100 | [diff] [blame] | 5 | import Styles from '../styles/globals.module.css'; |
pineafan | df39fd4 | 2021-09-04 16:05:27 +0100 | [diff] [blame] | 6 | |
Skyler Turner | 16c08d3 | 2021-11-04 20:06:50 +0000 | [diff] [blame] | 7 | const 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', |
pineafan | e0283a8 | 2022-02-13 10:05:56 +0000 | [diff] [blame] | 21 | hint: '#E4E4E4', |
| 22 | panelColor: "#F0F0F0", |
pineafan | 4627016 | 2022-02-13 12:06:17 +0000 | [diff] [blame] | 23 | fadeGradient: "rgba(240, 240, 240, 1)", |
pineafan | 7bd0ad6 | 2022-10-26 22:11:29 +0100 | [diff] [blame] | 24 | offset: "2.5px", |
pineafan | df39fd4 | 2021-09-04 16:05:27 +0100 | [diff] [blame] | 25 | |
pineafan | b18f019 | 2022-10-27 22:08:36 +0100 | [diff] [blame^] | 26 | borders: "#FFFFFF", |
| 27 | borderHint: "#E4E4E4", |
| 28 | |
Skyler Turner | 16c08d3 | 2021-11-04 20:06:50 +0000 | [diff] [blame] | 29 | 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', |
pineafan | a841c76 | 2021-11-14 21:21:04 +0000 | [diff] [blame] | 37 | cardFilter: 'brightness(0.5)', |
Skyler Turner | 16c08d3 | 2021-11-04 20:06:50 +0000 | [diff] [blame] | 38 | cardOverlay: '#42424280', |
pineafan | e0283a8 | 2022-02-13 10:05:56 +0000 | [diff] [blame] | 39 | hint: '#242424', |
pineafan | 4627016 | 2022-02-13 12:06:17 +0000 | [diff] [blame] | 40 | panelColor: "rgba(255, 255, 255, 0.05)", |
| 41 | fadeGradient: "rgba(48, 48, 48, 1)", |
pineafan | b18f019 | 2022-10-27 22:08:36 +0100 | [diff] [blame^] | 42 | offset: "-20px", |
| 43 | |
| 44 | borders: "#000000", |
| 45 | borderHint: "#424242", |
Skyler Turner | 16c08d3 | 2021-11-04 20:06:50 +0000 | [diff] [blame] | 46 | } |
| 47 | } |
| 48 | }, |
| 49 | }; |
| 50 | |
Samuel Shuert | 016ea02 | 2021-09-01 16:17:24 -0500 | [diff] [blame] | 51 | |
pineafan | a5ce910 | 2021-09-02 17:21:31 +0100 | [diff] [blame] | 52 | function App({ Component, pageProps }) { |
pineafan | b18f019 | 2022-10-27 22:08:36 +0100 | [diff] [blame^] | 53 | const [subBar, setSubBar] = React.useState(false); |
| 54 | const [currentElement, setElement] = React.useState(<></>); |
pineafan | 7bd0ad6 | 2022-10-26 22:11:29 +0100 | [diff] [blame] | 55 | |
pineafan | b18f019 | 2022-10-27 22:08:36 +0100 | [diff] [blame^] | 56 | 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 | } |
pineafan | 7bd0ad6 | 2022-10-26 22:11:29 +0100 | [diff] [blame] | 68 | |
pineafan | b18f019 | 2022-10-27 22:08:36 +0100 | [diff] [blame^] | 69 | 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 Shuert | 016ea02 | 2021-09-01 16:17:24 -0500 | [diff] [blame] | 96 | } |
| 97 | |
pineafan | a5ce910 | 2021-09-02 17:21:31 +0100 | [diff] [blame] | 98 | export default App |