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

Add related patterns for timeline

This commit is contained in:
Phuoc Nguyen
2021-04-19 22:01:13 +07:00
parent 692e3a2adb
commit 0bcac36df7
2 changed files with 105 additions and 103 deletions

View File

@@ -7,6 +7,7 @@ import * as React from 'react';
import { Helmet } from 'react-helmet';
import Pattern from '../../constants/Pattern';
import RelatedPatterns from '../../components/RelatedPatterns';
import DetailsLayout from '../../layouts/DetailsLayout';
import Block from '../../placeholders/Block';
import BrowserFrame from '../../placeholders/BrowserFrame';
@@ -22,8 +23,7 @@ const Details: React.FC<{}> = () => {
<meta name="twitter:description" content="Create a timeline with CSS flexbox" />
<meta name="keywords" content="css flexbox, css timeline" />
</Helmet>
<div className='p-8 pb-20'>
<BrowserFrame
<BrowserFrame
html={`
<div class="container">
<!-- Left vertical line -->
@@ -111,77 +111,78 @@ css={`
margin-left: 48px;
}
`}
>
<div
style={{
alignItems: 'center',
display: 'flex',
flexDirection: 'column',
height: '100%',
justifyContent: 'center',
padding: '8px',
}}
>
<div
style={{
alignItems: 'center',
display: 'flex',
flexDirection: 'column',
height: '100%',
justifyContent: 'center',
padding: '8px',
position: 'relative',
width: '60%',
}}
>
<div
style={{
position: 'relative',
width: '60%',
borderRight: '2px solid #aaa',
height: '100%',
left: '16px',
position: 'absolute',
top: 0,
}}
/>
<ul
style={{
listStyleType: 'none',
margin: 0,
padding: 0,
}}
>
<div
style={{
borderRight: '2px solid #aaa',
height: '100%',
left: '16px',
position: 'absolute',
top: 0,
}}
/>
<ul
style={{
listStyleType: 'none',
margin: 0,
padding: 0,
}}
>
<li style={{ marginBottom: '8px' }}>
<div style={{ alignItems: 'center', display: 'flex', marginBottom: '4px' }}>
<Circle backgroundColor='#aaa' size={32} />
<div style={{ flex: 1, marginLeft: '16px' }}>
<div style={{ width: '80%' }}><Rectangle /></div>
</div>
<li style={{ marginBottom: '8px' }}>
<div style={{ alignItems: 'center', display: 'flex', marginBottom: '4px' }}>
<Circle backgroundColor='#aaa' size={32} />
<div style={{ flex: 1, marginLeft: '16px' }}>
<div style={{ width: '80%' }}><Rectangle /></div>
</div>
<div style={{ marginLeft: '48px' }}>
<Block numberOfBlocks={10} blockHeight={2} />
</div>
<div style={{ marginLeft: '48px' }}>
<Block numberOfBlocks={10} blockHeight={2} />
</div>
</li>
<li style={{ marginBottom: '8px' }}>
<div style={{ alignItems: 'center', display: 'flex', marginBottom: '4px' }}>
<Circle backgroundColor='#aaa' size={32} />
<div style={{ flex: 1, marginLeft: '16px' }}>
<div style={{ width: '60%' }}><Rectangle /></div>
</div>
</li>
<li style={{ marginBottom: '8px' }}>
<div style={{ alignItems: 'center', display: 'flex', marginBottom: '4px' }}>
<Circle backgroundColor='#aaa' size={32} />
<div style={{ flex: 1, marginLeft: '16px' }}>
<div style={{ width: '60%' }}><Rectangle /></div>
</div>
</div>
<div style={{ marginLeft: '48px' }}>
<Block numberOfBlocks={15} blockHeight={2} />
</div>
</li>
<li style={{ marginBottom: '8px' }}>
<div style={{ alignItems: 'center', display: 'flex', marginBottom: '4px' }}>
<Circle backgroundColor='#aaa' size={32} />
<div style={{ flex: 1, marginLeft: '16px' }}>
<div style={{ width: '60%' }}><Rectangle /></div>
</div>
<div style={{ marginLeft: '48px' }}>
<Block numberOfBlocks={15} blockHeight={2} />
</div>
</li>
<li style={{ marginBottom: '8px' }}>
<div style={{ alignItems: 'center', display: 'flex', marginBottom: '4px' }}>
<Circle backgroundColor='#aaa' size={32} />
<div style={{ flex: 1, marginLeft: '16px' }}>
<div style={{ width: '60%' }}><Rectangle /></div>
</div>
</div>
<div style={{ marginLeft: '48px' }}>
<Block numberOfBlocks={10} blockHeight={2} />
</div>
</li>
</ul>
</div>
</div>
<div style={{ marginLeft: '48px' }}>
<Block numberOfBlocks={10} blockHeight={2} />
</div>
</li>
</ul>
</div>
</BrowserFrame>
</div>
</div>
</BrowserFrame>
<RelatedPatterns patterns={[Pattern.ZigzagTimeline]} />
</DetailsLayout>
);
};

View File

@@ -7,6 +7,7 @@ import * as React from 'react';
import { Helmet } from 'react-helmet';
import Pattern from '../../constants/Pattern';
import RelatedPatterns from '../../components/RelatedPatterns';
import DetailsLayout from '../../layouts/DetailsLayout';
import Block from '../../placeholders/Block';
import BrowserFrame from '../../placeholders/BrowserFrame';
@@ -23,8 +24,7 @@ const Details: React.FC<{}> = () => {
<meta name="twitter:description" content="Create a zigzag timeline" />
<meta name="keywords" content="css timeline, css zigzag timeline" />
</Helmet>
<div className='p-8 pb-20'>
<BrowserFrame
<BrowserFrame
html={`
<div class="zigzag-timeline__item">
<!-- Milestone -->
@@ -82,52 +82,53 @@ css={`
transform: translate(50%, -50%);
}
`}
>
<div
style={{
alignItems: 'center',
display: 'flex',
flexDirection: 'column',
height: '100%',
justifyContent: 'center',
margin: '0 auto',
padding: '0.5rem',
width: '60%',
}}
>
<div
style={{
alignItems: 'center',
display: 'flex',
flexDirection: 'column',
height: '100%',
justifyContent: 'center',
margin: '0 auto',
padding: '0.5rem',
width: '60%',
className='zigzag-timeline__item'
style={{
padding: '1rem 1.5rem',
}}
>
<div
className='zigzag-timeline__item'
style={{
padding: '1rem 1.5rem',
}}
>
<div className='zigzag-timeline__milestone'/>
<div style={{ marginBottom: '1rem', width: '80%' }}><Rectangle /></div>
<Block numberOfBlocks={10} />
</div>
<div
className='zigzag-timeline__item'
style={{
padding: '1rem 1.5rem',
}}
>
<div className='zigzag-timeline__milestone' />
<div style={{ marginBottom: '1rem', width: '60%' }}><Rectangle /></div>
<Block numberOfBlocks={20} />
</div>
<div
className='zigzag-timeline__item'
style={{
padding: '1rem 1.5rem',
}}
>
<div className='zigzag-timeline__milestone' />
<div style={{ marginBottom: '1rem', width: '70%' }}><Rectangle /></div>
<Block numberOfBlocks={15} />
</div>
<div className='zigzag-timeline__milestone'/>
<div style={{ marginBottom: '1rem', width: '80%' }}><Rectangle /></div>
<Block numberOfBlocks={10} />
</div>
</BrowserFrame>
</div>
<div
className='zigzag-timeline__item'
style={{
padding: '1rem 1.5rem',
}}
>
<div className='zigzag-timeline__milestone' />
<div style={{ marginBottom: '1rem', width: '60%' }}><Rectangle /></div>
<Block numberOfBlocks={20} />
</div>
<div
className='zigzag-timeline__item'
style={{
padding: '1rem 1.5rem',
}}
>
<div className='zigzag-timeline__milestone' />
<div style={{ marginBottom: '1rem', width: '70%' }}><Rectangle /></div>
<Block numberOfBlocks={15} />
</div>
</div>
</BrowserFrame>
<RelatedPatterns patterns={[Pattern.Timeline]} />
</DetailsLayout>
);
};