diff --git a/client/patterns/arrow-buttons/Details.tsx b/client/patterns/arrow-buttons/Details.tsx index 779da39..0e03863 100644 --- a/client/patterns/arrow-buttons/Details.tsx +++ b/client/patterns/arrow-buttons/Details.tsx @@ -22,94 +22,43 @@ const Details: React.FC<{}> = () => { - - - - +`} +css={` +.container { /* Center the content */ align-items: center; display: flex; @@ -117,27 +66,44 @@ html={` /* Spacing */ padding: 8px; -"> - -
+ /* Size */ + height: 12px; + width: 12px; +} - - ... - -`} -css={` +.container__arrow--up { + /* Edges */ + border-left: 1px solid rgba(0, 0, 0, 0.3); + border-top: 1px solid rgba(0, 0, 0, 0.3); + transform: translateY(25%) rotate(45deg); +} + +.container__arrow--right { + /* Edges */ + border-right: 1px solid rgba(0, 0, 0, 0.3); + border-top: 1px solid rgba(0, 0, 0, 0.3); + transform: translateX(-25%) rotate(45deg); +} + +.container__arrow--down { + /* Edges */ + border-bottom: 1px solid rgba(0, 0, 0, 0.3); + border-right: 1px solid rgba(0, 0, 0, 0.3); + transform: translateY(-25%) rotate(45deg); +} + +.container__arrow--left { + /* Edges */ + border-bottom: 1px solid rgba(0, 0, 0, 0.3); + border-left: 1px solid rgba(0, 0, 0, 0.3); + transform: translateX(25%) rotate(45deg); +} `} >
= () => {
+
-
-
+
+
...
@@ -70,7 +54,29 @@ html={` ...
`} -css={``} +css={` +.container { + display: flex; +} + +.container__item { + /* Nagative margin make avatar overlap to previous one */ + margin-left: -4px; +} + +.container__avatar { + /* Add a white curve between avatars */ + box-shadow: 0 0 0 4px #FFF; + + /* Center the content */ + align-items: center; + display: flex; + justify-content: center; + + /* Rounded border */ + border-radius: 9999px; +} +`} >
= () => {
+ + +
+`} +css={` +.container { /* Rounded border */ border-radius: 50%; height: 64px; width: 64px; -"> - - -
+.container__avatar { + /* Rounded border */ + border-radius: 50%; + + /* Take full size */ + height: 100%; + width: 100%; +} `} -css={``} >
= () => {
+ ... +
+`} +css={` +.container { /* Center the content */ align-items: center; display: flex; @@ -35,11 +40,8 @@ html={` border-radius: 9999px; height: 32px; width: 32px; -"> - ... -
+} `} -css={``} >
= () => {
+
-
+
...
-
+
...
...
`} -css={``} +css={` +.container { + display: flex; + flex-direction: column; +} + +.container__cover { + height: 150px; + width: 100%; +} + +.container__content { + /* Take available height */ + flex: 1; +} +`} >
= () => {
+
...
`} -css={``} +css={` +.container { + align-items: center; + display: flex; + justify-content: center; +} +`} >
= () => {
+
+ +
+ +`} +css={` +.container { /* Reset */ background-color: transparent; border-color: transparent; @@ -35,39 +42,42 @@ html={` /* Used to position the inner */ position: relative; -"> -
+ /* Position */ + position: absolute; -
- + /* Size */ + height: 1px; + width: 100%; +} + +.container__line--second { + /* Position */ + left: 50%; + top: 0px; + transform: translate(-50%, 0%) rotate(45deg); + + /* Size */ + height: 100%; + width: 1px; +} `} -css={``} >
= () => {
+ +
+ ... +
+ + + ... +
+`} +css={` +.container { /* Banner is displayed at the bottom */ bottom: 0; left: 0; @@ -34,20 +45,13 @@ html={` align-items: center; display: flex; justify-content: center; -"> - -
- ... -
+} - - ... -
+.container__content { + /* Take available width */ + flex: 1; +} `} -css={``} >
= () => {
+
-
+
-
+
...
`} -css={``} +css={` +.container { + position: relative; +} + +.container__wrapper { + /* Displayed at the top left corner */ + left: 0px; + position: absolute; + top: 0px; + + /* Size */ + height: 100px; + width: 100px; + + /* Hide the part of its children which is displayed outside */ + overflow: hidden; +} + +.container__ribbon { + /* Position */ + left: -64px; + position: absolute; + top: 32px; + + /* Size */ + height: 24px; + width: 206px; + + /* Displayed diagonally */ + transform: rotate(-45deg); + + /* Background color */ + background-color: rgba(0, 0, 0, 0.3); + + /* Centerize the text content */ + text-align: center; +} +`} >
= () => {
+ ... +
+`} +css={` +.container { /* Background color */ background-color: rgba(0, 0, 0, 0.3); @@ -31,11 +36,8 @@ html={` /* Curved corners */ border-bottom-left-radius: 50% 40%; border-bottom-right-radius: 50% 40%; -"> - ... -
+} `} -css={``} >
= () => {
+
-
+
...
`} -css={``} +css={` +.container { + /* Used to position the diagonal area */ + position: relative; +} + +.container__diagonal { + /* Absolute position */ + left: 0px; + position: absolute; + top: 0px; + + /* Take full size */ + height: 100%; + width: 100%; + + /* Create diagonal sides */ + transform: skewY(-5deg); + + /* Background color */ + background-color: rgba(0, 0, 0, 0.3); + + /* Displayed under the main content */ + z-index: -1; +} +`} >
= () => {
+
-
+
...
...
`} -css={``} +css={` +.container { + position: relative; +} + +.container__docker { + position: absolute; + right: 0; + top: 0; + transform: translate(50%, -50%); + + /* Center the content */ + align-items: center; + display: flex; + justify-content: center; +} +`} >
= () => {
+
...
-
+
...
`} -css={``} +css={` +.container { + /* Center the content */ + align-items: center; + display: flex; + justify-content: center; +} + +.container__dots { + /* Bottom border */ + border-bottom: 1px dotted rgba(0, 0, 0, 0.3); + + /* Take remaining width */ + flex: 1; + + /* Spacing */ + margin: 0px 4px; +} +`} >
= () => {
+ ... +
+`} +css={` +.container { /* Center the content */ align-items: center; display: flex; @@ -30,11 +35,8 @@ html={` /* Border */ border: 4px dashed rgba(0, 0, 0, 0.3), border-radius: 4px; -"> - ... -
+} `} -css={``} >
= () => {
+
+ ... +
+`} +css={` /* Styles for the first letter */ -.p-drop-cap:first-letter { +.container:first-letter { /* Display at the left */ float: left; line-height: 1; @@ -37,13 +41,7 @@ html={` font-size: 64px; font-weight: 700; } - - -
- ... -
`} -css={``} >
= () => {
+
-
+
...
-
+
`} -css={``} +css={` +.container { + /* Used to position the faded element */ + position: relative; +} + +.container__content { + /* Height */ + height: 200px; + + /* Scrollable */ + overflow-y: scroll; +} + +.container__fading { + /* Displayed at the bottom */ + bottom: 0; + left: 0; + position: absolute; + + /* Size */ + height: 30px; + width: 100%; + + /* Gradient background */ + background: linear-gradient(rgba(255, 255, 255, 0.01), #fff); +} +`} >
= () => {
+
-
+
...
-
+
... `} -css={``} +css={` +.container { + align-items: center; + display: flex; + + /* Bottom border */ + border-bottom: 1px solid rgba(0, 0, 0, 0.3); + + /* Spacing */ + padding: 12px 0px; +} + +.container__feature { + /* Take available width */ + flex: 1; + + /* Spacing */ + margin-right: 16px; +} + +.container__model { + /* Center the content */ + display: flex; + justify-content: center; + + /* Spacing */ + margin-right: 16px; +} +`} >
= () => { -
+
-
+
...
-
+
...
@@ -53,7 +40,26 @@ html={` ... `} -css={``} +css={` +.container { + display: flex; + + /* OPTIONAL: Reverse the order of image and content */ + flex-direction: row-reverse; + + /* OPTIONAL: Spacing between items */ + margin: 16px 0; +} + +.container__image { + width: 128px; +} + +.container__feature { + /* Take the remaining width */ + flex: 1; +} +`} >
= () => {
+
-
+
...
-
+
...
-
+
...
-
+
...
`} -css={``} +css={` +.container { + position: relative; +} + +.container__corner { + position: absolute; +} + +.container__corner--tl { + left: 0; + top: 0; +} + +.container__corner--tr { + top: 0; + right: 0; +} + +.container__corner--br { + bottom: 0; + right: 0; +} + +.container__corner--bl { + bottom: 0; + left: 0; +} +`} >
diff --git a/client/patterns/fixed-at-side/Details.tsx b/client/patterns/fixed-at-side/Details.tsx index b74b17d..8ed71c2 100644 --- a/client/patterns/fixed-at-side/Details.tsx +++ b/client/patterns/fixed-at-side/Details.tsx @@ -23,16 +23,18 @@ const Details: React.FC<{}> = () => { -
+ ... +
+`} +css={` +.container { right: 0; position: fixed; top: 50%; transform: translate(0px, -50%); -"> - ... -
+} `} -css={``} >
= () => {
+ ... +
+`} +css={` +.container { /* Center the content */ align-items: center; display: flex; @@ -35,11 +40,8 @@ html={` /* Background */ background: url('/assets/full-background.jpeg') center center / cover no-repeat; -"> - ... -
+} `} -css={``} >
= () => {
+
+ + ... +
+
+`} +css={` +.container { /* Center the content */ display: inline-block; vertical-align: middle; @@ -42,20 +50,16 @@ html={` border-radius: 50%; height: 48px; width: 48px; -"> -
- - ... -
-
+} + +.container__letters { + /* Center the content */ + left: 50%; + position: absolute; + top: 50%; + transform: translate(-50%, -50%); +} `} -css={``} >
= () => {
+ ... + +`} +css={` +.container { /* Background and color */ background-color: rgba(0, 0, 0, 0.1); border-radius: 4px; color: rgba(0, 0, 0, 0.7); /* Bottom shadow */ - box-shadow: rgba(0, 0, 0, 0.3) 0px -2px 0px inset, rgba(0, 0, 0, 0.4) 0px 1px 1px; + box-shadow: rgba(0, 0, 0, 0.3) 0px -2px 0px inset, + rgba(0, 0, 0, 0.4) 0px 1px 1px; /* Spacing */ padding: 8px; -"> - ... - +} `} -css={``} >
= () => {
+ ... +
+`} +css={` +.container { /* Lined background */ background-image: linear-gradient(rgba(0, 0, 0, 0.3) 1px, transparent 0px); background-size: 100% 2em; @@ -31,11 +36,8 @@ html={` */ background-position-y: 24px; line-height: 2em; -"> - ... -
+} `} -css={``} >
= () => {
+
-
+
...
-
+
...
`} -css={``} +css={` +.container { + /* Align sub-items to top */ + align-items: start; + display: flex; +} + +.container__media { + margin-right: 16px; + + /* Set the width for the media object */ + width: 200px; +} + +.container__content { + /* Take the remaining width */ + flex: 1; +} +`} >
= () => {
+