Browse Source

navbar change font size

master
azri 1 month ago
parent
commit
bb996928a2

+ 10
- 2
src/components/Navbar/Navbar.jsx View File

@@ -219,6 +219,11 @@ const Navbar = () => {
219 219
             mt:1,
220 220
             color: "black",
221 221
             fontWeight: "100",
222
+            fontSize: {
223
+              xs: "0.65rem",
224
+              sm: "0.65rem",
225
+              md: "0.75rem",
226
+            },
222 227
           }}
223 228
         >
224 229
           {colletion?.title?.toUpperCase()}
@@ -376,8 +381,11 @@ const Navbar = () => {
376 381
                 <Typography variant="body2"
377 382
                   className="navItem"
378 383
                   sx={{
379
-                    fontSize: "0.95rem",
380
-                    fontWeight: "400",
384
+                    fontSize: {
385
+                      xs: "0.65rem",
386
+                      sm: "0.65rem",
387
+                      md: "0.75rem",
388
+                    },
381 389
                     color: (isAtTop) ? "white" : "black",
382 390
                     transition: "all 0.3s ease-in-out",
383 391
                     ":hover": {

+ 42
- 32
src/components/Navbar/components/MobileNav/MobileNav.jsx View File

@@ -20,40 +20,44 @@ const MobileNav = ({ open, onClose, menu = [] }) => {
20 20
       <Grid
21 21
         size={6}
22 22
         className="animate__animated animate__fadeIn animate__fast"
23
-        sx={{
24
-          padding:5,
25
-          backgroundImage: `url(${colletion?.image?.url})`,
26
-          backgroundSize: "cover",
27
-          backgroundRepeat: "no-repeat",
28
-          backgroundPosition: "center center",
29
-          height: "100%",
30
-          paddingTop: "45%",
31
-          position: "relative",
32
-          cursor: "pointer",
33
-          transition: "transform 0.3s ease",
34
-          ":hover": {
35
-            transform: "scale(1.1)"
36
-          }
37
-        }}
38
-        onClick={() => {
39
-          sessionStorage.setItem('amber-select-collection', JSON.stringify(colletion))
40
-          window.location.href = `/products`;
41
-        }}
23
+        sx={{pr:1, pb:1}}
42 24
       >
25
+        <Box
26
+          sx={{
27
+            backgroundImage: `url(${colletion?.image?.url})`,
28
+            backgroundSize: "cover",
29
+            backgroundRepeat: "no-repeat",
30
+            backgroundPosition: "center center",
31
+            paddingTop: "80%",
32
+            position: "relative",
33
+            cursor: "pointer",
34
+            mb:1,
35
+            transition: "transform 0.3s ease",
36
+            ":hover": {
37
+              transform: "scale(1.1)"
38
+            }
39
+          }}
40
+          onClick={() => {
41
+            sessionStorage.setItem('amber-select-collection', JSON.stringify(colletion))
42
+            window.location.href = `/products`;
43
+          }}
44
+        >
45
+        </Box>
43 46
         <Typography
44
-          variant="body1"
47
+          variant="body2"
45 48
           sx={{
46
-            color: "white",
47
-            fontWeight: "bolder",
48
-            position: "absolute",
49
-            top: "50%",
50
-            left: "50%",
51
-            transform: "translate(-50%, -50%)"
49
+            color: "black",
50
+            fontSize: {
51
+              xs: "0.65rem",
52
+              sm: "0.65rem",
53
+              md: "0.75rem",
54
+            },
52 55
           }}
53 56
         >
54 57
           {colletion?.title?.toUpperCase()}
55 58
         </Typography>
56 59
       </Grid>
60
+
57 61
     )
58 62
 
59 63
   }
@@ -123,7 +127,7 @@ const MobileNav = ({ open, onClose, menu = [] }) => {
123 127
               if (collection?.length == 0) {
124 128
                 window.location.href = `/products`;
125 129
                 sessionStorage.removeItem('amber-select-collection')
126
-              } 
130
+              }
127 131
             }}
128 132
             sx={{
129 133
               backgroundColor: "rgba(0,0,0,0)",
@@ -134,21 +138,27 @@ const MobileNav = ({ open, onClose, menu = [] }) => {
134 138
               aria-controls="panel1-content"
135 139
               id="panel1-header"
136 140
             >
137
-              <Typography 
141
+              <Typography
138 142
                 onClick={() => {
139 143
                   sessionStorage.setItem('amber-select-product-type', productType)
140 144
                   window.location.href = `/products`;
141 145
                   sessionStorage.removeItem('amber-select-collection')
142
-                }} 
143
-                variant="body1" 
144
-                sx={{ fontWeight: "500" }}
146
+                }}
147
+                variant="body1"
148
+                sx={{
149
+                  fontSize: {
150
+                    xs: "0.65rem",
151
+                    sm: "0.65rem",
152
+                    md: "0.75rem",
153
+                  },
154
+                }}
145 155
               >
146 156
                 {productType?.toUpperCase()}
147 157
               </Typography>
148 158
             </AccordionSummary>
149 159
             <AccordionDetails>
150 160
               {(collection?.length > 0) &&
151
-                <Grid container sx={{maxHeight:"1000px", overflow:"scroll", overflowX:"hidden"}}>
161
+                <Grid container sx={{ maxHeight: "1000px", overflow: "scroll", overflowX: "hidden" }}>
152 162
                   {collection?.map((colletion) => {
153 163
                     return renderCollectionDisplay(colletion)
154 164
                   })}

Loading…
Cancel
Save