Browse Source

navbar change font size

master
azri 1 month ago
parent
commit
bb996928a2

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

219
             mt:1,
219
             mt:1,
220
             color: "black",
220
             color: "black",
221
             fontWeight: "100",
221
             fontWeight: "100",
222
+            fontSize: {
223
+              xs: "0.65rem",
224
+              sm: "0.65rem",
225
+              md: "0.75rem",
226
+            },
222
           }}
227
           }}
223
         >
228
         >
224
           {colletion?.title?.toUpperCase()}
229
           {colletion?.title?.toUpperCase()}
376
                 <Typography variant="body2"
381
                 <Typography variant="body2"
377
                   className="navItem"
382
                   className="navItem"
378
                   sx={{
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
                     color: (isAtTop) ? "white" : "black",
389
                     color: (isAtTop) ? "white" : "black",
382
                     transition: "all 0.3s ease-in-out",
390
                     transition: "all 0.3s ease-in-out",
383
                     ":hover": {
391
                     ":hover": {

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

20
       <Grid
20
       <Grid
21
         size={6}
21
         size={6}
22
         className="animate__animated animate__fadeIn animate__fast"
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
         <Typography
46
         <Typography
44
-          variant="body1"
47
+          variant="body2"
45
           sx={{
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
           {colletion?.title?.toUpperCase()}
57
           {colletion?.title?.toUpperCase()}
55
         </Typography>
58
         </Typography>
56
       </Grid>
59
       </Grid>
60
+
57
     )
61
     )
58
 
62
 
59
   }
63
   }
123
               if (collection?.length == 0) {
127
               if (collection?.length == 0) {
124
                 window.location.href = `/products`;
128
                 window.location.href = `/products`;
125
                 sessionStorage.removeItem('amber-select-collection')
129
                 sessionStorage.removeItem('amber-select-collection')
126
-              } 
130
+              }
127
             }}
131
             }}
128
             sx={{
132
             sx={{
129
               backgroundColor: "rgba(0,0,0,0)",
133
               backgroundColor: "rgba(0,0,0,0)",
134
               aria-controls="panel1-content"
138
               aria-controls="panel1-content"
135
               id="panel1-header"
139
               id="panel1-header"
136
             >
140
             >
137
-              <Typography 
141
+              <Typography
138
                 onClick={() => {
142
                 onClick={() => {
139
                   sessionStorage.setItem('amber-select-product-type', productType)
143
                   sessionStorage.setItem('amber-select-product-type', productType)
140
                   window.location.href = `/products`;
144
                   window.location.href = `/products`;
141
                   sessionStorage.removeItem('amber-select-collection')
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
                 {productType?.toUpperCase()}
156
                 {productType?.toUpperCase()}
147
               </Typography>
157
               </Typography>
148
             </AccordionSummary>
158
             </AccordionSummary>
149
             <AccordionDetails>
159
             <AccordionDetails>
150
               {(collection?.length > 0) &&
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
                   {collection?.map((colletion) => {
162
                   {collection?.map((colletion) => {
153
                     return renderCollectionDisplay(colletion)
163
                     return renderCollectionDisplay(colletion)
154
                   })}
164
                   })}

Loading…
Cancel
Save