diff --git a/.vscode/settings.json b/.vscode/settings.json index e6ca1e7..492f59f 100644 --- a/.vscode/settings.json +++ b/.vscode/settings.json @@ -2,6 +2,7 @@ "typescript.tsdk": "node_modules\\typescript\\lib", "typescript.enablePromptUseWorkspaceTsdk": true, "cSpell.words": [ + "atrule", "BCDR", "configparser", "DDTHH", diff --git a/src/app/components/NavBar.module.css b/src/app/components/NavBar.module.css index 7c79e0b..fe814d2 100644 --- a/src/app/components/NavBar.module.css +++ b/src/app/components/NavBar.module.css @@ -76,7 +76,7 @@ .dropdownSelect { color: #64adac; - background-color: #05254a; + background-color: inherit; border: none; border-radius: 5px; cursor: pointer; @@ -90,7 +90,6 @@ } .selectItem { - background-color: #05254a; color: #64adac; cursor: pointer; font-weight: bold; diff --git a/src/app/page.module.css b/src/app/components/Page.module.css similarity index 76% rename from src/app/page.module.css rename to src/app/components/Page.module.css index ceb333a..4a153fd 100644 --- a/src/app/page.module.css +++ b/src/app/components/Page.module.css @@ -1,3 +1,8 @@ +.wrapper { + display: flex; + width: 100%; +} + .container { display: flex; width: 100%; @@ -6,10 +11,4 @@ align-items: center; margin: 0 auto; overflow-y: auto; -} - -.divider { - width: 100%; - height: 1px; - background-color: #848586; } \ No newline at end of file diff --git a/src/app/components/Page.tsx b/src/app/components/Page.tsx new file mode 100644 index 0000000..bd5c5b4 --- /dev/null +++ b/src/app/components/Page.tsx @@ -0,0 +1,29 @@ +'use client'; + +import { themes, useThemeContext } from '../theme'; +import { DocSection, DocsStructure } from '../types/types'; +import Main from './Main'; +import NavBar from './NavBar'; +import styles from './Page.module.css'; +import SideBar from './SideBar'; + +export default function Page({ + version, + versionSections, +}: { + version: DocsStructure; + versionSections: DocSection[]; +}) { + const { theme } = useThemeContext(); + const themeStyles = themes[theme]; + + return ( +
+ +
+ +
+
+
+ ); +} diff --git a/src/app/components/SideBar.module.css b/src/app/components/SideBar.module.css index 189d3b5..b2107f2 100644 --- a/src/app/components/SideBar.module.css +++ b/src/app/components/SideBar.module.css @@ -3,9 +3,9 @@ flex-direction: column; height: 100%; border-right: 1px solid #848586; - padding: 1rem; + padding: 0 1rem; overflow: auto; - scrollbar-color: transparent #0b3766; + background-color: inherit; } @media screen and (max-width: 1000px) { @@ -14,27 +14,20 @@ } } -.container::-webkit-scrollbar { - background-color: transparent; -} - -.container::-webkit-scrollbar-thumb { - background-color: transparent; - border-radius: 10px; -} - -.container:hover::-webkit-scrollbar-thumb { - background-color: #0b3766; -} - -.container::-webkit-scrollbar-corner { - background-color: transparent; -} - .link { text-decoration: none; } +.titleContainer { + position: sticky; + top: 0; + display: flex; + align-items: center; + justify-content: space-between; + background-color: inherit; + padding-top: 1rem; +} + .title { font-size: 1rem; white-space: nowrap; @@ -43,7 +36,6 @@ .onspring { font-weight: bold; - color: white; } .api { @@ -73,11 +65,10 @@ .link, .activeLink { text-decoration: none; - color: #a3acb9; } .link:hover { - color: white; + color: #64adac; } .activeLink { @@ -100,4 +91,65 @@ .chevron { margin-left: 0.5rem; +} + +.switch { + position: relative; + display: inline-block; + width: 60px; + height: 20px; + margin-bottom: 1rem; +} + +.switch input { + opacity: 0; + width: 0; + height: 0; +} + +.slider { + position: absolute; + cursor: pointer; + top: 0; + left: 0; + right: 0; + bottom: 0; + background-color: #ccc; + -webkit-transition: .4s; + transition: .4s; +} + +.slider:before { + text-align: center; + position: absolute; + content: ""; + height: 12px; + width: 12px; + left: 4px; + bottom: 4px; + background-color: white; + -webkit-transition: .4s; + transition: .4s; +} + +input:checked+.slider { + background-color: #05254a; +} + +input:focus+.slider { + box-shadow: 0 0 1px #05254a; +} + +input:checked+.slider:before { + -webkit-transform: translateX(40px); + -ms-transform: translateX(40px); + transform: translateX(40px); +} + +.slider.round { + border-radius: 34px; +} + +.slider.round:before { + border-radius: 50%; } \ No newline at end of file diff --git a/src/app/components/SideBar.tsx b/src/app/components/SideBar.tsx index a98d27c..215636c 100644 --- a/src/app/components/SideBar.tsx +++ b/src/app/components/SideBar.tsx @@ -97,7 +97,7 @@ export default function SideBar({ return (
-
+

