Ver código fonte

fix main wallpaper position

master
azri 1 mês atrás
pai
commit
e1f2b412ec

BIN
src/assets/images/mainwallpaper-mobile.jpg Ver arquivo


+ 44
- 39
src/components/Carousel/Carousel.jsx Ver arquivo

@@ -3,6 +3,7 @@ import { Box, IconButton } from "@mui/material";
3 3
 import ArrowBackIosIcon from "@mui/icons-material/ArrowBackIos";
4 4
 import ArrowForwardIosIcon from "@mui/icons-material/ArrowForwardIos";
5 5
 import mainImage from "../../assets/images/mainwallpaper.jpg"
6
+import mainImageMobile from "../../assets/images/mainwallpaper-mobile.jpg"
6 7
 
7 8
 const Carousel = () => {
8 9
 
@@ -10,6 +11,10 @@ const Carousel = () => {
10 11
     { img_src: mainImage, alt_name: "Image 1" }
11 12
   ]
12 13
 
14
+  const items_mobile = [
15
+    { img_src: mainImageMobile, alt_name: "Image 1" }
16
+  ]
17
+
13 18
   const [currentIndex, setCurrentIndex] = React.useState(0);
14 19
 
15 20
   const handlePrev = () => {
@@ -32,21 +37,21 @@ const Carousel = () => {
32 37
         alignItems: "center",
33 38
         justifyContent: "center",
34 39
         width: "100%",
35
-        objectPosition:"top center",
40
+        objectPosition: "top center",
36 41
         height: "100vh",
37 42
         overflow: "hidden",
38 43
       }}
39 44
     >
40 45
       {/* Filter */}
41 46
       <Box sx={{
42
-        position:"absolute",
43
-        top:0,
44
-        right:0,
45
-        backgroundColor:"rgba(0, 0, 0, 0.3)",
46
-        width:"100%",
47
-        height:"100%"
47
+        position: "absolute",
48
+        top: 0,
49
+        right: 0,
50
+        backgroundColor: "rgba(0, 0, 0, 0.2)",
51
+        width: "100%",
52
+        height: "100%"
48 53
       }}></Box>
49
-      
54
+
50 55
       {items.map((item, index) => (
51 56
         <Box
52 57
           key={index}
@@ -54,44 +59,44 @@ const Carousel = () => {
54 59
           src={item.img_src}
55 60
           alt={item.alt_name}
56 61
           sx={{
62
+            display: {
63
+              xs:"none",
64
+              sm:"none",
65
+              md:"block",
66
+              lg:"block"
67
+            },
57 68
             width: "100%",
58 69
             height: "100%",
59
-            objectFit:"cover",
60
-            objectPosition:"center center",
61
-            display: index === currentIndex ? "block" : "none",
70
+            backgroundImage: `url(${item.img_src})`,
71
+            objectFit: "cover",
72
+            objectPosition: "center center",
62 73
           }}
63 74
         />
64 75
       ))}
65 76
 
66
-      {/* <IconButton
67
-        onClick={handlePrev}
68
-        sx={{
69
-          position: "absolute",
70
-          left: 16,
71
-          top: "50%",
72
-          transform: "translateY(-50%)",
73
-          color: "white",
74
-          backgroundColor: "rgba(0, 0, 0, 0.5)",
75
-          "&:hover": { backgroundColor: "rgba(0, 0, 0, 0.7)" },
76
-        }}
77
-      >
78
-        <ArrowBackIosIcon />
79
-      </IconButton> */}
77
+      {/* Mobile View - Cause the image keep getting wrong offest */}
78
+      {items_mobile.map((item, index) => (
79
+        <Box
80
+          key={index}
81
+          component="img"
82
+          src={item.img_src}
83
+          alt={item.alt_name}
84
+          sx={{
85
+            display: {
86
+              xs:"block",
87
+              sm:"block",
88
+              md:"none",
89
+              lg:"none"
90
+            },
91
+            width: "100%",
92
+            height: "100%",
93
+            backgroundImage: `url(${item.img_src})`,
94
+            objectFit: "cover",
95
+            objectPosition: "center center",
96
+          }}
97
+        />
98
+      ))}
80 99
 
81
-      {/* <IconButton
82
-        onClick={handleNext}
83
-        sx={{
84
-          position: "absolute",
85
-          right: 16,
86
-          top: "50%",
87
-          transform: "translateY(-50%)",
88
-          color: "white",
89
-          backgroundColor: "rgba(0, 0, 0, 0.5)",
90
-          "&:hover": { backgroundColor: "rgba(0, 0, 0, 0.7)" },
91
-        }}
92
-      >
93
-        <ArrowForwardIosIcon />
94
-      </IconButton> */}
95 100
     </Box>
96 101
   );
97 102
 };

