mirror of
https://github.com/phuoc-ng/csslayout.git
synced 2025-08-16 11:04:30 +02:00
Add card
This commit is contained in:
28
client/layouts/card/Cover.jsx
Normal file
28
client/layouts/card/Cover.jsx
Normal file
@@ -0,0 +1,28 @@
|
||||
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 pa2">
|
||||
<div className="w-100 mb2">
|
||||
<Rectangle height={32} />
|
||||
</div>
|
||||
<div style={{ flex: 1 }}>
|
||||
<div className="w-100 mb1"><Line /></div>
|
||||
<div className="w-100 mb1"><Line /></div>
|
||||
<div className="w-80 mb1"><Line /></div>
|
||||
<div className="w-60 mb2"><Line /></div>
|
||||
<div className="w-30">
|
||||
<Rectangle height={8} />
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</Frame>
|
||||
);
|
||||
};
|
||||
|
||||
export default Cover;
|
63
client/layouts/card/Details.jsx
Normal file
63
client/layouts/card/Details.jsx
Normal file
@@ -0,0 +1,63 @@
|
||||
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 '../../hooks/useDocumentTitle';
|
||||
|
||||
const Details = () => {
|
||||
useDocumentTitle('CSS Layout ∙ Card');
|
||||
|
||||
return (
|
||||
<DetailsLayout>
|
||||
<h1 className="f1 tc">Card</h1>
|
||||
<BrowserFrame
|
||||
content={
|
||||
<div className="h-100 flex flex-column items-center justify-center pa3">
|
||||
<div className="b--black-30 ba br2 flex flex-column w5">
|
||||
<Rectangle height={150} />
|
||||
<div className="pa3" style={{ flex: 1 }}>
|
||||
<div className="mb3"><Block numberOfBlocks={15} /></div>
|
||||
<div className="w4">
|
||||
<Rectangle height={32} />
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
}
|
||||
source={
|
||||
<SampleCode
|
||||
lang="html"
|
||||
code={`
|
||||
<div style="
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
">
|
||||
<!-- Cover -->
|
||||
<div style="
|
||||
height: 150px;
|
||||
width: 100%;
|
||||
">
|
||||
...
|
||||
</div>
|
||||
|
||||
<!-- Content -->
|
||||
<div style="
|
||||
/* Take available height */
|
||||
flex: 1;
|
||||
">
|
||||
...
|
||||
</div>
|
||||
...
|
||||
</div>
|
||||
`}
|
||||
/>
|
||||
}
|
||||
/>
|
||||
</DetailsLayout>
|
||||
);
|
||||
};
|
||||
|
||||
export default Details;
|
Reference in New Issue
Block a user