mirror of
https://github.com/phuoc-ng/csslayout.git
synced 2025-08-07 06:37:01 +02:00
@@ -4,6 +4,7 @@ import { BrowserRouter as Router, Route, Switch } from 'react-router-dom';
|
||||
import Home from './Home';
|
||||
import Badge from './layouts/Badge';
|
||||
import Centering from './layouts/Centering';
|
||||
import HolyGrail from './layouts/HolyGrail';
|
||||
import InputAddon from './layouts/InputAddon';
|
||||
import MediaObject from './layouts/MediaObject';
|
||||
import Sidebar from './layouts/Sidebar';
|
||||
@@ -18,6 +19,7 @@ const App = () => {
|
||||
<Route exact={true} path='/'><Home /></Route>
|
||||
<Route exact={true} path='/badge'><Badge /></Route>
|
||||
<Route exact={true} path='/centering'><Centering /></Route>
|
||||
<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='/sidebar'><Sidebar /></Route>
|
||||
|
@@ -3,6 +3,7 @@ import { Link } from 'react-router-dom';
|
||||
|
||||
import BadgeCover from './covers/BadgeCover';
|
||||
import CenterCover from './covers/CenterCover';
|
||||
import HolyGrailCover from './covers/HolyGrailCover';
|
||||
import InputAddonCover from './covers/InputAddonCover';
|
||||
import MediaObjectCover from './covers/MediaObjectCover';
|
||||
import SidebarCover from './covers/SidebarCover';
|
||||
@@ -35,6 +36,12 @@ const Home = () => {
|
||||
<h2 className="f2 lh-copy">Layouts</h2>
|
||||
|
||||
<div className="flex flex-wrap">
|
||||
<div className="pa2 w-20">
|
||||
<Link to="/holy-grail" className="link flex flex-column items-center justify-center bg-black-05 br2 ph3 pv4">
|
||||
<HolyGrailCover />
|
||||
<h4 className="f4 mv0 pt3">Holy grail</h4>
|
||||
</Link>
|
||||
</div>
|
||||
<div className="pa2 w-20">
|
||||
<Link to="/sidebar" className="link flex flex-column items-center justify-center bg-black-05 br2 ph3 pv4">
|
||||
<SidebarCover />
|
||||
|
48
client/covers/HolyGrailCover.jsx
Normal file
48
client/covers/HolyGrailCover.jsx
Normal file
@@ -0,0 +1,48 @@
|
||||
import React from 'react';
|
||||
|
||||
import Frame from '../placeholders/Frame';
|
||||
import Line from '../placeholders/Line';
|
||||
|
||||
const HolyGrailCover = () => {
|
||||
return (
|
||||
<Frame>
|
||||
<div className="h-100 flex flex-column">
|
||||
<div className="flex-shrink-0 bb b--black-30">
|
||||
<div className="w-100 flex items-center pa2">
|
||||
<div className="w1"><Line /></div>
|
||||
<div className="w1 ml-auto"><Line /></div>
|
||||
<div className="w1 ml1"><Line /></div>
|
||||
</div>
|
||||
</div>
|
||||
<div className="flex-grow-1 flex flex-row">
|
||||
<div className="b--black-30 br pa2 w-30">
|
||||
<div className="mb1"><Line /></div>
|
||||
<div className="w-80"><Line /></div>
|
||||
</div>
|
||||
<div className="pa2 flex-auto">
|
||||
<div className="mb1"><Line /></div>
|
||||
<div className="mb1 w-60"><Line /></div>
|
||||
<div className="mb2 w-80"><Line /></div>
|
||||
|
||||
<div className="mb1"><Line /></div>
|
||||
<div className="mb1 w-60"><Line /></div>
|
||||
<div className="mb1 w-80"><Line /></div>
|
||||
</div>
|
||||
<div className="b--black-30 bl pa2 w-30">
|
||||
<div className="mb1"><Line /></div>
|
||||
<div className="w-80"><Line /></div>
|
||||
</div>
|
||||
</div>
|
||||
<div className="flex-shrink-0 bt b--black-30">
|
||||
<div className="w-100 flex items-center pa2">
|
||||
<div className="w1"><Line /></div>
|
||||
<div className="w1 ml1"><Line /></div>
|
||||
<div className="w1 ml1"><Line /></div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</Frame>
|
||||
);
|
||||
};
|
||||
|
||||
export default HolyGrailCover;
|
87
client/layouts/HolyGrail.jsx
Normal file
87
client/layouts/HolyGrail.jsx
Normal file
@@ -0,0 +1,87 @@
|
||||
import React from 'react';
|
||||
|
||||
import DetailsLayout from '../DetailsLayout';
|
||||
import Block from '../placeholders/Block';
|
||||
import BrowserFrame from '../placeholders/BrowserFrame';
|
||||
import Rectangle from '../placeholders/Rectangle';
|
||||
import SampleCode from '../SampleCode';
|
||||
import useDocumentTitle from '../useDocumentTitle';
|
||||
|
||||
const HolyGrail = () => {
|
||||
useDocumentTitle('CSS Layout ∙ Holy grail');
|
||||
|
||||
return (
|
||||
<DetailsLayout>
|
||||
<h1 className="f1 tc">Holy grail</h1>
|
||||
<BrowserFrame
|
||||
content={
|
||||
<div className="h-100 flex flex-column">
|
||||
<div className="flex-shrink-0 bb b--black-30 pa3">
|
||||
<div className="w-50"><Rectangle /></div>
|
||||
</div>
|
||||
<div className="flex-grow-1 flex flex-row">
|
||||
<div className="b--black-30 br pa3 w-25">
|
||||
<Block numberOfBlocks={10} />
|
||||
</div>
|
||||
<div className="pa3 flex-auto">
|
||||
<Block numberOfBlocks={20} />
|
||||
</div>
|
||||
<div className="b--black-30 bl pa3 w-20">
|
||||
<Block numberOfBlocks={5} />
|
||||
</div>
|
||||
</div>
|
||||
<div className="flex-shrink-0 bt b--black-30 pa3">
|
||||
<div className="w-40"><Rectangle /></div>
|
||||
</div>
|
||||
</div>
|
||||
}
|
||||
source={
|
||||
<SampleCode
|
||||
lang="html"
|
||||
code={`
|
||||
<div style="
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
">
|
||||
<header>
|
||||
...
|
||||
</header>
|
||||
<main style="
|
||||
/* Take the remaining height */
|
||||
flex-grow: 1;
|
||||
|
||||
/* Layout the left sidebar, main content and right sidebar */
|
||||
display: flex;
|
||||
flex-direction: row;
|
||||
">
|
||||
<!-- Left sidebar -->
|
||||
<aside style="
|
||||
width: 25%;
|
||||
">...</aside>
|
||||
|
||||
<!-- Main content -->
|
||||
<article style="
|
||||
/* Take the remaining width */
|
||||
flex-grow: 1;
|
||||
">
|
||||
...
|
||||
</article>
|
||||
|
||||
<!-- Right sidebar -->
|
||||
<nav style="
|
||||
width: 20%;
|
||||
">...</nav>
|
||||
</main>
|
||||
<footer>
|
||||
...
|
||||
</footer>
|
||||
</div>
|
||||
`}
|
||||
/>
|
||||
}
|
||||
/>
|
||||
</DetailsLayout>
|
||||
);
|
||||
};
|
||||
|
||||
export default HolyGrail;
|
Reference in New Issue
Block a user