1
0
mirror of https://github.com/phuoc-ng/csslayout.git synced 2025-08-21 21:26:15 +02:00

Add modal

This commit is contained in:
Phuoc Nguyen
2019-11-17 20:26:23 +07:00
parent fc97d9f337
commit 82a63a7d54
5 changed files with 125 additions and 13 deletions

View 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">&times;</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;

View 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;

View File

@@ -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>