@@ -106,14 +106,17 @@ export default function SideBar({ API

-
diff --git a/src/app/globals.css b/src/app/globals.css index 0516cd9..286ae69 100644 --- a/src/app/globals.css +++ b/src/app/globals.css @@ -15,15 +15,10 @@ body { font-family: 'Roboto', sans-serif; font-size: 16px; line-height: 1.5; - color: white; - background-color: #05254a; display: flex; } -.container { - display: flex; - flex-direction: column; - height: 100%; - width: 100%; - min-width: 0; +a { + text-decoration: none; + color: inherit; } \ No newline at end of file diff --git a/src/app/page.tsx b/src/app/page.tsx index 73beb79..5498746 100644 --- a/src/app/page.tsx +++ b/src/app/page.tsx @@ -1,22 +1,17 @@ import { versionTwo } from '@/docs/version_002/docsStructure'; -import Main from './components/Main'; -import NavBar from './components/NavBar'; -import SideBar from './components/SideBar'; +import Page from './components/Page'; import { loadSections } from './lib/markdoc'; -export default function Page() { +export default function VersionTwo() { const versionTwoSections = loadSections( versionTwo.version, versionTwo.docs ); return ( - <> - -
- -
-
- + ); } diff --git a/src/app/theme.tsx b/src/app/theme.tsx index df299ce..2fc2820 100644 --- a/src/app/theme.tsx +++ b/src/app/theme.tsx @@ -7,8 +7,6 @@ import { useState, } from 'react'; -const ThemeContext = createContext({}); - const darkTheme = { color: 'white', backgroundColor: '#05254a', @@ -19,17 +17,14 @@ const lightTheme = { backgroundColor: 'white', }; -export const themes = { - dark: darkTheme, - light: lightTheme, -} as { [key: string]: { [key: string]: string } }; +const ThemeContext = createContext({}); export const ThemeContextProvider = ({ children, }: { children: ReactNode; }) => { - const [theme, setTheme] = useState('light'); + const [theme, setTheme] = useState('dark'); return ( @@ -38,5 +33,10 @@ export const ThemeContextProvider = ({ ); }; +export const themes = { + dark: darkTheme, + light: lightTheme, +} as { [key: string]: { [key: string]: string } }; + export const useThemeContext: any = () => useContext(ThemeContext); diff --git a/src/app/version-1/page.tsx b/src/app/version-1/page.tsx index 1634bb5..db24e49 100644 --- a/src/app/version-1/page.tsx +++ b/src/app/version-1/page.tsx @@ -1,22 +1,17 @@ import { versionOne } from '@/docs/version_001/docsStructure'; -import Main from '../components/Main'; -import NavBar from '../components/NavBar'; -import SideBar from '../components/SideBar'; +import Page from '../components/Page'; import { loadSections } from '../lib/markdoc'; -export default function Page() { +export default function VersionOne() { const versionOneSections = loadSections( versionOne.version, versionOne.docs ); return ( - <> - -
- -
-
- + ); }