mirror of
https://github.com/phuoc-ng/csslayout.git
synced 2025-08-10 16:14:19 +02:00
@@ -9,6 +9,7 @@ import FixedAtCorner from './layouts/fixed-at-corner/Details';
|
||||
import HolyGrail from './layouts/holy-grail/Details';
|
||||
import InputAddon from './layouts/input-add-on/Details';
|
||||
import MediaObject from './layouts/media-object/Details';
|
||||
import Menu from './layouts/menu/Details';
|
||||
import PreviousNextButtons from './layouts/previous-next-buttons/Details';
|
||||
import SameHeightColumns from './layouts/same-height-columns/Details';
|
||||
import Sidebar from './layouts/sidebar/Details';
|
||||
@@ -29,6 +30,7 @@ const App = () => {
|
||||
<Route exact={true} path='/holy-grail'><HolyGrail /></Route>
|
||||
<Route exact={true} path='/input-add-on'><InputAddon /></Route>
|
||||
<Route exact={true} path='/media-object'><MediaObject /></Route>
|
||||
<Route exact={true} path='/menu'><Menu /></Route>
|
||||
<Route exact={true} path='/previous-next-buttons'><PreviousNextButtons /></Route>
|
||||
<Route exact={true} path='/same-height-columns'><SameHeightColumns /></Route>
|
||||
<Route exact={true} path='/sidebar'><Sidebar /></Route>
|
||||
|
@@ -8,6 +8,7 @@ import FixedAtCornerCover from './layouts/fixed-at-corner/Cover';
|
||||
import HolyGrailCover from './layouts/holy-grail/Cover';
|
||||
import InputAddonCover from './layouts/input-add-on/Cover';
|
||||
import MediaObjectCover from './layouts/media-object/Cover';
|
||||
import MenuCover from './layouts/menu/Cover';
|
||||
import PreviousNextButtonCover from './layouts/previous-next-buttons/Cover';
|
||||
import SameHeightColumnsCover from './layouts/same-height-columns/Cover';
|
||||
import SidebarCover from './layouts/sidebar/Cover';
|
||||
@@ -112,6 +113,12 @@ const Home = () => {
|
||||
<h4 className="f4 mv0 pt3">Media object</h4>
|
||||
</Link>
|
||||
</div>
|
||||
<div className="pa1 w-20">
|
||||
<Link to="/menu" className="link flex flex-column items-center justify-center tc hover-bg-black-10 br2 pa3">
|
||||
<MenuCover />
|
||||
<h4 className="f4 mv0 pt3">Menu</h4>
|
||||
</Link>
|
||||
</div>
|
||||
<div className="pa1 w-20">
|
||||
<Link to="/previous-next-buttons" className="link flex flex-column items-center justify-center tc hover-bg-black-10 br2 pa3">
|
||||
<PreviousNextButtonCover />
|
||||
|
26
client/layouts/menu/Cover.jsx
Normal file
26
client/layouts/menu/Cover.jsx
Normal file
@@ -0,0 +1,26 @@
|
||||
import React from 'react';
|
||||
|
||||
import Frame from '../../placeholders/Frame';
|
||||
import Line from '../../placeholders/Line';
|
||||
|
||||
const Cover = () => {
|
||||
return (
|
||||
<Frame>
|
||||
<div className="h-100 flex flex-column items-center justify-center pa3">
|
||||
<div className="b--black-30 ba br2 flex flex-column h-100 w-100">
|
||||
<div className="b--black-30 bb flex items-center ph2" style={{ flex: 1 }}>
|
||||
<Line />
|
||||
</div>
|
||||
<div className="b--black-30 bb flex items-center ph2" style={{ flex: 1 }}>
|
||||
<div className="w-80"><Line /></div>
|
||||
</div>
|
||||
<div className="flex items-center ph2" style={{ flex: 1 }}>
|
||||
<div className="w-60"><Line /></div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</Frame>
|
||||
);
|
||||
};
|
||||
|
||||
export default Cover;
|
123
client/layouts/menu/Details.jsx
Normal file
123
client/layouts/menu/Details.jsx
Normal file
@@ -0,0 +1,123 @@
|
||||
import React from 'react';
|
||||
|
||||
import DetailsLayout from '../../DetailsLayout';
|
||||
import BrowserFrame from '../../placeholders/BrowserFrame';
|
||||
import Circle from '../../placeholders/Circle';
|
||||
import Rectangle from '../../placeholders/Rectangle';
|
||||
import SampleCode from '../../SampleCode';
|
||||
import useDocumentTitle from '../../useDocumentTitle';
|
||||
|
||||
const Details = () => {
|
||||
useDocumentTitle('CSS Layout ∙ Menu');
|
||||
|
||||
return (
|
||||
<DetailsLayout>
|
||||
<h1 className="f1 tc">Menu</h1>
|
||||
<BrowserFrame
|
||||
content={
|
||||
<div className="h-100 flex flex-column items-center justify-center">
|
||||
<div className="b--black-30 ba br2 flex flex-column w-40">
|
||||
<div className="flex items-center h2 ph2 hover-bg-black-10">
|
||||
<div className="w-40"><Rectangle /></div>
|
||||
</div>
|
||||
<div className="flex items-center h2 ph2 hover-bg-black-10">
|
||||
<Circle />
|
||||
<div className="w-50 ml1"><Rectangle /></div>
|
||||
</div>
|
||||
<div className="flex items-center justify-between h2 ph2 hover-bg-black-10">
|
||||
<div className="w-30"><Rectangle /></div>
|
||||
<div>Ctrl + X</div>
|
||||
</div>
|
||||
<div className="flex items-center justify-between h2 ph2 hover-bg-black-10">
|
||||
<div className="w-70"><Rectangle /></div>
|
||||
<div>Ctrl + C</div>
|
||||
</div>
|
||||
<div className="flex items-center justify-between h2 ph2 hover-bg-black-10">
|
||||
<div className="w-20"><Rectangle /></div>
|
||||
<Circle />
|
||||
</div>
|
||||
<div className="flex items-center justify-between h2 ph2 hover-bg-black-10">
|
||||
<div className="flex items-center w-80">
|
||||
<Circle />
|
||||
<div className="w-50 ml1"><Rectangle /></div>
|
||||
</div>
|
||||
<Circle />
|
||||
</div>
|
||||
<div className="b--black-30 bb" style={{ height: '1px' }} />
|
||||
<div className="flex items-center justify-between h2 ph2 hover-bg-black-10">
|
||||
<div className="w-40"><Rectangle /></div>
|
||||
<div>Ctrl + V</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
}
|
||||
source={
|
||||
<SampleCode
|
||||
lang="html"
|
||||
code={`
|
||||
<div style="
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
|
||||
/* Border */
|
||||
border: 1px solid rgba(0, 0, 0, 0.3);
|
||||
border-radius: 4px;
|
||||
">
|
||||
<!-- Normal menu item -->
|
||||
<div style="
|
||||
/* Center the content horizontally */
|
||||
align-items: center;
|
||||
display: flex;
|
||||
">
|
||||
...
|
||||
</div>
|
||||
|
||||
<!-- With hot key -->
|
||||
<div style="
|
||||
align-items: center;
|
||||
display: flex;
|
||||
/* Push the hot key to the right */
|
||||
justify-content: space-between;
|
||||
">
|
||||
<!-- Label -->
|
||||
...
|
||||
<!-- Hot key -->
|
||||
...
|
||||
</div>
|
||||
|
||||
<!-- With image and hot key -->
|
||||
<div style="
|
||||
align-items: center;
|
||||
display: flex;
|
||||
/* Push the hot key to the right */
|
||||
justify-content: space-between;
|
||||
">
|
||||
<div style="
|
||||
align-items: center;
|
||||
display: flex;
|
||||
">
|
||||
<!-- Image -->
|
||||
...
|
||||
<!-- Label -->
|
||||
...
|
||||
</div>
|
||||
|
||||
<!-- Hot key -->
|
||||
...
|
||||
</div>
|
||||
|
||||
<!-- Divider -->
|
||||
<div style="
|
||||
border-bottom: 1px solid rgba(0, 0, 0, 0.3);
|
||||
height: 1px;
|
||||
" />
|
||||
</div>
|
||||
`}
|
||||
/>
|
||||
}
|
||||
/>
|
||||
</DetailsLayout>
|
||||
);
|
||||
};
|
||||
|
||||
export default Details;
|
Reference in New Issue
Block a user