Merge pull request #6 from okbel/arzafran/homepage-tweaks
General UI Tweaks
This commit is contained in:
		| @@ -12,12 +12,12 @@ | ||||
|  | ||||
|   --hover: rgba(0, 0, 0, 0.075); | ||||
|  | ||||
|   --cyan: #50e3c2; | ||||
|   --cyan: #22b8cf; | ||||
|   --green: #37b679; | ||||
|   --red: #da3c3c; | ||||
|   --pink: #ff0080; | ||||
|   --pink: #e64980; | ||||
|   --purple: #f81ce5; | ||||
|   --violet: #7928ca; | ||||
|   --violet: #5f3dc4; | ||||
|   --blue: #0070f3; | ||||
|  | ||||
|   --accents-0: #f8f9fa; | ||||
|   | ||||
| @@ -1,9 +0,0 @@ | ||||
| .separator { | ||||
|   @apply mx-3 bg-secondary; | ||||
|   width: 1px; | ||||
|   height: 20px; | ||||
| } | ||||
|  | ||||
| .separator:before { | ||||
|   content: ''; | ||||
| } | ||||
| @@ -1,6 +1,5 @@ | ||||
| import cn from 'classnames' | ||||
| import { FC } from 'react' | ||||
| import s from './Featurebar.module.css' | ||||
|  | ||||
| interface Props { | ||||
|   className?: string | ||||
| @@ -18,15 +17,16 @@ const Featurebar: FC<Props> = ({ | ||||
|   hide, | ||||
| }) => { | ||||
|   const rootClassName = cn( | ||||
|     'transition-transform transform duration-500 ease-out p-6 bg-primary text-base text-sm md:flex flex-row justify-center items-center font-medium fixed bottom-0 w-full z-10', | ||||
|     'transition-transform transform duration-500 text-center ease-out p-6 bg-primary text-base text-sm md:flex md:text-left flex-row justify-center items-center font-medium fixed bottom-0 w-full z-10', | ||||
|     { 'translate-y-full': hide }, | ||||
|     className | ||||
|   ) | ||||
|   return ( | ||||
|     <div className={rootClassName}> | ||||
|       <span>{title}</span> | ||||
|       <span className={s.separator} /> | ||||
|       <span>{description}</span> | ||||
|       <span className="block md:inline">{title}</span> | ||||
|       <span className="block mb-6 md:inline md:mb-0 md:ml-2"> | ||||
|         {description} | ||||
|       </span> | ||||
|       {action && action} | ||||
|     </div> | ||||
|   ) | ||||
|   | ||||
| @@ -33,12 +33,12 @@ const Layout: FC<Props> = ({ children, pageProps }) => { | ||||
|         <Featurebar | ||||
|           title="This site uses cookies to improve your experience." | ||||
|           description="By clicking, you agree to our Privacy Policy." | ||||
|           hide={acceptedCookies} | ||||
|           action={ | ||||
|             <Button className="mx-5" onClick={() => setAcceptedCookies(true)}> | ||||
|               Accept cookies | ||||
|             </Button> | ||||
|           } | ||||
|           className={cn({ ['translate-y-full']: acceptedCookies })} | ||||
|         /> | ||||
|       </div> | ||||
|     </CommerceProvider> | ||||
|   | ||||
| @@ -1,7 +1,6 @@ | ||||
| import s from './Navbar.module.css' | ||||
| import { FC } from 'react' | ||||
| import Link from 'next/link' | ||||
| import { useTheme } from 'next-themes' | ||||
| import { Logo } from '@components/ui' | ||||
| import { Searchbar, UserNav } from '@components/core' | ||||
| interface Props { | ||||
|   | ||||
| @@ -2,8 +2,12 @@ | ||||
|   @apply relative w-full box-border overflow-hidden bg-no-repeat bg-center bg-cover transition ease-linear cursor-pointer; | ||||
|  | ||||
|   &:hover { | ||||
|     & .squareBg { | ||||
|       @apply scale-75; | ||||
|     & .squareBg:before { | ||||
|       transform: scale(0.98); | ||||
|     } | ||||
|  | ||||
|     & .product-image { | ||||
|       transform: scale(1.05); | ||||
|     } | ||||
|  | ||||
|     & .productTitle > span, | ||||
| @@ -37,6 +41,10 @@ | ||||
|     } | ||||
|   } | ||||
|  | ||||
|   & .product-image { | ||||
|     @apply transform transition-transform duration-500; | ||||
|   } | ||||
|  | ||||
|   &:nth-child(6n + 1) .squareBg { | ||||
|     @apply bg-violet; | ||||
|   } | ||||
| @@ -58,16 +66,23 @@ | ||||
| .productTitle > span, | ||||
| .productPrice, | ||||
| .wishlistButton { | ||||
|   @apply transition ease-in-out duration-300; | ||||
|   @apply transition ease-in-out duration-500; | ||||
| } | ||||
|  | ||||
| .squareBg { | ||||
|   @apply transform absolute inset-0 z-0 bg-secondary; | ||||
|   @apply transform absolute inset-0 z-0; | ||||
|   background-color: #212529; | ||||
| } | ||||
|  | ||||
| .squareBg:before { | ||||
|   @apply transition ease-in-out duration-500 bg-repeat-space w-full h-full block; | ||||
|   content: ''; | ||||
|   background-image: url("data:image/svg+xml,%3Csvg width='48' height='46' viewBox='0 0 48 46' fill='none' xmlns='http://www.w3.org/2000/svg'%3E%3Cline opacity='0.1' x1='9.41421' y1='8' x2='21' y2='19.5858' stroke='white' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'/%3E%3Cline opacity='0.1' x1='1' y1='-1' x2='17.3848' y2='-1' transform='matrix(-0.707107 0.707107 0.707107 0.707107 40 8)' stroke='white' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'/%3E%3Cline opacity='0.1' x1='1' y1='-1' x2='17.3848' y2='-1' transform='matrix(0.707107 -0.707107 -0.707107 -0.707107 8 38)' stroke='white' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'/%3E%3Cline opacity='0.1' x1='38.5858' y1='38' x2='27' y2='26.4142' stroke='white' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E%0A"); | ||||
| } | ||||
|  | ||||
| .simple { | ||||
|   & .squareBg { | ||||
|     @apply bg-gray-300 !important; | ||||
|     @apply bg-accents-0 !important; | ||||
|   } | ||||
|  | ||||
|   & .productTitle { | ||||
| @@ -102,5 +117,5 @@ | ||||
| } | ||||
|  | ||||
| .wishlistButton { | ||||
|   @apply w-10 h-10 flex items-center justify-center bg-primary text-base font-semibold inline-block text-xs leading-6 cursor-pointer; | ||||
|   @apply w-10 h-10 flex ml-auto items-center justify-center bg-primary text-base font-semibold inline-block text-xs leading-6 cursor-pointer; | ||||
| } | ||||
|   | ||||
| @@ -36,7 +36,7 @@ const ProductCard: FC<Props> = ({ className, product: p, variant }) => { | ||||
|       > | ||||
|         <div className="absolute z-10 inset-0 flex items-center justify-center"> | ||||
|           <img | ||||
|             className="w-full object-cover" | ||||
|             className={cn('w-full object-cover', s['product-image'])} | ||||
|             src={p.images.edges?.[0]?.node.urlXL} | ||||
|           /> | ||||
|         </div> | ||||
|   | ||||
		Reference in New Issue
	
	Block a user