+ 6
- 1
src/components/Navbar/Navbar.jsx Ver arquivo

@@ -328,7 +328,12 @@ const Navbar = () => {
328 328
                   md:10,
329 329
                   lg:10,
330 330
                   xl:10
331
-                }
331
+                },
332
+                display: {
333
+                  xs: "none",
334
+                  md: "none",
335
+                  lg: "flex"
336
+                },
332 337
               }}
333 338
             >
334 339
               <a href="/">

+ 2
- 2
src/components/ProductList/ProductList.jsx Ver arquivo

@@ -189,12 +189,12 @@ const ProductList = ({ size = 99999 }) => {
189 189
                 top: {
190 190
                   xs: 0,
191 191
                   sm: 0,
192
-                  md: 20
192
+                  md: 10
193 193
                 },
194 194
                 left: {
195 195
                   xs: 0,
196 196
                   sm: 0,
197
-                  md: 20
197
+                  md: 10
198 198
                 },
199 199
                 boxShadow: 0,
200 200
                 fontSize: 10

+ 21
- 16
src/components/ProductSelected/ProductSelected.jsx Ver arquivo

@@ -73,25 +73,30 @@ const ProductSelected = () => {
73 73
               }}
74 74
             />
75 75
 
76
-            <Button sx={{ 
77
-              position: "absolute", 
78
-              top:{
79
-                xs:0,
80
-                sm:0,
81
-                md:20
82
-              }, 
83
-              left: {
84
-                xs:0,
85
-                sm:0,
86
-                md:20
87
-              }, 
88
-              boxShadow: 0,
89
-              fontSize: 10
90
-            }} variant="contained">
76
+            <Button 
77
+              sx={{ 
78
+                position: "absolute", 
79
+                top:{
80
+                  xs:0,
81
+                  sm:0,
82
+                  md:10,
83
+                  lg: 20
84
+                }, 
85
+                left: {
86
+                  xs:0,
87
+                  sm:0,
88
+                  md:10,
89
+                  lg: 20
90
+                }, 
91
+                boxShadow: 0,
92
+                fontSize: 10
93
+              }} 
94
+              variant="contained"
95
+            >
91 96
               NEW
92 97
             </Button>
93 98
 
94
-            <Box sx={{ pt: 3 }}>
99
+            <Box sx={{ pt: 3,  width: "80%" }}>
95 100
               <Typography variant="body1" sx={{ fontWeight: "400", mb: 1 }}>
96 101
                 {collection_name}
97 102
               </Typography>

+ 1
- 1
src/services/ProductService.js Ver arquivo

@@ -17,7 +17,7 @@ const getProducts = async () => {
17 17
   while (hasNextCursor) {
18 18
 
19 19
     const query = `{
20
-      products(first: ${2}, ${cursor},  sortKey: CREATED_AT) {
20
+      products(first: ${250}, ${cursor},  sortKey: CREATED_AT) {
21 21
         nodes {
22 22
           id
23 23
           handle

Carregando…
Cancelar
Salvar