mirror of
https://github.com/phuoc-ng/csslayout.git
synced 2025-08-16 02:54:20 +02:00
Add statistic pattern
This commit is contained in:
@@ -68,6 +68,7 @@ enum Pattern {
|
|||||||
SplitNavigation = 'Split navigation',
|
SplitNavigation = 'Split navigation',
|
||||||
SplitScreen = 'Split screen',
|
SplitScreen = 'Split screen',
|
||||||
StackedCards = 'Stacked cards',
|
StackedCards = 'Stacked cards',
|
||||||
|
Statistic = 'Statistic',
|
||||||
StepperInput = 'Stepper input',
|
StepperInput = 'Stepper input',
|
||||||
StickyFooter = 'Sticky footer',
|
StickyFooter = 'Sticky footer',
|
||||||
StickyHeader = 'Sticky header',
|
StickyHeader = 'Sticky header',
|
||||||
|
@@ -174,6 +174,7 @@ const ExplorePage = () => {
|
|||||||
<CoverCard pattern={Pattern.Ribbon} />
|
<CoverCard pattern={Pattern.Ribbon} />
|
||||||
<CoverCard pattern={Pattern.Separator} />
|
<CoverCard pattern={Pattern.Separator} />
|
||||||
<CoverCard pattern={Pattern.StackedCards} />
|
<CoverCard pattern={Pattern.StackedCards} />
|
||||||
|
<CoverCard pattern={Pattern.Statistic} />
|
||||||
<CoverCard pattern={Pattern.StickyTableColumn} />
|
<CoverCard pattern={Pattern.StickyTableColumn} />
|
||||||
<CoverCard pattern={Pattern.StickyTableHeaders} />
|
<CoverCard pattern={Pattern.StickyTableHeaders} />
|
||||||
<CoverCard pattern={Pattern.Teardrop} />
|
<CoverCard pattern={Pattern.Teardrop} />
|
||||||
|
43
client/patterns/statistic/Cover.tsx
Normal file
43
client/patterns/statistic/Cover.tsx
Normal file
@@ -0,0 +1,43 @@
|
|||||||
|
/**
|
||||||
|
* A collection of popular layouts and patterns made with CSS (https://csslayout.io)
|
||||||
|
* (c) 2019 - 2020 Nguyen Huu Phuoc <https://twitter.com/nghuuphuoc>
|
||||||
|
*/
|
||||||
|
|
||||||
|
import React from 'react';
|
||||||
|
|
||||||
|
import Frame from '../../placeholders/Frame';
|
||||||
|
|
||||||
|
const Cover: React.FC<{}> = () => {
|
||||||
|
return (
|
||||||
|
<Frame>
|
||||||
|
<div
|
||||||
|
style={{
|
||||||
|
alignItems: 'center',
|
||||||
|
display: 'flex',
|
||||||
|
flexDirection: 'column',
|
||||||
|
height: '100%',
|
||||||
|
justifyContent: 'center',
|
||||||
|
padding: '8px',
|
||||||
|
}}
|
||||||
|
>
|
||||||
|
<div
|
||||||
|
style={{
|
||||||
|
alignItems: 'center',
|
||||||
|
display: 'inline-flex',
|
||||||
|
flexDirection: 'column',
|
||||||
|
justifyContent: 'center',
|
||||||
|
}}
|
||||||
|
>
|
||||||
|
<div style={{ color: 'rgba(0, 0, 0, 0.7)', fontSize: '2.5rem', fontWeight: 500 }}>
|
||||||
|
1k+
|
||||||
|
</div>
|
||||||
|
<div style={{ color: 'rgba(0, 0, 0, 0.4)', fontSize: '.75rem', textTransform: 'uppercase' }}>
|
||||||
|
stars
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</Frame>
|
||||||
|
);
|
||||||
|
};
|
||||||
|
|
||||||
|
export default Cover;
|
84
client/patterns/statistic/Details.tsx
Normal file
84
client/patterns/statistic/Details.tsx
Normal file
@@ -0,0 +1,84 @@
|
|||||||
|
/**
|
||||||
|
* A collection of popular layouts and patterns made with CSS (https://csslayout.io)
|
||||||
|
* (c) 2019 - 2020 Nguyen Huu Phuoc <https://twitter.com/nghuuphuoc>
|
||||||
|
*/
|
||||||
|
|
||||||
|
import React from 'react';
|
||||||
|
import { Helmet } from 'react-helmet';
|
||||||
|
|
||||||
|
import random from '../../helpers/random';
|
||||||
|
import DetailsLayout from '../../layouts/DetailsLayout';
|
||||||
|
import BrowserFrame from '../../placeholders/BrowserFrame';
|
||||||
|
|
||||||
|
const Details: React.FC<{}> = () => {
|
||||||
|
return (
|
||||||
|
<DetailsLayout title="Statistic">
|
||||||
|
<Helmet>
|
||||||
|
<meta name="description" content="Create a statistic component with CSS flexbox" />
|
||||||
|
<meta name="keywords" content="css flexbox, css statistic" />
|
||||||
|
</Helmet>
|
||||||
|
<div style={{ padding: '64px 32px' }}>
|
||||||
|
<BrowserFrame
|
||||||
|
content={(
|
||||||
|
<div
|
||||||
|
style={{
|
||||||
|
alignItems: 'center',
|
||||||
|
display: 'flex',
|
||||||
|
flexDirection: 'column',
|
||||||
|
height: '100%',
|
||||||
|
justifyContent: 'center',
|
||||||
|
padding: '8px',
|
||||||
|
}}
|
||||||
|
>
|
||||||
|
<div
|
||||||
|
style={{
|
||||||
|
alignItems: 'center',
|
||||||
|
display: 'inline-flex',
|
||||||
|
flexDirection: 'column',
|
||||||
|
}}
|
||||||
|
>
|
||||||
|
<div style={{ fontSize: '4rem', fontWeight: 500 }}>
|
||||||
|
{random(1000, 9999).toLocaleString()}
|
||||||
|
</div>
|
||||||
|
<div style={{ fontSize: '1rem', fontWeight: 700, textTransform: 'uppercase' }}>
|
||||||
|
stars
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
)}
|
||||||
|
source={`
|
||||||
|
<div style="
|
||||||
|
/* Center the content */
|
||||||
|
align-items: center;
|
||||||
|
display: inline-flex;
|
||||||
|
flex-direction: column;
|
||||||
|
">
|
||||||
|
<!-- Value -->
|
||||||
|
<div style="
|
||||||
|
/* Big font size */
|
||||||
|
font-size: 4rem;
|
||||||
|
font-weight: 500;
|
||||||
|
">
|
||||||
|
...
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<!-- Label -->
|
||||||
|
<div style="
|
||||||
|
/* Smaller font size */
|
||||||
|
font-size: 1rem;
|
||||||
|
font-weight: 700;
|
||||||
|
|
||||||
|
/* Uppercase the label */
|
||||||
|
text-transform: uppercase;
|
||||||
|
">
|
||||||
|
...
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
`}
|
||||||
|
/>
|
||||||
|
</div>
|
||||||
|
</DetailsLayout>
|
||||||
|
);
|
||||||
|
};
|
||||||
|
|
||||||
|
export default Details;
|
@@ -64,6 +64,7 @@
|
|||||||
<url><loc>https://csslayout.io/patterns/split-navigation</loc></url>
|
<url><loc>https://csslayout.io/patterns/split-navigation</loc></url>
|
||||||
<url><loc>https://csslayout.io/patterns/split-screen</loc></url>
|
<url><loc>https://csslayout.io/patterns/split-screen</loc></url>
|
||||||
<url><loc>https://csslayout.io/patterns/stacked-cards</loc></url>
|
<url><loc>https://csslayout.io/patterns/stacked-cards</loc></url>
|
||||||
|
<url><loc>https://csslayout.io/patterns/statistic</loc></url>
|
||||||
<url><loc>https://csslayout.io/patterns/stepper-input</loc></url>
|
<url><loc>https://csslayout.io/patterns/stepper-input</loc></url>
|
||||||
<url><loc>https://csslayout.io/patterns/sticky-footer</loc></url>
|
<url><loc>https://csslayout.io/patterns/sticky-footer</loc></url>
|
||||||
<url><loc>https://csslayout.io/patterns/sticky-header</loc></url>
|
<url><loc>https://csslayout.io/patterns/sticky-header</loc></url>
|
||||||
|
Reference in New Issue
Block a user