Skip to content

Commit

Permalink
Create landing page skeleton
Browse files Browse the repository at this point in the history
- setup MUI theme and fonts
- setup a hash router
- change website title
- create a basic layout and navigation
  • Loading branch information
honzaflash committed Oct 3, 2023
1 parent 33e6d44 commit 42f2a3a
Show file tree
Hide file tree
Showing 10 changed files with 154 additions and 97 deletions.
52 changes: 29 additions & 23 deletions public/index.html
Original file line number Diff line number Diff line change
@@ -1,35 +1,40 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8" />
<link rel="icon" href="%PUBLIC_URL%/favicon.ico" />
<meta name="viewport" content="width=device-width, initial-scale=1" />
<meta name="theme-color" content="#000000" />
<meta
name="description"
content="Web site created using create-react-app"
/>
<link rel="apple-touch-icon" href="%PUBLIC_URL%/logo192.png" />
<!--
manifest.json provides metadata used when your web app is installed on a

<head>
<meta charset="utf-8" />
<meta name="viewport" content="width=device-width, initial-scale=1" />
<meta name="theme-color" content="#000000" />
<meta name="description" content="Web site created using create-react-app" />
<link rel="icon" href="%PUBLIC_URL%/favicon.ico" />
<link rel="apple-touch-icon" href="%PUBLIC_URL%/logo192.png" />
<!--
manifest.json provides metadata used when your web app is installed on a
user's mobile device or desktop. See https://developers.google.com/web/fundamentals/web-app-manifest/
-->
<link rel="manifest" href="%PUBLIC_URL%/manifest.json" />
<!--
<link rel="manifest" href="%PUBLIC_URL%/manifest.json" />
<!--
Notice the use of %PUBLIC_URL% in the tags above.
It will be replaced with the URL of the `public` folder during the build.
Only files inside the `public` folder can be referenced from the HTML.
Unlike "/favicon.ico" or "favicon.ico", "%PUBLIC_URL%/favicon.ico" will
work correctly both with client-side routing and a non-root public URL.
Learn how to configure a non-root public URL by running `npm run build`.
-->
<title>React App</title>
</head>
<body>
<noscript>You need to enable JavaScript to run this app.</noscript>
<div id="root"></div>
<!--
<link rel="preconnect" href="https://fonts.googleapis.com">
<link rel="preconnect" href="https://fonts.gstatic.com" crossorigin>
<link
href="https://fonts.googleapis.com/css2?family=Roboto+Mono:wght@300;400;500;700&family=Roboto:ital,wght@0,300;0,400;0,500;0,700;1,300;1,400;1,500&display=swap"
rel="stylesheet">
<!-- importing Roboto and Robot Mono through Google Web Fonts CDN -->
<title>Jan Rychly</title>
</head>

<body>
<noscript>You need to enable JavaScript to run this app.</noscript>
<div id="root"></div>
<!--
This HTML file is a template.
If you open it directly in the browser, you will see an empty page.
Expand All @@ -39,5 +44,6 @@
To begin the development, run `npm start` or `yarn start`.
To create a production bundle, use `npm run build` or `yarn build`.
-->
</body>
</html>
</body>

</html>
38 changes: 0 additions & 38 deletions src/App.css

This file was deleted.

40 changes: 35 additions & 5 deletions src/App.tsx
Original file line number Diff line number Diff line change
@@ -1,11 +1,41 @@
import { Box } from '@mui/material'
import './App.css'
import { Box, CssBaseline, ThemeProvider } from '@mui/material'
import { RouterProvider, createHashRouter } from 'react-router-dom'

import theme from './theme'
import { LandingPage } from './pages/LandingPage'
import { Layout } from './layouts/Layout'

const router = createHashRouter([
{
path: '/',
element: <Layout />,
children: [
{
path: '/full-stack',
element: <LandingPage />,
},
{
path: '/front-end',
element: <LandingPage />,
},
{
path: '/back-end',
element: <LandingPage />,
},
]
},
])



export const App = () => {
return (
<Box className="App">
how u like dis app
</Box>
<ThemeProvider theme={theme}>
<CssBaseline />
<Box className="App">
<RouterProvider router={router} />
</Box>
</ThemeProvider>
)
}

Expand Down
13 changes: 0 additions & 13 deletions src/index.css

This file was deleted.

2 changes: 1 addition & 1 deletion src/index.tsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import React from 'react'
import ReactDOM from 'react-dom/client'
import './index.css'

import App from './App'

