diff --git a/next-env.d.ts b/next-env.d.ts index 9bc3dd46b..c6643fda1 100644 --- a/next-env.d.ts +++ b/next-env.d.ts @@ -1,6 +1,3 @@ /// /// /// - -// NOTE: This file should not be edited -// see https://nextjs.org/docs/basic-features/typescript for more information. diff --git a/public/fonts/Norquay-bold.otf b/public/fonts/Norquay-bold.otf new file mode 100644 index 000000000..37212fd9f Binary files /dev/null and b/public/fonts/Norquay-bold.otf differ diff --git a/public/fonts/Norquay-bold.woff b/public/fonts/Norquay-bold.woff new file mode 100644 index 000000000..28564d5d4 Binary files /dev/null and b/public/fonts/Norquay-bold.woff differ diff --git a/public/fonts/style.css b/public/fonts/style.css new file mode 100644 index 000000000..53f6af31e --- /dev/null +++ b/public/fonts/style.css @@ -0,0 +1,4 @@ +@font-face { + font-family: "Norquay-bold"; + src: url("./Norquay-bold.otf") format("opentype"), url("./Norquay-bold.woff") format("woff"); +} diff --git a/src/components/common/Banner/Banner.tsx b/src/components/common/Banner/Banner.tsx index 410fded77..e8c86f53e 100644 --- a/src/components/common/Banner/Banner.tsx +++ b/src/components/common/Banner/Banner.tsx @@ -8,7 +8,6 @@ interface Props { const option = { slidesPerView: 1, - mode: 'free', } const Banner = memo(({ data }: Props) => { if (data.length === 1) { diff --git a/src/components/common/CarouselCommon/CarouselCommon.module.scss b/src/components/common/CarouselCommon/CarouselCommon.module.scss index ef2671947..4b3c7d537 100644 --- a/src/components/common/CarouselCommon/CarouselCommon.module.scss +++ b/src/components/common/CarouselCommon/CarouselCommon.module.scss @@ -9,6 +9,7 @@ width: 64px; height: 64px; border-radius: .8rem; + backdrop-filter: saturate(180%) blur(10px); &:focus { outline: none; } diff --git a/src/components/common/CartDrawer/CartDrawer.module.scss b/src/components/common/CartDrawer/CartDrawer.module.scss index d5bba6c57..8d97f971e 100644 --- a/src/components/common/CartDrawer/CartDrawer.module.scss +++ b/src/components/common/CartDrawer/CartDrawer.module.scss @@ -4,6 +4,6 @@ .cartDrawer { @apply flex flex-col h-full; .body { - @apply flex flex-col justify-center overflow-y-auto overflow-x-hidden h-full custom-scroll; + @apply flex flex-col overflow-y-auto overflow-x-hidden h-full custom-scroll; } } \ No newline at end of file diff --git a/src/components/common/DrawerCommon/DrawerCommon.module.scss b/src/components/common/DrawerCommon/DrawerCommon.module.scss index d118d45e8..fe42289f9 100644 --- a/src/components/common/DrawerCommon/DrawerCommon.module.scss +++ b/src/components/common/DrawerCommon/DrawerCommon.module.scss @@ -1,21 +1,36 @@ @import "../../../styles/utilities"; .drawerCommon { - @apply fixed flex justify-end transition-all duration-200; + @apply fixed flex justify-end transition-all duration-500; overflow: hidden; top: 0; right: 0; height: 100vh; - width: 90%; - box-shadow: -3px 0 10px rgba(0, 0, 0, 0.15); + width: 100%; z-index: 20000; + transform: translateX(110%); + &.show { + .innerWrap { + background: rgba(0, 0, 0, 0.2); + animation: animateBackground 0.8s; + } + transform: none; + } + + .innerWrap { + @apply w-full; + background: none; + } .inner { @apply flex flex-col bg-white; width: fit-content; height: 100vh; width: 100%; - margin-right: 0; + margin-left: auto; + box-shadow: -3px 0 10px rgba(0, 0, 0, 0.15); + // transform: none; + @screen md { max-width: 52rem; } @@ -39,14 +54,21 @@ overflow-y: auto; height: 100%; } - &.hide { - transform: translateX(110%); - } @screen md { - width: unset; .inner { min-width: 48rem; } } } + +@keyframes animateBackground { + 0%, + 50% { + background: none; + } + + 100% { + background: rgba(0, 0, 0, 0.2); + } +} diff --git a/src/components/common/DrawerCommon/DrawerCommon.tsx b/src/components/common/DrawerCommon/DrawerCommon.tsx index deb1af3eb..301e516c2 100644 --- a/src/components/common/DrawerCommon/DrawerCommon.tsx +++ b/src/components/common/DrawerCommon/DrawerCommon.tsx @@ -11,22 +11,32 @@ interface Props { } const DrawerCommon = ({ title, visible, children, onClose }: Props) => { +const refInner = useRef(null) + +const handleClickOut = (e: any) => { + if (e.target.contains(refInner.current)) { + onClose() + } +} + return ( - - - - {title} - - - + + + + + {title} + + + + + + + {children} - - - {children} diff --git a/src/components/common/Header/Header.tsx b/src/components/common/Header/Header.tsx index b86b36fb7..ad55d1feb 100644 --- a/src/components/common/Header/Header.tsx +++ b/src/components/common/Header/Header.tsx @@ -12,10 +12,10 @@ import HeaderSubMenuMobile from './components/HeaderSubMenuMobile/HeaderSubMenuM import s from './Header.module.scss' interface props { toggleFilter: () => void, - visibleFilter:boolean + visibleFilter: boolean } -const Header = memo(({ toggleFilter,visibleFilter }: props) => { +const Header = memo(({ toggleFilter, visibleFilter }: props) => { const headeFullRef = useRef(null) const [isFullHeader, setIsFullHeader] = useState(true) const { visible: visibleModalAuthen, closeModal: closeModalAuthen, openModal: openModalAuthen } = useModalCommon({ initialValue: false }) @@ -30,27 +30,23 @@ const Header = memo(({ toggleFilter,visibleFilter }: props) => { } } - const headerHeight = useMemo(() => { - return headeFullRef.current?.offsetHeight - }, [headeFullRef.current]) - useEffect(() => { const handleScroll = () => { - if (!isMobile()) { - if (!headerHeight || window.scrollY > headerHeight) { - setIsFullHeader(false) - } else { - setIsFullHeader(true) - } + if (!headeFullRef.current || window.scrollY > headeFullRef.current?.offsetHeight) { + setIsFullHeader(false) } else { setIsFullHeader(true) } + // if (!isMobile()) { + // } else { + // setIsFullHeader(true) + // } } window.addEventListener('scroll', handleScroll) return () => { window.removeEventListener('scroll', handleScroll) } - }, [headerHeight]) + }, [headeFullRef.current]) return ( <> @@ -59,16 +55,18 @@ const Header = memo(({ toggleFilter,visibleFilter }: props) => { [s.show]: !isFullHeader })}> - + void, openModalInfo: () => void, toggleFilter: () => void, @@ -20,7 +22,7 @@ interface Props { const FILTER_PAGE = [ROUTE.HOME, ROUTE.PRODUCTS] -const HeaderMenu = memo(({ visibleFilter,openModalAuthen, openModalInfo, toggleFilter, toggleCart}: Props) => { +const HeaderMenu = memo(({ isFull, isStickyHeader, visibleFilter, openModalAuthen, openModalInfo, toggleFilter, toggleCart }: Props) => { const router = useRouter() @@ -35,7 +37,11 @@ const HeaderMenu = memo(({ visibleFilter,openModalAuthen, openModalInfo, toggleF }, { link: '/account-not-login', - name: 'Account Not Login', + name: 'Account Not Login (Demo)', + }, + { + link: '/demo', + name: 'Notifications Empty (Demo)', }, { link: ROUTE.NOTIFICATION, @@ -52,7 +58,11 @@ const HeaderMenu = memo(({ visibleFilter,openModalAuthen, openModalInfo, toggleF ], [openModalAuthen]) return ( - + @@ -60,8 +70,8 @@ const HeaderMenu = memo(({ visibleFilter,openModalAuthen, openModalInfo, toggleF { FILTER_PAGE.includes(router.pathname) && ( - - + + ) } @@ -71,8 +81,13 @@ const HeaderMenu = memo(({ visibleFilter,openModalAuthen, openModalInfo, toggleF - - + + + + + + Search + diff --git a/src/components/common/Layout/Layout.module.scss b/src/components/common/Layout/Layout.module.scss index 30e4a077d..679b0b48f 100644 --- a/src/components/common/Layout/Layout.module.scss +++ b/src/components/common/Layout/Layout.module.scss @@ -4,6 +4,9 @@ min-height: 100vh; > main { flex: 1; + width: 100%; + max-width: min( 100%, 1536px); + margin: auto; } } .filter{ diff --git a/src/components/modules/home/HomeBanner/HomeBanner.module.scss b/src/components/modules/home/HomeBanner/HomeBanner.module.scss index bb65a2549..ed8c5c7a7 100644 --- a/src/components/modules/home/HomeBanner/HomeBanner.module.scss +++ b/src/components/modules/home/HomeBanner/HomeBanner.module.scss @@ -31,15 +31,12 @@ width: min-content; color: var(--white); - font-size: 7rem; + font-size: 8.8rem; line-height: 8rem; letter-spacing: -0.03em; font-weight: bold; text-transform: uppercase; - @screen 2xl { - line-height: 8rem; - } &::after { @apply absolute; content: ""; diff --git a/src/styles/_base.scss b/src/styles/_base.scss index e8719581f..859aaec7d 100644 --- a/src/styles/_base.scss +++ b/src/styles/_base.scss @@ -1,4 +1,5 @@ @import url("https://fonts.googleapis.com/css2?family=Nunito&family=Poppins:wght@500&family=Righteous&display=swap"); +@import '../../public/fonts/style.css'; :root { --primary: #5b9a74; @@ -41,7 +42,7 @@ --line-height: 2.4rem; --font-sans: "Nunito", -apple-system, system-ui, BlinkMacSystemFont, "Helvetica Neue", "Helvetica", sans-serif; - --font-heading: "Righteous", -apple-system, system-ui, BlinkMacSystemFont, "Helvetica Neue", "Helvetica", sans-serif; + --font-heading: "Norquay-bold", "Righteous", -apple-system, system-ui, BlinkMacSystemFont, "Helvetica Neue", "Helvetica", sans-serif; --font-logo: "Poppins", -apple-system, system-ui, BlinkMacSystemFont, "Helvetica Neue", "Helvetica", sans-serif; } diff --git a/tailwind.config.js b/tailwind.config.js index ec9f0e5d1..9d51fd1ba 100644 --- a/tailwind.config.js +++ b/tailwind.config.js @@ -122,7 +122,7 @@ module.exports = { 'xl': '1280px', // => @media (min-width: 1280px) { ... } - '2xl': '1536px', + '2xl': '1440px', // => @media (min-width: 1536px) { ... } }, caroucel: {