mirror of
https://github.com/phuoc-ng/csslayout.git
synced 2025-10-24 11:16:27 +02:00
97 lines
2.7 KiB
TypeScript
97 lines
2.7 KiB
TypeScript
import React from 'react';
|
|
|
|
import DetailsLayout from '../../layouts/DetailsLayout';
|
|
import Block from '../../placeholders/Block';
|
|
import BrowserFrame from '../../placeholders/BrowserFrame';
|
|
|
|
const Details: React.FC<{}> = () => {
|
|
return (
|
|
<DetailsLayout title="Drawer">
|
|
<div style={{ padding: '64px 32px' }}>
|
|
<div style={{ lineHeight: 1.5, marginBottom: '16px' }}>
|
|
This pattern is also known as off-canvas.
|
|
</div>
|
|
<BrowserFrame
|
|
content={(
|
|
<div
|
|
style={{
|
|
height: '100%',
|
|
position: 'relative',
|
|
width: '100%',
|
|
}}
|
|
>
|
|
<div
|
|
style={{
|
|
backgroundColor: 'rgba(0, 0, 0, 0.3)',
|
|
height: '100%',
|
|
left: 0,
|
|
position: 'absolute',
|
|
top: 0,
|
|
width: '100%',
|
|
}}
|
|
/>
|
|
<div
|
|
style={{
|
|
backgroundColor: '#fff',
|
|
height: '100%',
|
|
left: 0,
|
|
padding: '16px',
|
|
position: 'absolute',
|
|
top: 0,
|
|
width: '250px',
|
|
}}
|
|
>
|
|
<Block numberOfBlocks={20} />
|
|
</div>
|
|
</div>
|
|
)}
|
|
source={`
|
|
<div style="
|
|
/* Container takes full size */
|
|
height: 100%;
|
|
left: 0;
|
|
position: fixed;
|
|
top: 0;
|
|
width: 100%;
|
|
|
|
z-index: 9999;
|
|
">
|
|
<!-- Backdrop -->
|
|
<div style="
|
|
/* Take full size */
|
|
height: 100%;
|
|
left: 0;
|
|
position: fixed;
|
|
top: 0;
|
|
width: 100%;
|
|
|
|
/* User still can see the content of main page */
|
|
background-color: rgba(0, 0, 0, 0.5);
|
|
|
|
z-index: -1;
|
|
" />
|
|
|
|
<!-- Sidebar -->
|
|
<div style="
|
|
/* Take full height */
|
|
height: 100%;
|
|
left: 0;
|
|
position: fixed;
|
|
top: 0;
|
|
width: 200px;
|
|
|
|
/* Background */
|
|
background-color: #fff;
|
|
">
|
|
...
|
|
</div>
|
|
</div>
|
|
`}
|
|
/>
|
|
</div>
|
|
</DetailsLayout>
|
|
);
|
|
};
|
|
|
|
export default Details;
|