const root = ReactDOM.createRoot(
Expand Down
15 changes: 15 additions & 0 deletions src/layouts/Layout.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
import { Navigation } from './Navigation'
import { Box, Container } from '@mui/material'
import { Outlet } from 'react-router-dom'


export const Layout = () => (
<>
<Navigation />
{/* a box spacer of the size of the toolbar so that nothing is hidden underneath <Navigation /> */}
<Box sx={(theme) => (theme.mixins.toolbar)} />
<Container>
<Outlet />
</Container>
</>
)
26 changes: 26 additions & 0 deletions src/layouts/Navigation.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
/* eslint-disable react/jsx-no-comment-textnodes */
// The title is supposed to imitate a code source file header
import { AppBar, Box, Container, Tab, Tabs, Toolbar, Typography } from '@mui/material'

const a11yProps = (index: number) => ({
'id': `simple-tab-${index}`,
'aria-controls': `simple-tabpanel-${index}`,

})

export const Navigation = () => {
return(
<AppBar>
<Container>
<Toolbar>
<Typography variant='h4' sx={{ display: { xs: 'none', md: 'flex' }, mr: 1 }}>/* @author: Jan Rychly */</Typography>
<Typography variant='h6'sx={{ display: { xs: 'flex', md: 'none' }, mr: 1 }}>J. R.</Typography>
<Box>
<Tabs value={0} >
<Tab label="Dev" {...a11yProps(0)}/>
</Tabs>
</Box>
</Toolbar>
</Container>
</AppBar>
)}
21 changes: 21 additions & 0 deletions src/pages/LandingPage/LandingPage.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
import { Box, Grid, Stack, Typography } from '@mui/material'

export const LandingPage = () => (
<Grid container>
<Grid item xs={12} md={6}>
<Stack>
<Typography variant='h1' color='primary' sx={{fontWeight: 700, fontSize: '900%'}}>Jan<br/>Rychly</Typography>
<Typography variant='h3'>Software Engineer</Typography>
<Typography variant='body1'>I am amazing and you should hire me.</Typography>
</Stack>
</Grid>
<Grid item xs={12} md={6}>
<Box sx={{height: '100%', display: 'flex', alignItems: 'center', justifyContent: 'center'}}>
<Typography><pre>H i g h l i g h t s G a l l e r y H e r e</pre></Typography>
</Box>
</Grid>
<Grid xs={12}>
<Typography>List of useful skills that I have</Typography>
</Grid>
</Grid>
)
3 changes: 3 additions & 0 deletions src/pages/LandingPage/index.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
import { LandingPage } from './LandingPage'

export { LandingPage }
41 changes: 24 additions & 17 deletions src/theme.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { ThemeOptions } from '@mui/material/styles'
import { createTheme } from '@mui/material/styles'

export const themeOptions: ThemeOptions = {
const theme = createTheme({
palette: {
mode: 'dark',
primary: {
Expand All @@ -24,47 +24,52 @@ export const themeOptions: ThemeOptions = {
},
typography: {
h1: {
fontFamily: 'Victor Mono',
fontFamily: 'Roboto Mono',
},
h2: {
fontFamily: 'Victor Mono',
fontFamily: 'Roboto Mono',
},
h3: {
fontFamily: 'Victor Mono',
fontFamily: 'Roboto Mono',
},
h4: {
fontFamily: 'Victor Mono',
fontFamily: 'Roboto Mono',
},
body1: {
fontFamily: 'Open Sans',
fontFamily: 'Roboto',
},
body2: {
fontFamily: 'Open Sans',
fontFamily: 'Roboto',
},
button: {
fontFamily: 'Victor Mono',
fontFamily: 'Roboto Mono',
},
caption: {
fontFamily: 'Open Sans',
fontFamily: 'Roboto',
},
overline: {
fontFamily: 'Open Sans',
fontFamily: 'Roboto',
},
subtitle2: {
fontFamily: 'Open Sans',
fontFamily: 'Roboto',
},
subtitle1: {
fontFamily: 'Open Sans',
fontFamily: 'Roboto',
},
h6: {
fontFamily: 'Victor Mono',
fontFamily: 'Roboto Mono',
},
h5: {
fontFamily: 'Victor Mono',
fontFamily: 'Roboto Mono',
},
fontFamily: 'Open Sans',
fontFamily: 'Roboto',
},
components: {
MuiContainer: {
defaultProps: {
maxWidth: 'xl'
}
},
MuiButtonBase: {
defaultProps: {
disableRipple: true,
Expand All @@ -85,4 +90,6 @@ export const themeOptions: ThemeOptions = {
borderRadius: 2,
},
spacing: 4,
}
})

export default theme

0 comments on commit 42f2a3a

Please sign in to comment.