From a25da7d6cf496a617a4db16ce8d7155038ebbeac Mon Sep 17 00:00:00 2001 From: Belen Curcio Date: Mon, 5 Oct 2020 14:28:59 -0300 Subject: [PATCH] Transitions --- components/core/Navbar/Navbar.module.css | 4 + components/core/Navbar/Navbar.tsx | 15 ++- components/icon/Heart.tsx | 2 +- .../ProductCard/ProductCard.module.css | 64 +++++++++- .../product/ProductCard/ProductCard.tsx | 44 ++++--- components/ui/Grid/Grid.module.css | 112 +++++++++++------- components/ui/Grid/Grid.tsx | 4 + pages/index.tsx | 2 +- 8 files changed, 178 insertions(+), 69 deletions(-) diff --git a/components/core/Navbar/Navbar.module.css b/components/core/Navbar/Navbar.module.css index 7f08b4c9c..5db900503 100644 --- a/components/core/Navbar/Navbar.module.css +++ b/components/core/Navbar/Navbar.module.css @@ -1,3 +1,7 @@ .root { @apply flex justify-between items-center flex-row px-6 h-20 relative; } + +.link { + @apply group text-gray-500 inline-flex items-center text-base leading-6 font-medium hover:text-gray-900 focus:outline-none focus:text-gray-900 transition ease-in-out duration-150 cursor-pointer; +} diff --git a/components/core/Navbar/Navbar.tsx b/components/core/Navbar/Navbar.tsx index 5c5a96dc3..fc7df560c 100644 --- a/components/core/Navbar/Navbar.tsx +++ b/components/core/Navbar/Navbar.tsx @@ -4,6 +4,7 @@ import s from './Navbar.module.css' import { Logo, Container } from '@components/ui' import { Searchbar } from '@components/core' import { UserNav } from '@components/core' +import Link from 'next/link' interface Props { className?: string } @@ -12,12 +13,16 @@ const Navbar: FC = ({ className }) => { const rootClassName = cn(s.root, className) return ( - + +

+ +

+
-
diff --git a/components/icon/Heart.tsx b/components/icon/Heart.tsx index 9c8b9162b..afa2f6aaa 100644 --- a/components/icon/Heart.tsx +++ b/components/icon/Heart.tsx @@ -10,7 +10,7 @@ const Heart = ({ ...props }) => { > = ({ className, node: productData }) => { const rootClassName = cn(s.root, className) return ( -
-
-
-
-

{productData.name}

-
-
-
- ${productData.prices.price.value} + +
+
+ +
+
+
+
+
+

{productData.name}

+
+
+
+ ${productData.prices.price.value} +
-
-
- +
+ +
-
+ ) } diff --git a/components/ui/Grid/Grid.module.css b/components/ui/Grid/Grid.module.css index 632af9ca3..a61c42b80 100644 --- a/components/ui/Grid/Grid.module.css +++ b/components/ui/Grid/Grid.module.css @@ -3,7 +3,7 @@ @apply grid grid-cols-1 lg:grid-cols-3 lg:grid-rows-2 gap-0; & > * { - @apply row-span-1 lg:col-span-1 bg-black box-border overflow-hidden; + @apply row-span-1 lg:col-span-1 bg-transparent box-border overflow-hidden; height: 500px; max-height: 800px; @@ -13,83 +13,115 @@ } } +.default { + & > * { + @apply bg-transparent; + } +} + .layoutNormal { @apply gap-6; & > * { min-height: 325px; - @apply bg-white; } } .layoutA { - & > div:nth-child(6n + 1), - & > div:nth-child(6n + 5) { - @apply row-span-2 lg:col-span-2 bg-violet; + & > *:nth-child(6n + 1), + & > *:nth-child(6n + 5) { + @apply row-span-2 lg:col-span-2; height: var(--row-height); } - & > div:nth-child(6n + 5) { - @apply bg-blue; - } + &.filled { + & > *:nth-child(6n + 1), + & > *:nth-child(6n + 5) { + @apply bg-violet; + } - & > div:nth-child(6n + 3) { - @apply bg-pink; - } + & > *:nth-child(6n + 5) { + @apply bg-blue; + } - & > div:nth-child(6n + 6) { - @apply bg-cyan; + & > *:nth-child(6n + 3) { + @apply bg-pink; + } + + & > *:nth-child(6n + 6) { + @apply bg-cyan; + } } } .layoutB { - & > div:nth-child(6n + 2) { - @apply row-span-2 lg:col-span-2 bg-blue; + & > *:nth-child(6n + 2), + & > *:nth-child(6n + 4) { + @apply row-span-2 lg:col-span-2; height: var(--row-height); } - & > div:nth-child(6n + 4) { - @apply row-span-2 lg:col-span-2 bg-violet; - height: var(--row-height); - } + &.filled { + & > *:nth-child(6n + 2) { + @apply bg-blue; + } - & > div:nth-child(6n + 3) { - @apply bg-pink; - } + & > *:nth-child(6n + 4) { + @apply bg-violet; + } - & > div:nth-child(6n + 6) { - @apply bg-cyan; + & > *:nth-child(6n + 3) { + @apply bg-pink; + } + + & > *:nth-child(6n + 6) { + @apply bg-cyan; + } } } .layoutC { - & > div:nth-child(12n + 1) { - @apply row-span-2 lg:col-span-2 bg-violet; + & > *:nth-child(12n + 1), + & > *:nth-child(12n + 8) { + @apply row-span-2 lg:col-span-2; height: var(--row-height); } - & > div:nth-child(12n + 8) { - @apply row-span-2 lg:col-span-2 bg-cyan; - height: var(--row-height); - } + &.filled { + & > *:nth-child(12n + 1) { + @apply bg-violet; + height: var(--row-height); + } - & > div:nth-child(6n + 3) { - @apply bg-pink; + & > *:nth-child(12n + 8) { + @apply bg-cyan; + height: var(--row-height); + } + + & > *:nth-child(6n + 3) { + @apply bg-pink; + } } } .layoutD { - & > div:nth-child(12n + 2) { - @apply row-span-2 lg:col-span-2 bg-violet; + & > *:nth-child(12n + 2), + & > *:nth-child(12n + 7) { + @apply row-span-2 lg:col-span-2; height: var(--row-height); } - & > div:nth-child(12n + 7) { - @apply row-span-2 lg:col-span-2 bg-cyan; - height: var(--row-height); - } + &.filled { + & > *:nth-child(12n + 2) { + @apply bg-violet; + } - & > div:nth-child(6n + 3) { - @apply bg-pink; + & > *:nth-child(12n + 7) { + @apply bg-cyan; + } + + & > *:nth-child(6n + 3) { + @apply bg-pink; + } } } diff --git a/components/ui/Grid/Grid.tsx b/components/ui/Grid/Grid.tsx index 2ef6cddd8..ab41fde06 100644 --- a/components/ui/Grid/Grid.tsx +++ b/components/ui/Grid/Grid.tsx @@ -8,6 +8,7 @@ interface Props { items: [any] | any layout?: 'A' | 'B' | 'C' | 'D' | 'normal' wrapper?: ReactNode | Component | any + variant?: 'default' | 'filled' } const DefaultWrapper: FC = ({ children }) =>
{children}
// DEFAULT ITEMS WRAPPER @@ -17,6 +18,7 @@ const Grid: FC = ({ className, layout = 'A', wrapper: Component = DefaultWrapper, + variant = 'default', }) => { const rootClassName = cn( s.root, @@ -26,6 +28,8 @@ const Grid: FC = ({ [s.layoutC]: layout === 'C', [s.layoutD]: layout === 'D', [s.layoutNormal]: layout === 'normal', + [s.default]: variant === 'default', + [s.filled]: variant === 'filled', }, className ) diff --git a/pages/index.tsx b/pages/index.tsx index 15c6d3aec..7661e3c42 100644 --- a/pages/index.tsx +++ b/pages/index.tsx @@ -63,7 +63,7 @@ export default function Home({ )} />
-
+
ALL CATEGORIES ACCESSORIES BAGS CLOTHING SHOES ALL DESIGNERS 032c 1017