mirror of
https://github.com/phuoc-ng/csslayout.git
synced 2025-08-12 00:54:45 +02:00
Add separator
This commit is contained in:
21
client/layouts/separator/Cover.jsx
Normal file
21
client/layouts/separator/Cover.jsx
Normal file
@@ -0,0 +1,21 @@
|
||||
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="h-100 flex flex-column items-center justify-center">
|
||||
<div className="flex items-center h1 w-80">
|
||||
<div style={{ flex: 1 }}><Line /></div>
|
||||
<div className="w-25 mh1"><Rectangle /></div>
|
||||
<div style={{ flex: 1 }}><Line /></div>
|
||||
</div>
|
||||
</div>
|
||||
</Frame>
|
||||
);
|
||||
};
|
||||
|
||||
export default Cover;
|
63
client/layouts/separator/Details.jsx
Normal file
63
client/layouts/separator/Details.jsx
Normal file
@@ -0,0 +1,63 @@
|
||||
import React from 'react';
|
||||
|
||||
import DetailsLayout from '../../DetailsLayout';
|
||||
import BrowserFrame from '../../placeholders/BrowserFrame';
|
||||
import Rectangle from '../../placeholders/Rectangle';
|
||||
import SampleCode from '../../SampleCode';
|
||||
|
||||
const Details = () => {
|
||||
return (
|
||||
<DetailsLayout title="Separator">
|
||||
<BrowserFrame
|
||||
content={
|
||||
<div className="h-100 flex flex-column items-center justify-center">
|
||||
<div className="flex items-center w-60 relative">
|
||||
<div className="absolute bg-white ph2" style={{ left: '50%', top: '50%', transform: 'translate(-50%, -50%)' }}>
|
||||
<div className="w4"><Rectangle height={16} /></div>
|
||||
</div>
|
||||
<div className="bb b--black-30 w-100" style={{ height: '1px' }} />
|
||||
</div>
|
||||
</div>
|
||||
}
|
||||
source={
|
||||
<SampleCode
|
||||
lang="html"
|
||||
code={`
|
||||
<div style="
|
||||
/* Content is centered horizontally */
|
||||
align-items: center;
|
||||
display: flex;
|
||||
|
||||
/* Used to set the position of text */
|
||||
position: relative;
|
||||
">
|
||||
<!-- Text -->
|
||||
<div style="
|
||||
/* We won't see the separator line */
|
||||
background: #FFF;
|
||||
|
||||
/* Displayed at the center of container */
|
||||
left: 50%;
|
||||
position: absolute;
|
||||
top: 50%;
|
||||
transform: translate(-50%, -50%);
|
||||
">
|
||||
...
|
||||
</div>
|
||||
|
||||
<!-- Separator line -->
|
||||
<div style="
|
||||
border-bottom: 1px solid rgba(0, 0, 0, 0.3);
|
||||
height: 1px;
|
||||
width: 100%;
|
||||
" />
|
||||
</div>
|
||||
`}
|
||||
/>
|
||||
}
|
||||
/>
|
||||
</DetailsLayout>
|
||||
);
|
||||
};
|
||||
|
||||
export default Details;
|
Reference in New Issue
Block a user