1
0
mirror of https://github.com/phuoc-ng/csslayout.git synced 2025-08-24 22:45:44 +02:00

Add slider

This commit is contained in:
Phuoc Nguyen
2019-11-17 22:36:39 +07:00
parent 2a9988b7f6
commit c5d0844a70
4 changed files with 109 additions and 0 deletions

View File

@@ -0,0 +1,21 @@
import React from 'react';
import Circle from '../../placeholders/Circle';
import Frame from '../../placeholders/Frame';
import Line from '../../placeholders/Line';
const Cover = () => {
return (
<Frame>
<div className="h-100 flex flex-column items-center justify-center">
<div className="flex items-center h1 w-80">
<div className="w-20"><Line /></div>
<Circle />
<div style={{ flex: 1 }}><Line /></div>
</div>
</div>
</Frame>
);
};
export default Cover;

View File

@@ -0,0 +1,79 @@
import React from 'react';
import DetailsLayout from '../../DetailsLayout';
import Circle from '../../placeholders/Circle';
import BrowserFrame from '../../placeholders/BrowserFrame';
import Rectangle from '../../placeholders/Rectangle';
import SampleCode from '../../SampleCode';
import useDocumentTitle from '../../hooks/useDocumentTitle';
const Details = () => {
useDocumentTitle('CSS Layout ∙ Slider');
return (
<DetailsLayout>
<h1 className="f1 tc">Slider</h1>
<BrowserFrame
content={
<div className="h-100 flex flex-column items-center justify-center">
<div className="flex items-center h1 w5">
<div className="w-20"><Rectangle height={2} /></div>
<Circle size={32} />
<div style={{ flex: 1 }}><Rectangle height={2} /></div>
</div>
</div>
}
source={
<SampleCode
lang="html"
code={`
<div style="
/* Content is centered horizontally */
align-items: center;
display: flex;
/* Size */
height: 32px;
">
<!-- Left side -->
<div style="
/* Width based on the current value */
height: 2px;
width: 20%;
/* Colors */
background-color: rgba(0, 0, 0, .3);
" />
<!-- Circle -->
<div style="
/* Size */
height: 32px;
width: 32px;
/* Rounded border */
border-radius: 9999px;
/* Colors */
background-color: rgba(0, 0, 0, .3);
" />
<!-- Right side -->
<div style="
/* Take the remaining width */
flex: 1;
height: 2px;
/* Colors */
background-color: rgba(0, 0, 0, .3);
" />
</div>
`}
/>
}
/>
</DetailsLayout>
);
};
export default Details;