Skip to content

Commit 3d9749d

Browse files
committed
improve responsiveness of mobile menu, intro section texts and mobile social media
1 parent 874cad4 commit 3d9749d

File tree

4 files changed

+24
-58
lines changed

4 files changed

+24
-58
lines changed

app/sections/introduction/index.jsx

Lines changed: 14 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -16,10 +16,10 @@ export function WelcomeSection() {
1616

1717
let [count, setCount] = useState(0);
1818
const [text] = useState([
19-
"build Flutter apps for Android and iOS",
19+
"build Flutter apps for Android/iOS",
2020
"convert design into modern UI",
2121
"build interactive UI using React",
22-
"develop complex websites using Next.js"
22+
"develop websites using Next.js"
2323
]);
2424

2525
const onClick = (e) => scrollToEl(e);
@@ -59,7 +59,7 @@ export function WelcomeSection() {
5959
<div className="mt-3 relative flex flex-col overflow-hidden">
6060
<p
6161
ref={ref}
62-
className="text-2xl transform-none opacity-100"
62+
className="text-[17px] md:text-2xl transform-none opacity-100"
6363
style={{
6464
transform: isInView ? "none" : "translateX(-200px)",
6565
opacity: isInView ? 1 : 0,
@@ -70,7 +70,16 @@ export function WelcomeSection() {
7070
<span
7171
className="absolute flex flex-col transition-all duration-500 ease-in-expo"
7272
style={{
73-
top: count === 0 ? "0" : count === 1 ? "-100%" : count === 2 ? "-200%" : "0",
73+
top:
74+
count === 0
75+
? "0"
76+
: count === 1
77+
? "-100%"
78+
: count === 2
79+
? "-200%"
80+
: count === 3
81+
? "-300%"
82+
: "0",
7483
left: "13px"
7584
}}
7685
>
@@ -130,6 +139,7 @@ function TextElement({ element }) {
130139
<span
131140
tabIndex="0"
132141
ref={ref}
142+
className="text-[17px] md:text-2xl"
133143
style={{
134144
transform: isInView ? "none" : "translateX(-200px)",
135145
opacity: isInView ? 1 : 0,

components/Header.jsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ export function AppHeader() {
1313
<Logo />
1414
{isMobile ? <MobileMenu /> : <Menu />}
1515
<div className="flex items-center gap-5">
16-
<ConnectMedia />
16+
{!isMobile && <ConnectMedia />}
1717
<ThemeSwitcher />
1818
</div>
1919
</div>

components/MobileMenu.jsx

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
"use client";
22

3-
import { useState } from "react";
3+
import { useEffect, useState } from "react";
44
import { BsGrid } from "react-icons/bs";
55
import { ConnectMedia, Menu } from "components";
66
import {
@@ -10,7 +10,6 @@ import {
1010
exitMobile,
1111
initial,
1212
initialMobile,
13-
menuMobileHeight,
1413
transition
1514
} from "utils";
1615
import { m, AnimatePresence, domAnimation, LazyMotion } from "framer-motion";
@@ -22,9 +21,14 @@ export function MobileMenu() {
2221
const onClose = () => setIsOpen(false);
2322
const onOpen = () => setIsOpen(true);
2423

24+
useEffect(() => {
25+
document.body.style.overflow = isOpen ? "hidden" : "auto";
26+
}, [isOpen]);
27+
2528
return (
2629
<LazyMotion features={domAnimation}>
2730
<m.button
31+
className="p-2"
2832
onClick={onOpen}
2933
title="Open menu"
3034
initial={initial}
@@ -38,7 +42,7 @@ export function MobileMenu() {
3842
<AnimatePresence>
3943
{isOpen && (
4044
<m.div
41-
className={`bg-black/90 fixed left-0 right-0 top-[${menuMobileHeight}] min-h-screen z-50`}
45+
className={`backdrop-blur-md fixed left-0 right-0 top-0 min-h-screen z-50`}
4246
initial={initialMobile}
4347
animate={animateMobile}
4448
exit={exitMobile}
@@ -52,7 +56,7 @@ export function MobileMenu() {
5256
<IoMdClose size="24" />
5357
</button>
5458
</header>
55-
<div className="px-10">
59+
<div className="px-6 py-10">
5660
<Menu onClick={onClose} />
5761
</div>
5862
</m.div>

utils/theme-config.js

Lines changed: 1 addition & 49 deletions
Original file line numberDiff line numberDiff line change
@@ -1,54 +1,6 @@
11
const navigationHeight = 80;
2-
const menuMobileHeight = "68px";
3-
const footerHeight = 110;
42

5-
// const colors = {
6-
// brand: {
7-
// 100: "#fbf8f3",
8-
// 300: "#7928CA",
9-
// 400: "#FF0080",
10-
// 500: "#232332"
11-
// },
12-
// blue: {
13-
// 300: "#71c5ee",
14-
// 700: "#025091"
15-
// }
16-
// };
17-
18-
// const Buttons = {
19-
// Button: {
20-
// variants: {
21-
// solid: (props) => ({
22-
// bg: props.colorMode === "dark" ? "blue.600" : "blue.500",
23-
// color: "white",
24-
// _hover: {
25-
// bg: props.colorMode === "dark" ? "blue.700" : "blue.600"
26-
// }
27-
// })
28-
// }
29-
// }
30-
// };
31-
32-
// const Headings = {
33-
// Heading: {
34-
// baseStyle: {
35-
// fontWeight: "extrabold"
36-
// },
37-
// variants: {
38-
// brand: (props) => ({
39-
// bgGradient:
40-
// props.colorMode === "dark"
41-
// ? "linear(to-l, gray.300, gray.50)"
42-
// : "linear(to-l, gray.600, gray.900)",
43-
// bgClip: "text"
44-
// })
45-
// },
46-
// defaultProps: {
47-
// variant: "brand"
48-
// }
49-
// }
50-
// };
513
const blurDataUrl =
524
"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAQAAAC1HAwCAAAAC0lEQVR42mN8WQ8AAlcBas53/MIAAAAASUVORK5CYII=";
535

54-
export { navigationHeight, menuMobileHeight, footerHeight, blurDataUrl };
6+
export { navigationHeight, blurDataUrl };

0 commit comments

Comments
 (0)