diff --git a/client/constants/Pattern.ts b/client/constants/Pattern.ts index 42b1a97..eca63d2 100644 --- a/client/constants/Pattern.ts +++ b/client/constants/Pattern.ts @@ -56,6 +56,7 @@ enum Pattern { PresenceIndicator = 'Presence indicator', PreviousNextButtons = 'Previous next buttons', PricingTable = 'Pricing table', + PriceTag = 'Price tag', PropertyList = 'Property list', ProgressBar = 'Progress bar', QuestionsAndAnswers = 'Questions and answers', diff --git a/client/pages/ExplorePage.tsx b/client/pages/ExplorePage.tsx index 3326d05..73153ad 100644 --- a/client/pages/ExplorePage.tsx +++ b/client/pages/ExplorePage.tsx @@ -128,6 +128,7 @@ const ExplorePage = () => { + diff --git a/client/patterns/price-tag/Cover.tsx b/client/patterns/price-tag/Cover.tsx new file mode 100644 index 0000000..e7834cf --- /dev/null +++ b/client/patterns/price-tag/Cover.tsx @@ -0,0 +1,66 @@ +/** + * 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 ( + +
+
+
+
+ 99.9$ +
+
+ + ); +}; + +export default Cover; diff --git a/client/patterns/price-tag/Details.tsx b/client/patterns/price-tag/Details.tsx new file mode 100644 index 0000000..56cb403 --- /dev/null +++ b/client/patterns/price-tag/Details.tsx @@ -0,0 +1,111 @@ +/** + * 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 RelatedPatterns from '../../components/RelatedPatterns'; +import Pattern from '../../constants/Pattern'; +import DetailsLayout from '../../layouts/DetailsLayout'; +import BrowserFrame from '../../placeholders/BrowserFrame'; +import './price-tag.css'; + +const Details: React.FC<{}> = () => { + return ( + + + + + +
+ + ... +
+`} +css={` +:root { + --price-tag-background: rgba(0, 0, 0, 0.3); + --price-tag-height: 2rem; +} + +.price-tag { + background: var(--price-tag-background); + color: #FFF; + + /* Center the price */ + align-items: center; + display: flex; + justify-content: center; + + /* Used to position the triangle */ + position: relative; + + /* Size */ + height: var(--price-tag-height); + + /* Spacing */ + padding: 0.25rem 0.5rem; +} + +/* The triangle */ +.price-tag::before { + content: ''; + + border-color: transparent var(--price-tag-background) transparent transparent; + border-style: solid; + border-width: calc(var(--price-tag-height) / 2) + calc(var(--price-tag-height) / 2) + calc(var(--price-tag-height) / 2) + 0rem; + + /* Position */ + left: 0px; + position: absolute; + top: 0px; + transform: translate(-100%, 0px); +} + +/* The dot */ +.price-tag::after { + content: ''; + + /* Make it like a cirle */ + background: #FFF; + border-radius: 9999rem; + + /* Position */ + left: 0; + position: absolute; + top: 50%; + transform: translate(-0.5rem, -50%); + + /* Size */ + height: 0.5rem; + width: 0.5rem; +} +`} + > +
+
99.99$
+
+ +
+ + + + ); +}; + +export default Details; diff --git a/client/patterns/price-tag/price-tag.css b/client/patterns/price-tag/price-tag.css new file mode 100644 index 0000000..f7be3ec --- /dev/null +++ b/client/patterns/price-tag/price-tag.css @@ -0,0 +1,65 @@ +/** + * A collection of popular layouts and patterns made with CSS (https://csslayout.io) + * (c) 2019 - 2021 Nguyen Huu Phuoc + */ + +:root { + --price-tag-background: rgba(0, 0, 0, 0.3); + --price-tag-height: 2rem; +} + +.price-tag { + background: var(--price-tag-background); + color: #FFF; + + /* Center the price */ + align-items: center; + display: flex; + justify-content: center; + + /* Used to position the triangle */ + position: relative; + + /* Size */ + height: var(--price-tag-height); + + /* Spacing */ + padding: 0.25rem 0.5rem; +} + +/* The triangle */ +.price-tag::before { + content: ''; + + border-color: transparent var(--price-tag-background) transparent transparent; + border-style: solid; + border-width: calc(var(--price-tag-height) / 2) + calc(var(--price-tag-height) / 2) + calc(var(--price-tag-height) / 2) + 0rem; + + /* Position */ + left: 0px; + position: absolute; + top: 0px; + transform: translate(-100%, 0px); +} + +/* The dot */ +.price-tag::after { + content: ''; + + /* Make it like a cirle */ + background: #FFF; + border-radius: 9999rem; + + /* Position */ + left: 0; + position: absolute; + top: 50%; + transform: translate(-0.5rem, -50%); + + /* Size */ + height: 0.5rem; + width: 0.5rem; +} diff --git a/client/patterns/triangle-buttons/Details.tsx b/client/patterns/triangle-buttons/Details.tsx index b249662..228332a 100644 --- a/client/patterns/triangle-buttons/Details.tsx +++ b/client/patterns/triangle-buttons/Details.tsx @@ -238,7 +238,7 @@ css={`
- + ); }; diff --git a/public/sitemap.xml b/public/sitemap.xml index 9e0dcfc..76a5246 100644 --- a/public/sitemap.xml +++ b/public/sitemap.xml @@ -51,6 +51,7 @@ https://csslayout.io/patterns/popover-arrow https://csslayout.io/patterns/presence-indicator https://csslayout.io/patterns/previous-next-buttons + https://csslayout.io/patterns/price-tag https://csslayout.io/patterns/pricing-table https://csslayout.io/patterns/progress-bar https://csslayout.io/patterns/property-list