forked from mui/material-ui
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
30 changed files
with
359 additions
and
122 deletions.
There are no files selected for viewing
54 changes: 0 additions & 54 deletions
54
docs/data/material/getting-started/templates/album/components/AppBar.js
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
6 changes: 3 additions & 3 deletions
6
...getting-started/templates/album/README.md → ...-started/templates/landing-page/README.md
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,15 +1,15 @@ | ||
# Album template | ||
# Landing page template | ||
|
||
## Usage | ||
|
||
<!-- #default-branch-switch --> | ||
|
||
1. Copy the files into your project, or one of the [example projects](https://github.com/mui/material-ui/tree/master/examples). | ||
2. Make sure your project has the required dependencies: @mui/material, @mui/icons-material, @emotion/styled, @emotion/react. | ||
3. Import and use the `Album` component. | ||
3. Import and use the `LandingPage` component. | ||
|
||
## Demo | ||
|
||
<!-- #default-branch-switch --> | ||
|
||
View the demo at https://mui.com/material-ui/getting-started/templates/album/. | ||
View the demo at https://mui.com/material-ui/getting-started/templates/landing-page/. |
201 changes: 201 additions & 0 deletions
201
docs/data/material/getting-started/templates/landing-page/components/AppBar.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,201 @@ | ||
import * as React from 'react'; | ||
import Box from '@mui/material/Box'; | ||
import AppBar from '@mui/material/AppBar'; | ||
import Toolbar from '@mui/material/Toolbar'; | ||
import Button from '@mui/material/Button'; | ||
import ToggleColorMode from './ToggleColorMode'; | ||
import Container from '@mui/material/Container'; | ||
import Divider from '@mui/material/Divider'; | ||
import Typography from '@mui/material/Typography'; | ||
import MenuItem from '@mui/material/MenuItem'; | ||
import Drawer from '@mui/material/Drawer'; | ||
|
||
import MenuIcon from '@mui/icons-material/Menu'; | ||
|
||
const logoStyle = { | ||
width: '140px', | ||
height: 'auto', | ||
}; | ||
|
||
function AppAppBar() { | ||
const [open, setOpen] = React.useState(false); | ||
|
||
const toggleDrawer = (newOpen) => () => { | ||
setOpen(newOpen); | ||
}; | ||
|
||
const scrollToSection = (sectionId) => { | ||
const sectionElement = document.getElementById(sectionId); | ||
const offset = 128; | ||
if (sectionElement) { | ||
const targetScroll = sectionElement.offsetTop - offset; | ||
sectionElement.scrollIntoView({ behavior: 'smooth' }); | ||
window.scrollTo({ | ||
top: targetScroll, | ||
behavior: 'smooth', | ||
}); | ||
setOpen(false); | ||
} | ||
}; | ||
|
||
return ( | ||
<div> | ||
<AppBar | ||
enableColorOnDark | ||
position="fixed" | ||
sx={{ | ||
boxShadow: 0, | ||
bgcolor: (theme) => (theme.palette.mode === 'light' ? '#fff' : '#000'), | ||
borderBottom: 1, | ||
borderColor: 'divider', | ||
paddingX: 0, | ||
}} | ||
> | ||
<Container maxWidth="lg"> | ||
<Toolbar disableGutters sx={{}}> | ||
<Box | ||
sx={{ | ||
flexGrow: 1, | ||
display: 'flex', | ||
alignItems: 'center', | ||
ml: '-18px', | ||
}} | ||
> | ||
<img | ||
src={ | ||
'https://assets-global.website-files.com/61ed56ae9da9fd7e0ef0a967/61f12e6faf73568658154dae_SitemarkDefault.svg' | ||
} | ||
style={logoStyle} | ||
/> | ||
<Box sx={{ display: { xs: 'none', md: 'flex' } }}> | ||
<MenuItem onClick={() => scrollToSection('features')}> | ||
<Typography variant="body2" color="text.primary"> | ||
Features | ||
</Typography> | ||
</MenuItem> | ||
<MenuItem onClick={() => scrollToSection('testimonials')}> | ||
<Typography variant="body2" color="text.primary"> | ||
Testimonials | ||
</Typography> | ||
</MenuItem> | ||
<MenuItem onClick={() => scrollToSection('highlights')}> | ||
<Typography variant="body2" color="text.primary"> | ||
Highlights | ||
</Typography> | ||
</MenuItem> | ||
<MenuItem onClick={() => scrollToSection('pricing')}> | ||
<Typography variant="body2" color="text.primary"> | ||
Pricing | ||
</Typography> | ||
</MenuItem> | ||
<MenuItem onClick={() => scrollToSection('faq')}> | ||
{' '} | ||
<Typography variant="body2" color="text.primary"> | ||
FAQ | ||
</Typography> | ||
</MenuItem> | ||
</Box> | ||
</Box> | ||
|
||
<Box sx={{ display: { xs: 'none', md: 'flex' }, gap: 1 }}> | ||
<Button | ||
color="primary" | ||
variant="contained" | ||
size="small" | ||
component="a" | ||
href="/material-ui/getting-started/templates/sign-up/" | ||
target="_blank" | ||
> | ||
Sign up | ||
</Button> | ||
<Button | ||
color="primary" | ||
variant="outlined" | ||
size="small" | ||
component="a" | ||
href="/material-ui/getting-started/templates/sign-in/" | ||
target="_blank" | ||
> | ||
Sign in | ||
</Button> | ||
<ToggleColorMode /> | ||
</Box> | ||
|
||
<Box sx={{ display: { sm: '', md: 'none' } }}> | ||
<Button | ||
variant="outlined" | ||
color="primary" | ||
aria-label="menu" | ||
onClick={toggleDrawer(true)} | ||
sx={{ minWidth: '30px', p: '4px' }} | ||
> | ||
<MenuIcon /> | ||
</Button> | ||
<Drawer anchor="right" open={open} onClose={toggleDrawer(false)}> | ||
<Box | ||
sx={{ | ||
minWidth: '60dvw', | ||
p: 2, | ||
backgroundColor: 'background.paper', | ||
flexGrow: 1, | ||
}} | ||
> | ||
<Box | ||
sx={{ | ||
display: 'flex', | ||
flexDirection: 'column', | ||
alignItems: 'end', | ||
flexGrow: 1, | ||
}} | ||
> | ||
<ToggleColorMode /> | ||
</Box> | ||
<MenuItem onClick={() => scrollToSection('features')}> | ||
Features | ||
</MenuItem> | ||
<MenuItem onClick={() => scrollToSection('testimonials')}> | ||
Testimonials | ||
</MenuItem> | ||
<MenuItem onClick={() => scrollToSection('highlights')}> | ||
Highlights | ||
</MenuItem> | ||
<MenuItem onClick={() => scrollToSection('pricing')}> | ||
Pricing | ||
</MenuItem> | ||
<MenuItem onClick={() => scrollToSection('faq')}>FAQ</MenuItem> | ||
<Divider /> | ||
<MenuItem> | ||
<Button | ||
color="primary" | ||
variant="contained" | ||
component="a" | ||
href="/material-ui/getting-started/templates/sign-up/" | ||
target="_blank" | ||
sx={{ width: '100%' }} | ||
> | ||
Sign up | ||
</Button> | ||
</MenuItem> | ||
<MenuItem> | ||
<Button | ||
color="primary" | ||
variant="outlined" | ||
component="a" | ||
href="/material-ui/getting-started/templates/sign-in/" | ||
target="_blank" | ||
sx={{ width: '100%' }} | ||
> | ||
Sign in | ||
</Button> | ||
</MenuItem> | ||
</Box> | ||
</Drawer> | ||
</Box> | ||
</Toolbar> | ||
</Container> | ||
</AppBar> | ||
</div> | ||
); | ||
} | ||
|
||
export default AppAppBar; |
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.