mirror of
https://github.com/phuoc-ng/csslayout.git
synced 2025-08-06 06:07:33 +02:00
@@ -11,6 +11,7 @@ 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 Modal from './layouts/modal/Details';
|
||||
import Notification from './layouts/notification/Details';
|
||||
import Pagination from './layouts/pagination/Details';
|
||||
import PreviousNextButtons from './layouts/previous-next-buttons/Details';
|
||||
@@ -36,6 +37,7 @@ const App = () => {
|
||||
<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='/modal'><Modal /></Route>
|
||||
<Route exact={true} path='/notification'><Notification /></Route>
|
||||
<Route exact={true} path='/pagination'><Pagination /></Route>
|
||||
<Route exact={true} path='/previous-next-buttons'><PreviousNextButtons /></Route>
|
||||
|
@@ -10,6 +10,7 @@ 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 ModalCover from './layouts/modal/Cover';
|
||||
import NotificationCover from './layouts/notification/Cover';
|
||||
import PaginationCover from './layouts/pagination/Cover';
|
||||
import PreviousNextButtonCover from './layouts/previous-next-buttons/Cover';
|
||||
@@ -129,6 +130,12 @@ const Home = () => {
|
||||
<h4 className="f4 mv0 pt3">Menu</h4>
|
||||
</Link>
|
||||
</div>
|
||||
<div className="pa1 w-20">
|
||||
<Link to="/modal" className="link flex flex-column items-center justify-center tc hover-bg-black-10 br2 pa3">
|
||||
<ModalCover />
|
||||
<h4 className="f4 mv0 pt3">Modal</h4>
|
||||
</Link>
|
||||
</div>
|
||||
<div className="pa1 w-20">
|
||||
<Link to="/notification" className="link flex flex-column items-center justify-center tc hover-bg-black-10 br2 pa3">
|
||||
<NotificationCover />
|
||||
|
32
client/layouts/modal/Cover.jsx
Normal file
32
client/layouts/modal/Cover.jsx
Normal file
@@ -0,0 +1,32 @@
|
||||
import React from 'react';
|
||||
|
||||
import Frame from '../../placeholders/Frame';
|
||||
import Line from '../../placeholders/Line';
|
||||
import Rectangle from '../../placeholders/Rectangle';
|
||||
|
||||
const Cover = () => {
|
||||
return (
|
||||
<Frame>
|
||||
<div className="flex flex-column h-100 items-center justify-center pa3">
|
||||
<div className="b--black-30 ba br2 w-100">
|
||||
<div className="flex items-center justify-between ph1">
|
||||
<div className="w-60"><Rectangle height={2} /></div>
|
||||
<div className="black-70">×</div>
|
||||
</div>
|
||||
<div className="pa1">
|
||||
<div className="w-100 mb1"><Line /></div>
|
||||
<div className="w-80 mb1"><Line /></div>
|
||||
<div className="w-60 mb1"><Line /></div>
|
||||
<div className="w-40"><Line /></div>
|
||||
</div>
|
||||
<div className="flex items-center justify-end pa1">
|
||||
<div className="w-33 mr2"><Rectangle height={8} /></div>
|
||||
<div className="w-33"><Rectangle height={8} /></div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</Frame>
|
||||
);
|
||||
};
|
||||
|
||||
export default Cover;
|
82
client/layouts/modal/Details.jsx
Normal file
82
client/layouts/modal/Details.jsx
Normal file
@@ -0,0 +1,82 @@
|
||||
import React from 'react';
|
||||
|
||||
import DetailsLayout from '../../DetailsLayout';
|
||||
import Block from '../../placeholders/Block';
|
||||
import BrowserFrame from '../../placeholders/BrowserFrame';
|
||||
import Circle from '../../placeholders/Circle';
|
||||
import Rectangle from '../../placeholders/Rectangle';
|
||||
import SampleCode from '../../SampleCode';
|
||||
import useDocumentTitle from '../../hooks/useDocumentTitle';
|
||||
|
||||
const Details = () => {
|
||||
useDocumentTitle('CSS Layout ∙ Modal');
|
||||
|
||||
return (
|
||||
<DetailsLayout>
|
||||
<h1 className="f1 tc">Modal</h1>
|
||||
<BrowserFrame
|
||||
content={
|
||||
<div className="h-100 flex flex-column items-center justify-center">
|
||||
<div className="b--black-30 ba br2 w-50">
|
||||
<div className="flex items-center justify-between bb b--black-30 pa3">
|
||||
<div className="w-60"><Rectangle /></div>
|
||||
<div className="black-70">
|
||||
<Circle />
|
||||
</div>
|
||||
</div>
|
||||
<div className="pa3">
|
||||
<div className="mb3"><Block numberOfBlocks={10} /></div>
|
||||
<Block numberOfBlocks={5} />
|
||||
</div>
|
||||
<div className="flex justify-end bt b--black-30 pa3">
|
||||
<div className="w-30 mr2"><Rectangle height={32} /></div>
|
||||
<div className="w-30"><Rectangle height={32} /></div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
}
|
||||
source={
|
||||
<SampleCode
|
||||
lang="html"
|
||||
code={`
|
||||
<div style="
|
||||
/* Border */
|
||||
border: 1px solid rgba(0, 0, 0.3);
|
||||
border-radius: 4px;
|
||||
">
|
||||
<!-- Header -->
|
||||
<div style="
|
||||
display: flex;
|
||||
justify-content: space-between;
|
||||
/* Border */
|
||||
border-bottom: 1px solid rgba(0, 0, 0.3);
|
||||
">
|
||||
<!-- Title -->
|
||||
...
|
||||
<!-- Close icon sticks to the right -->
|
||||
...
|
||||
</div>
|
||||
|
||||
<!-- Content -->
|
||||
...
|
||||
|
||||
<!-- Footer -->
|
||||
<div style="
|
||||
display: flex;
|
||||
/* Push the buttons to the right */
|
||||
justify-content: flex-end;
|
||||
/* Border */
|
||||
border-top: 1px solid rgba(0, 0, 0.3);
|
||||
">
|
||||
...
|
||||
</div>
|
||||
</div>
|
||||
`}
|
||||
/>
|
||||
}
|
||||
/>
|
||||
</DetailsLayout>
|
||||
);
|
||||
};
|
||||
|
||||
export default Details;
|
@@ -3,6 +3,7 @@ import React from 'react';
|
||||
import DetailsLayout from '../../DetailsLayout';
|
||||
import Block from '../../placeholders/Block';
|
||||
import BrowserFrame from '../../placeholders/BrowserFrame';
|
||||
import Circle from '../../placeholders/Circle';
|
||||
import SampleCode from '../../SampleCode';
|
||||
import useDocumentTitle from '../../hooks/useDocumentTitle';
|
||||
|
||||
@@ -18,19 +19,7 @@ const Details = () => {
|
||||
<div className="b--black-30 ba br2 flex justify-between w-60">
|
||||
<div className="pa3 w-80"><Block numberOfBlocks={5} /></div>
|
||||
<button className="black-30 bn f2 flex h2 items-center justify-center w2" style={{ marginRight: '1px' }}>
|
||||
<svg
|
||||
viewBox="0 0 24 24"
|
||||
style={{
|
||||
stroke: 'rgb(0, 0, 0)',
|
||||
fill: 'none',
|
||||
strokeWidth: 1,
|
||||
strokeLinecap: 'round',
|
||||
strokeLinejoin: 'round',
|
||||
height: '16px',
|
||||
width: '16px'
|
||||
}}>
|
||||
<path d="M12,0.5c6.351,0,11.5,5.149,11.5,11.5S18.351,23.5,12,23.5S0.5,18.351,0.5,12S5.649,0.5,12,0.5z M7,7l10,10 M17,7L7,17" />
|
||||
</svg>
|
||||
<Circle />
|
||||
</button>
|
||||
</div>
|
||||
</div>
|
||||
|
@@ -3,7 +3,7 @@ import React from 'react';
|
||||
const Rectangle = ({ height = 8 }) => {
|
||||
return (
|
||||
<div
|
||||
className="w-100 bg-black-30"
|
||||
className="w-100 bg-black-30 br1"
|
||||
style={{ height: `${height}px` }}
|
||||
/>
|
||||
);
|
||||
|
Reference in New Issue
Block a user