From 169d1a982c11dd39d6252b49980eeec646f1a97b Mon Sep 17 00:00:00 2001 From: Phuoc Nguyen Date: Sat, 8 May 2021 14:43:54 +0700 Subject: [PATCH] Add color swatch pattern --- client/constants/Pattern.ts | 1 + client/pages/ExplorePage.tsx | 1 + client/patterns/avatar/Details.tsx | 66 +++++++++---------- client/patterns/color-swatch/Cover.tsx | 42 ++++++++++++ client/patterns/color-swatch/Details.tsx | 84 ++++++++++++++++++++++++ 5 files changed, 160 insertions(+), 34 deletions(-) create mode 100644 client/patterns/color-swatch/Cover.tsx create mode 100644 client/patterns/color-swatch/Details.tsx diff --git a/client/constants/Pattern.ts b/client/constants/Pattern.ts index 51183e5..2087a26 100644 --- a/client/constants/Pattern.ts +++ b/client/constants/Pattern.ts @@ -17,6 +17,7 @@ enum Pattern { Chip = 'Chip', CircularNavigation = 'Circular navigation', CloseButton = 'Close button', + ColorSwatch = 'Color swatch', CookieBanner = 'Cookie banner', CornerRibbon = 'Corner ribbon', CurvedBackground = 'Curved background', diff --git a/client/pages/ExplorePage.tsx b/client/pages/ExplorePage.tsx index 331e598..b1346f5 100644 --- a/client/pages/ExplorePage.tsx +++ b/client/pages/ExplorePage.tsx @@ -119,6 +119,7 @@ const ExplorePage = () => { + diff --git a/client/patterns/avatar/Details.tsx b/client/patterns/avatar/Details.tsx index c63bf76..d910415 100644 --- a/client/patterns/avatar/Details.tsx +++ b/client/patterns/avatar/Details.tsx @@ -20,8 +20,7 @@ const Details: React.FC<{}> = () => { -
- @@ -45,48 +44,47 @@ css={` width: 100%; } `} + > +
-
- - - -
+ +
- -
+
+ diff --git a/client/patterns/color-swatch/Cover.tsx b/client/patterns/color-swatch/Cover.tsx new file mode 100644 index 0000000..4bfc7e7 --- /dev/null +++ b/client/patterns/color-swatch/Cover.tsx @@ -0,0 +1,42 @@ +/** + * A collection of popular layouts and patterns made with CSS (https://csslayout.io) + * (c) 2019 - 2021 Nguyen Huu Phuoc + */ + +import * as React from 'react'; + +import Frame from '../../placeholders/Frame'; + +const Cover: React.FC<{}> = () => { + return ( + +
+ { + Array(4).fill(0).map((_, index) => ( +
+ )) + } +
+ + ); +}; + +export default Cover; diff --git a/client/patterns/color-swatch/Details.tsx b/client/patterns/color-swatch/Details.tsx new file mode 100644 index 0000000..3fdf9ef --- /dev/null +++ b/client/patterns/color-swatch/Details.tsx @@ -0,0 +1,84 @@ +/** + * A collection of popular layouts and patterns made with CSS (https://csslayout.io) + * (c) 2019 - 2021 Nguyen Huu Phuoc + */ + +import * as React from 'react'; +import { Helmet } from 'react-helmet'; + +import Pattern from '../../constants/Pattern'; +import DetailsLayout from '../../layouts/DetailsLayout'; +import BrowserFrame from '../../placeholders/BrowserFrame'; + +const Details: React.FC<{}> = () => { + return ( + + + + + + + + +
+ + + ... +
+`} +css={` +.swatch { + /* Wrap the items */ + display: flex; + flex-wrap: wrap; +} +.swatch__item { + /* Rounded border */ + border-radius: 9999px; + height: 1.5rem; + width: 1.5rem; + + /* Space between items */ + margin: 0.5rem; +} +`} + > +
+
+ { + Array(9).fill(0).map((_, index) => ( +
+ )) + } +
+
+ + + ); +}; + +export default Details;