site restructuring

- navbar won't hide content when clicking headers and stuff
- using grid layout
This commit is contained in:
Kim, Jimin 2021-12-21 19:01:54 +09:00
parent f1482b1dff
commit 1135166391
7 changed files with 51 additions and 36 deletions

View file

@ -27,10 +27,20 @@ const IENotSupported = styled.p`
font-family: ${theming.font.regular};
`
const StyledContentContainer = styled.div`
flex: 1 1 auto;
const StyledScrollableArea = styled.div`
height: calc(100vh - 4rem);
display: flex;
flex-direction: column;
justify-content: space-between;
overflow-y: scroll;
overflow-x: hidden;
`
const StyedContentContainer = styled.div`
margin-top: 3rem;
margin-bottom: 3rem;
margin-top: 5rem;
`
const App = () => {
@ -81,27 +91,28 @@ const App = () => {
<meta property="og:description" content="developomp's blog" />
<meta property="og:url" content={process.env.PUBLIC_URL} />
</Helmet>
<GlobalStyle />
<Navbar />
<StyledContentContainer>
{isLoading ? (
<Loading />
) : (
<Routes>
<Route
path="/"
element={<PostList howMany={5} title="Home" />}
/>
<Route path="/loading" element={<Loading />} />
<Route path="/search" element={<Search />} />
<Route path="/404" element={<NotFound />} />
<Route path="/*" element={<Page />} />
</Routes>
)}
</StyledContentContainer>
<Footer />
<StyledScrollableArea>
<StyedContentContainer>
{isLoading ? (
<Loading />
) : (
<Routes>
<Route
path="/"
element={<PostList howMany={5} title="Home" />}
/>
<Route path="/loading" element={<Loading />} />
<Route path="/search" element={<Search />} />
<Route path="/404" element={<NotFound />} />
<Route path="/*" element={<Page />} />
</Routes>
)}
</StyedContentContainer>
<Footer />
</StyledScrollableArea>
</ThemeProvider>
)
}

View file

@ -7,7 +7,10 @@ import theming from "../styles/theming"
const StyledFooter = styled.footer`
display: flex;
height: 7.77rem; /* congratulation. You've found the lucky 777 */
// congratulation. You've found the lucky 7s
min-height: 7.77rem;
max-height: 7.77rem;
align-items: center;
justify-content: center;

View file

@ -4,7 +4,6 @@ import theming from "../styles/theming"
import Card from "./Card"
export const mainContentCSS = css`
margin-top: 3rem;
width: 50%;
@media screen and (max-width: ${theming.size.screen_size1}) {

View file

@ -16,7 +16,7 @@ import NavbarData from "../data/NavbarData"
const StyledNav = styled.nav`
/* set z index to arbitrarily high value to prevent other components from drawing over the navbar */
z-index: 9999;
position: fixed;
max-height: 4rem;
width: 100%;
background-color: ${(props) =>

View file

@ -20,10 +20,6 @@ import { useEffect } from "react"
const map: Map = _map
const StyledPage = styled(MainContent)`
padding-top: 0;
`
const StyledTitle = styled.h1`
margin-bottom: 1rem;
`
@ -134,7 +130,7 @@ const Page = () => {
/>
</Helmet>
<StyledPage>
<MainContent>
{isSeries ? (
<NextPrevButtons
prevURL={seriesData?.prev}
@ -176,7 +172,7 @@ const Page = () => {
__html: fetchedPage.content,
}}
/>
</StyledPage>
</MainContent>
</>
)
}

View file

@ -46,6 +46,7 @@ const defaultDateRange = [
const StyledSearch = styled(MainContent)`
text-align: center;
margin-bottom: 2rem;
`
const StyledSearchContainer = styled.div`
@ -277,6 +278,7 @@ const Search = () => {
</StyledSearchControlContainer>
</StyledSearchContainer>
</StyledSearch>
{postCards}
</>
)

View file

@ -210,14 +210,10 @@ const globalStyle = css`
${markCSS}
${katexCSS}
body {
overflow-x: hidden;
overflow-y: scroll;
}
html,
body,
#root {
overflow: hidden;
min-height: 100vh;
margin: 0;
display: flex;
@ -239,6 +235,14 @@ const globalStyle = css`
text-rendering: optimizeLegibility;
}
#root {
display: grid;
grid-template-rows: 4rem / auto;
height: 100vh;
width: 100vw;
}
a {
text-decoration: none;
color: ${theming.color.linkColor};