From 6ee2f0443fc2c873b1fe64730f03c3ae45cb77c0 Mon Sep 17 00:00:00 2001 From: developomp Date: Mon, 31 May 2021 14:38:58 +0900 Subject: [PATCH] added larg screen support --- source/src/App.tsx | 1 + source/src/components/Navbar.tsx | 81 +++++++++++++++++++------------- source/src/theming.ts | 1 + 3 files changed, 50 insertions(+), 33 deletions(-) diff --git a/source/src/App.tsx b/source/src/App.tsx index 47826af..11f5dbe 100644 --- a/source/src/App.tsx +++ b/source/src/App.tsx @@ -65,6 +65,7 @@ body::-webkit-scrollbar-thumb { display:inline-block; flex: 1 1 auto; margin-bottom: 3rem; + margin-top: 3rem; } code { diff --git a/source/src/components/Navbar.tsx b/source/src/components/Navbar.tsx index 494408e..4a4ce99 100644 --- a/source/src/components/Navbar.tsx +++ b/source/src/components/Navbar.tsx @@ -14,11 +14,8 @@ import Sidebar from "./Sidebar" import ThemeToggleButton from "./ThemeToggleButton" const StyledNav = styled.nav` - display: flex; - align-items: center; - height: 2rem; - margin: 0; - padding: 1rem; + position: absolute; + width: 100%; background-color: ${(props) => theming.theme(props.theme.currentTheme, { light: theming.light.backgroundColor0, @@ -29,8 +26,22 @@ const StyledNav = styled.nav` light: theming.light.color0, dark: theming.dark.color0, })}; +` + +const StyledContainer = styled.div` + margin: 0 auto; + align-items: center; + display: flex; + height: 2rem; + padding: 1rem; box-shadow: 0 4px 10px rgb(0 0 0 / 5%); + /* 20px is for scrollbar */ + @media only screen and (min-width: calc(${theming.size + .screen_size2} + 20px)) { + width: calc(${theming.size.screen_size2} - 20px); + } + .right { margin-left: auto; } @@ -59,37 +70,41 @@ export default class Navbar extends React.Component { render() { return ( - - - - - {NavbarData.map((item, index) => ( - - {item.title} - - ))} - + + + + + + {NavbarData.map((item, index) => ( + + {item.title} + + ))} + - + - - - - {!isMobile && ( - - View source code - - )} + + + + {!isMobile && ( + + View source code + + )} - - + + + ) } diff --git a/source/src/theming.ts b/source/src/theming.ts index 225224e..c4068de 100644 --- a/source/src/theming.ts +++ b/source/src/theming.ts @@ -23,6 +23,7 @@ export default { large: 0, x_large: 0, screen_size1: "1000px", + screen_size2: "1500px", }, color: { linkColor: "#3273dc",