├── src ├── App.css ├── images │ ├── Nike.jpg │ ├── img01.jpg │ ├── img011.jpg │ ├── img02.jpg │ ├── img03.jpg │ ├── img04.jpg │ ├── img05.jpg │ ├── img06.jpg │ ├── img07.jpg │ ├── img08.jpg │ ├── img09.jpg │ ├── img10.jpg │ └── inicio.jpg ├── setupTests.js ├── App.test.js ├── reportWebVitals.js ├── components │ ├── page │ │ ├── inicio │ │ │ └── index.js │ │ └── productos │ │ │ ├── index.js │ │ │ ├── ProductoItem.js │ │ │ └── ProductosDetalles.js │ ├── Page.js │ ├── Header.js │ └── Carrito.js ├── index.js ├── App.js ├── context │ └── DataProvider.js ├── logo.svg ├── Data.js ├── Data2.js └── index.css ├── jsconfig.json ├── public ├── favicon.ico ├── logo192.png ├── logo512.png ├── robots.txt ├── manifest.json └── index.html ├── .gitignore ├── package.json ├── README.md └── .eslintcache /src/App.css: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /jsconfig.json: -------------------------------------------------------------------------------- 1 | { 2 | "compilerOptions": { 3 | "baseUrl": "src" 4 | } 5 | } -------------------------------------------------------------------------------- /public/favicon.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jehingson/react-360/HEAD/public/favicon.ico -------------------------------------------------------------------------------- /public/logo192.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jehingson/react-360/HEAD/public/logo192.png -------------------------------------------------------------------------------- /public/logo512.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jehingson/react-360/HEAD/public/logo512.png -------------------------------------------------------------------------------- /src/images/Nike.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jehingson/react-360/HEAD/src/images/Nike.jpg -------------------------------------------------------------------------------- /public/robots.txt: -------------------------------------------------------------------------------- 1 | # https://www.robotstxt.org/robotstxt.html 2 | User-agent: * 3 | Disallow: 4 | -------------------------------------------------------------------------------- /src/images/img01.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jehingson/react-360/HEAD/src/images/img01.jpg -------------------------------------------------------------------------------- /src/images/img011.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jehingson/react-360/HEAD/src/images/img011.jpg -------------------------------------------------------------------------------- /src/images/img02.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jehingson/react-360/HEAD/src/images/img02.jpg -------------------------------------------------------------------------------- /src/images/img03.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jehingson/react-360/HEAD/src/images/img03.jpg -------------------------------------------------------------------------------- /src/images/img04.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jehingson/react-360/HEAD/src/images/img04.jpg -------------------------------------------------------------------------------- /src/images/img05.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jehingson/react-360/HEAD/src/images/img05.jpg -------------------------------------------------------------------------------- /src/images/img06.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jehingson/react-360/HEAD/src/images/img06.jpg -------------------------------------------------------------------------------- /src/images/img07.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jehingson/react-360/HEAD/src/images/img07.jpg -------------------------------------------------------------------------------- /src/images/img08.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jehingson/react-360/HEAD/src/images/img08.jpg -------------------------------------------------------------------------------- /src/images/img09.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jehingson/react-360/HEAD/src/images/img09.jpg -------------------------------------------------------------------------------- /src/images/img10.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jehingson/react-360/HEAD/src/images/img10.jpg -------------------------------------------------------------------------------- /src/images/inicio.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jehingson/react-360/HEAD/src/images/inicio.jpg -------------------------------------------------------------------------------- /src/setupTests.js: -------------------------------------------------------------------------------- 1 | // jest-dom adds custom jest matchers for asserting on DOM nodes. 2 | // allows you to do things like: 3 | // expect(element).toHaveTextContent(/react/i) 4 | // learn more: https://github.com/testing-library/jest-dom 5 | import '@testing-library/jest-dom'; 6 | -------------------------------------------------------------------------------- /src/App.test.js: -------------------------------------------------------------------------------- 1 | import { render, screen } from '@testing-library/react'; 2 | import App from './App'; 3 | 4 | test('renders learn react link', () => { 5 | render(); 6 | const linkElement = screen.getByText(/learn react/i); 7 | expect(linkElement).toBeInTheDocument(); 8 | }); 9 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | # See https://help.github.com/articles/ignoring-files/ for more about ignoring files. 2 | 3 | # dependencies 4 | /node_modules 5 | /.pnp 6 | .pnp.js 7 | 8 | # testing 9 | /coverage 10 | 11 | # production 12 | /build 13 | 14 | # misc 15 | .DS_Store 16 | .env.local 17 | .env.development.local 18 | .env.test.local 19 | .env.production.local 20 | 21 | npm-debug.log* 22 | yarn-debug.log* 23 | yarn-error.log* 24 | -------------------------------------------------------------------------------- /src/reportWebVitals.js: -------------------------------------------------------------------------------- 1 | const reportWebVitals = onPerfEntry => { 2 | if (onPerfEntry && onPerfEntry instanceof Function) { 3 | import('web-vitals').then(({ getCLS, getFID, getFCP, getLCP, getTTFB }) => { 4 | getCLS(onPerfEntry); 5 | getFID(onPerfEntry); 6 | getFCP(onPerfEntry); 7 | getLCP(onPerfEntry); 8 | getTTFB(onPerfEntry); 9 | }); 10 | } 11 | }; 12 | 13 | export default reportWebVitals; 14 | -------------------------------------------------------------------------------- /src/components/page/inicio/index.js: -------------------------------------------------------------------------------- 1 | import React from 'react' 2 | import { Link } from "react-router-dom"; 3 | import Portada from "images/inicio.jpg"; 4 | 5 | export default function Inicio() { 6 | return ( 7 |
8 | 9 |

home

10 | 11 | 12 |

Productos

13 | 14 | 15 |
16 | ) 17 | } 18 | -------------------------------------------------------------------------------- /src/index.js: -------------------------------------------------------------------------------- 1 | import React from 'react'; 2 | import ReactDOM from 'react-dom'; 3 | import './index.css'; 4 | import App from './App'; 5 | import reportWebVitals from './reportWebVitals'; 6 | 7 | ReactDOM.render( 8 | 9 | 10 | , 11 | document.getElementById('root') 12 | ); 13 | 14 | // If you want to start measuring performance in your app, pass a function 15 | // to log results (for example: reportWebVitals(console.log)) 16 | // or send to an analytics endpoint. Learn more: https://bit.ly/CRA-vitals 17 | reportWebVitals(); 18 | -------------------------------------------------------------------------------- /public/manifest.json: -------------------------------------------------------------------------------- 1 | { 2 | "short_name": "React App", 3 | "name": "Create React App Sample", 4 | "icons": [ 5 | { 6 | "src": "favicon.ico", 7 | "sizes": "64x64 32x32 24x24 16x16", 8 | "type": "image/x-icon" 9 | }, 10 | { 11 | "src": "logo192.png", 12 | "type": "image/png", 13 | "sizes": "192x192" 14 | }, 15 | { 16 | "src": "logo512.png", 17 | "type": "image/png", 18 | "sizes": "512x512" 19 | } 20 | ], 21 | "start_url": ".", 22 | "display": "standalone", 23 | "theme_color": "#000000", 24 | "background_color": "#ffffff" 25 | } 26 | -------------------------------------------------------------------------------- /src/components/Page.js: -------------------------------------------------------------------------------- 1 | import React from "react"; 2 | import { Switch, Route} from "react-router-dom"; 3 | import Inicio from "./page/inicio"; 4 | import { ProductosList } from "./page/productos"; 5 | import { ProductosDetalles } from "./page/productos/ProductosDetalles"; 6 | 7 | export default function Page() { 8 | return ( 9 |
10 | 11 | 12 | 13 | 14 | 15 |
16 | ); 17 | } 18 | -------------------------------------------------------------------------------- /src/App.js: -------------------------------------------------------------------------------- 1 | import React from 'react' 2 | import { Header } from "./components/Header"; 3 | import { Carrito } from "./components/Carrito"; 4 | import {DataProvider} from './context/DataProvider'; 5 | import { BrowserRouter as Router} from "react-router-dom"; 6 | import Pages from "./components/Page.js"; 7 | import "boxicons"; 8 | 9 | function App() { 10 | 11 | return ( 12 | 13 |
14 | 15 |
16 | 17 | 18 | 19 |
20 |
21 | ); 22 | } 23 | 24 | export default App; 25 | -------------------------------------------------------------------------------- /src/components/page/productos/index.js: -------------------------------------------------------------------------------- 1 | import React, {useContext} from 'react' 2 | import { DataContext } from "context/DataProvider"; 3 | import { ProductoItem } from "./ProductoItem"; 4 | 5 | export const ProductosList = () => { 6 | const value = useContext(DataContext) 7 | const [productos] = value.productos; 8 | return ( 9 | <> 10 |

PRODUCTOS

11 |
12 | { 13 | productos.map(producto =>( 14 | 22 | )) 23 | } 24 |
25 | 26 | ) 27 | } 28 | -------------------------------------------------------------------------------- /package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "video5", 3 | "version": "0.1.0", 4 | "private": true, 5 | "dependencies": { 6 | "@testing-library/jest-dom": "^5.11.8", 7 | "@testing-library/react": "^11.2.3", 8 | "@testing-library/user-event": "^12.6.0", 9 | "boxicons": "^2.0.7", 10 | "react": "^17.0.1", 11 | "react-dom": "^17.0.1", 12 | "react-router-dom": "^5.2.0", 13 | "react-scripts": "4.0.1", 14 | "web-vitals": "^0.2.4" 15 | }, 16 | "scripts": { 17 | "start": "react-scripts start", 18 | "build": "react-scripts build", 19 | "test": "react-scripts test", 20 | "eject": "react-scripts eject" 21 | }, 22 | "eslintConfig": { 23 | "extends": [ 24 | "react-app", 25 | "react-app/jest" 26 | ] 27 | }, 28 | "browserslist": { 29 | "production": [ 30 | ">0.2%", 31 | "not dead", 32 | "not op_mini all" 33 | ], 34 | "development": [ 35 | "last 1 chrome version", 36 | "last 1 firefox version", 37 | "last 1 safari version" 38 | ] 39 | } 40 | } 41 | -------------------------------------------------------------------------------- /src/components/page/productos/ProductoItem.js: -------------------------------------------------------------------------------- 1 | import React, {useContext} from "react"; 2 | import { Link } from "react-router-dom"; 3 | import { DataContext } from "context/DataProvider"; 4 | 5 | export const ProductoItem = ({title, image, category, price, id}) => { 6 | 7 | const value = useContext(DataContext); 8 | const addCarrito = value.addCarrito; 9 | 10 | 11 | 12 | return ( 13 | 14 |
15 | 16 |
17 | {title} 18 |
19 | 20 |
21 |

{title}

22 |

{category}

23 |

${price}

24 |
25 |
26 | 27 |
28 | Vista 29 |
30 |
31 |
32 | ); 33 | }; 34 | -------------------------------------------------------------------------------- /src/components/Header.js: -------------------------------------------------------------------------------- 1 | import React, { useContext} from "react"; 2 | import { DataContext } from "context/DataProvider"; 3 | import { Link } from "react-router-dom"; 4 | import Nike from "images/Nike.jpg"; 5 | 6 | 7 | export const Header = () => { 8 | const value = useContext(DataContext); 9 | const [carrito] = value.carrito; 10 | const [menu, setMenu] = value.menu; 11 | 12 | 13 | const toogleMenu = () =>{ 14 | setMenu(!menu) 15 | } 16 | 17 | 18 | return ( 19 |
20 |
21 | 22 |
23 | 24 |
25 | Nike 26 |
27 | 28 | 36 |
37 | 38 | {carrito.length} 39 |
40 |
41 | ); 42 | }; 43 | -------------------------------------------------------------------------------- /src/context/DataProvider.js: -------------------------------------------------------------------------------- 1 | import React, { createContext, useState, useEffect } from "react"; 2 | import Data from "Data2.js"; 3 | 4 | export const DataContext = createContext(); 5 | 6 | export const DataProvider = (props) => { 7 | const [productos, setProductos] = useState([]); 8 | const [menu, setMenu] = useState(false) 9 | const [carrito, setCarrito] =useState([]) 10 | const [total, setTotal] = useState(0) 11 | 12 | console.log(carrito) 13 | 14 | useEffect(() => { 15 | const producto = Data.items 16 | if(producto){ 17 | setProductos(producto) 18 | }else{ 19 | setProductos([]) 20 | } 21 | }, []); 22 | 23 | const addCarrito = (id) =>{ 24 | const check = carrito.every(item =>{ 25 | return item.id !== id 26 | 27 | }) 28 | if(check){ 29 | const data = productos.filter(producto =>{ 30 | return producto.id === id 31 | }) 32 | setCarrito([...carrito, ...data]) 33 | }else{ 34 | alert("El producto se ha añadido al carrito") 35 | } 36 | } 37 | useEffect(() =>{ 38 | const dataCarrito = JSON.parse(localStorage.getItem('dataCarrito')) 39 | if(dataCarrito){ 40 | setCarrito(dataCarrito) 41 | } 42 | },[]) 43 | 44 | useEffect(() =>{ 45 | localStorage.setItem('dataCarrito', JSON.stringify(carrito)) 46 | },[carrito]) 47 | 48 | useEffect(() =>{ 49 | const getTotal = () =>{ 50 | const res = carrito.reduce((prev, item) =>{ 51 | return prev + (item.price * item.cantidad) 52 | },0) 53 | setTotal(res) 54 | } 55 | getTotal() 56 | },[carrito]) 57 | 58 | const value = { 59 | productos : [productos], 60 | menu: [menu, setMenu], 61 | carrito: [carrito, setCarrito], 62 | addCarrito: addCarrito, 63 | total: [total, setTotal] 64 | } 65 | return ( 66 | 67 | {props.children} 68 | 69 | ) 70 | }; 71 | -------------------------------------------------------------------------------- /public/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 12 | 13 | 17 | 18 | 27 | React App 28 | 29 | 30 | 31 |
32 | 42 | 43 | 44 | -------------------------------------------------------------------------------- /src/logo.svg: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /src/components/Carrito.js: -------------------------------------------------------------------------------- 1 | import React, { useContext } from "react"; 2 | import Card from "images/img02.jpg"; 3 | import { DataContext } from "context/DataProvider"; 4 | 5 | export const Carrito = () => { 6 | const value = useContext(DataContext); 7 | const [menu, setMenu] = value.menu; 8 | const [carrito, setCarrito] = value.carrito; 9 | const [total] = value.total; 10 | 11 | const tooglefalse = () => { 12 | setMenu(false); 13 | }; 14 | 15 | const reduce = id =>{ 16 | carrito.forEach(item =>{ 17 | if(item.id === id){ 18 | item.cantidad === 1 ? item.cantidad = 1: item.cantidad -=1; 19 | } 20 | setCarrito([...carrito]) 21 | }) 22 | } 23 | const increase = id =>{ 24 | carrito.forEach(item =>{ 25 | if(item.id === id){ 26 | item.cantidad +=1; 27 | } 28 | setCarrito([...carrito]) 29 | }) 30 | } 31 | 32 | const removeProducto = id =>{ 33 | if(window.confirm("¿Quieres suspender el producto?")){ 34 | carrito.forEach((item, index)=>{ 35 | if(item.id === id){ 36 | item.cantidad = 1; 37 | carrito.splice(index, 1) 38 | } 39 | }) 40 | setCarrito([...carrito]) 41 | } 42 | } 43 | 44 | const show1 = menu ? "carritos show" : "carrito"; 45 | const show2 = menu ? "carrito show" : "carrito"; 46 | 47 | 48 | 49 | return ( 50 |
51 |
52 |
53 | 54 |
55 |

Su Carrito

56 |
57 | { 58 | 59 | 60 | carrito.length === 0 ?

Carrito Vacio

:<> 61 | { 62 | carrito.map((producto) => ( 63 |
64 | {producto.title} 65 |
66 |

{producto.title}

67 |

${producto.price}

68 |
69 |
70 | increase(producto.id)} name="up-arrow" 72 | type="solid" 73 | /> 74 |

{producto.cantidad}

75 | reduce(producto.id)} 77 | name="down-arrow" 78 | type="solid" 79 | /> 80 |
81 |
removeProducto(producto.id)} 83 | className="remove__item" 84 | > 85 | 86 |
87 |
88 | )) 89 | }; 90 | 91 | 92 | } 93 |
94 | 95 |
96 |

Total: ${total}

97 | 98 |
99 |
100 |
101 | ); 102 | }; 103 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # Getting Started with Create React App 2 | 3 | This project was bootstrapped with [Create React App](https://github.com/facebook/create-react-app). 4 | 5 | ## Available Scripts 6 | 7 | In the project directory, you can run: 8 | 9 | ### `npm start` 10 | 11 | Runs the app in the development mode.\ 12 | Open [http://localhost:3000](http://localhost:3000) to view it in the browser. 13 | 14 | The page will reload if you make edits.\ 15 | You will also see any lint errors in the console. 16 | 17 | ### `npm test` 18 | 19 | Launches the test runner in the interactive watch mode.\ 20 | See the section about [running tests](https://facebook.github.io/create-react-app/docs/running-tests) for more information. 21 | 22 | ### `npm run build` 23 | 24 | Builds the app for production to the `build` folder.\ 25 | It correctly bundles React in production mode and optimizes the build for the best performance. 26 | 27 | The build is minified and the filenames include the hashes.\ 28 | Your app is ready to be deployed! 29 | 30 | See the section about [deployment](https://facebook.github.io/create-react-app/docs/deployment) for more information. 31 | 32 | ### `npm run eject` 33 | 34 | **Note: this is a one-way operation. Once you `eject`, you can’t go back!** 35 | 36 | If you aren’t satisfied with the build tool and configuration choices, you can `eject` at any time. This command will remove the single build dependency from your project. 37 | 38 | Instead, it will copy all the configuration files and the transitive dependencies (webpack, Babel, ESLint, etc) right into your project so you have full control over them. All of the commands except `eject` will still work, but they will point to the copied scripts so you can tweak them. At this point you’re on your own. 39 | 40 | You don’t have to ever use `eject`. The curated feature set is suitable for small and middle deployments, and you shouldn’t feel obligated to use this feature. However we understand that this tool wouldn’t be useful if you couldn’t customize it when you are ready for it. 41 | 42 | ## Learn More 43 | 44 | You can learn more in the [Create React App documentation](https://facebook.github.io/create-react-app/docs/getting-started). 45 | 46 | To learn React, check out the [React documentation](https://reactjs.org/). 47 | 48 | ### Code Splitting 49 | 50 | This section has moved here: [https://facebook.github.io/create-react-app/docs/code-splitting](https://facebook.github.io/create-react-app/docs/code-splitting) 51 | 52 | ### Analyzing the Bundle Size 53 | 54 | This section has moved here: [https://facebook.github.io/create-react-app/docs/analyzing-the-bundle-size](https://facebook.github.io/create-react-app/docs/analyzing-the-bundle-size) 55 | 56 | ### Making a Progressive Web App 57 | 58 | This section has moved here: [https://facebook.github.io/create-react-app/docs/making-a-progressive-web-app](https://facebook.github.io/create-react-app/docs/making-a-progressive-web-app) 59 | 60 | ### Advanced Configuration 61 | 62 | This section has moved here: [https://facebook.github.io/create-react-app/docs/advanced-configuration](https://facebook.github.io/create-react-app/docs/advanced-configuration) 63 | 64 | ### Deployment 65 | 66 | This section has moved here: [https://facebook.github.io/create-react-app/docs/deployment](https://facebook.github.io/create-react-app/docs/deployment) 67 | 68 | ### `npm run build` fails to minify 69 | 70 | This section has moved here: [https://facebook.github.io/create-react-app/docs/troubleshooting#npm-run-build-fails-to-minify](https://facebook.github.io/create-react-app/docs/troubleshooting#npm-run-build-fails-to-minify) 71 | -------------------------------------------------------------------------------- /src/components/page/productos/ProductosDetalles.js: -------------------------------------------------------------------------------- 1 | import React, {useContext, useEffect, useState} from 'react' 2 | import { DataContext } from "context/DataProvider"; 3 | import { useParams } from "react-router-dom"; 4 | import { ProductoItem } from "./ProductoItem"; 5 | 6 | export const ProductosDetalles = () => { 7 | const value = useContext(DataContext); 8 | const [productos] = value.productos; 9 | const addCarrito = value.addCarrito; 10 | const [detalle, setDetalle] = useState([]) 11 | const [url, setUrl]= useState(0) 12 | const [images, setImages] = useState('') 13 | const params = useParams(); 14 | let item = 0; 15 | 16 | useEffect(() =>{ 17 | console.log('re render' , params.id) 18 | item=0; 19 | productos.forEach(producto =>{ 20 | if(producto.id === parseInt(params.id)){ 21 | setDetalle(producto) 22 | setUrl(0) 23 | } 24 | }) 25 | },[params.id, productos]) 26 | 27 | console.log(url) 28 | 29 | useEffect(() =>{ 30 | const values = `${detalle.img1}${url}${detalle.img2}`; 31 | setImages(values) 32 | },[url, params.id]) 33 | 34 | const handleInput = (e) =>{ 35 | const number = e.target.value.toString().padStart(2,'01') 36 | setUrl(number) 37 | } 38 | 39 | if(detalle.length < 1) return null; 40 | 41 | return ( 42 | <> 43 | { 44 |
45 |

{detalle.title}

46 |

${detalle.price}

47 |
48 |

Nuevo

49 |
50 | 60 |

Tamaño

61 |
62 |
63 | 66 | 67 | { 68 | url ? {detalle.title}/ : {detalle.title}/ 69 | } 70 | 71 |
72 |

description: Lorem ipsum dolor, sit amet consectetur adipisicing elit. Cum necessitatibus soluta alias porro, saepe facere expedita asperiores quos fugit inventore ex, itaque sapiente quae pariatur beatae optio repellat aperiam quia possimus mollitia repellendus? Illo natus quam eaque impedit omnis pariatur!

73 |
74 |

Lorem ipsum dolor sit amet consectetur adipisicing elit. Numquam vitae accusantium omnis, facere laudantium ipsa hic reprehenderit blanditiis quibusdam quos repellendus id illo reiciendis magni, aliquid beatae, consequatur sapiente! Sequi facere itaque,

75 |
76 | 77 |
78 | 79 | } 80 |

Productos relacionados

81 |
82 | { 83 | productos.map((producto)=>{ 84 | if((item < 6)&&(detalle.category === producto.category)){ 85 | item++; 86 | return 94 | } 95 | 96 | 97 | }) 98 | } 99 | 100 |
101 | 102 | ) 103 | } 104 | -------------------------------------------------------------------------------- /src/Data.js: -------------------------------------------------------------------------------- 1 | const data = { 2 | status: "success", 3 | items: [ 4 | { 5 | id: 1, 6 | title: "Nike LD Waffle Sacai Black Nylon", 7 | price: 401, 8 | image: require('./images/img01.jpg'), 9 | category: "nike", 10 | img1: "https://stockx-360.imgix.net/Nike-LD-Waffle-Sacai-Black-Nylon/Images/Nike-LD-Waffle-Sacai-Black-Nylon/Lv2/img", 11 | img2: ".jpg?auto=format,compress&q=90&updated_at=1606321430&w=1000", 12 | cantidad: 1, 13 | }, 14 | { 15 | id: 2, 16 | title: "Nike Dunk Low Off-White Pine Green", 17 | price: 304, 18 | image: require('./images/img02.jpg'), 19 | category: "nike", 20 | img1: "https://stockx-360.imgix.net/Nike-Dunk-Low-Off-White-Pine-Green/Images/Nike-Dunk-Low-Off-White-Pine-Green/Lv2/img", 21 | img2: ".jpg?auto=format,compress&q=90&updated_at=1606319825&w=1000", 22 | cantidad: 1 23 | }, 24 | { 25 | id: 3, 26 | title: "Nike Air Force 1 Low Supreme Black", 27 | price: 475, 28 | image: require('./images/img03.jpg'), 29 | category: "nike", 30 | img1: "https://stockx-360.imgix.net/Nike-Air-Force-1-Low-Supreme-Box-Logo-Black/Images/Nike-Air-Force-1-Low-Supreme-Box-Logo-Black/Lv2/img", 31 | img2: ".jpg?auto=format,compress&q=90&updated_at=1606325289&w=1000", 32 | cantidad: 1 33 | }, 34 | { 35 | id: 4, 36 | title: "Nike LD Waffle Sacai White Nylon", 37 | price: 399, 38 | image: require('./images/img04.jpg'), 39 | category: "nike", 40 | img1: "https://stockx-360.imgix.net/Nike-LD-Waffle-Sacai-White-Nylon/Images/Nike-LD-Waffle-Sacai-White-Nylon/Lv2/img", 41 | img2: ".jpg?auto=format,compress&q=90&updated_at=1606325338&w=1000", 42 | cantidad: 1 43 | }, 44 | { 45 | id: 5, 46 | title: "Nike Dunk Low SP Kentucky (2021)", 47 | price: 405, 48 | image: require('./images/img05.jpg'), 49 | category: "nike", 50 | img1: " https://stockx-360.imgix.net/Nike-Dunk-Low-SP-Kentucky/Images/Nike-Dunk-Low-SP-Kentucky/Lv2/img", 51 | img2: ".jpg?auto=format,compress&q=90&updated_at=1606322330&w=1000", 52 | cantidad: 1 53 | }, 54 | { 55 | id: 6, 56 | title: "Nike Dunk Low Off-White University", 57 | price: 285, 58 | image: require('./images/img06.jpg'), 59 | category: "nike", 60 | img1: "https://stockx-360.imgix.net/Nike-Dunk-Low-Off-White-University-Red/Images/Nike-Dunk-Low-Off-White-University-Red/Lv2/img", 61 | img2: ".jpg?auto=format,compress&q=90&updated_at=1606321824&w=1000", 62 | cantidad: 1 63 | }, 64 | { 65 | id: 7, 66 | title: "Nike Air Max 2 Light Atmos", 67 | price: 360, 68 | image: require('./images/img07.jpg'), 69 | category: "nike", 70 | img1: "https://stockx-360.imgix.net/Nike-Air-Max-2-Light-Atmos/Images/Nike-Air-Max-2-Light-Atmos/Lv2/img", 71 | img2: ".jpg?auto=format,compress&q=90&updated_at=1606320966&w=1000", 72 | cantidad: 1 73 | }, 74 | { 75 | id: 8, 76 | title: "Nike Air Force 1 Low CLOT Blue Silk", 77 | price: 335, 78 | image: require('./images/img08.jpg'), 79 | category: "nike", 80 | img1: "https://stockx-360.imgix.net/Nike-Air-Force-1-Low-Clot-Blue-Silk/Images/Nike-Air-Force-1-Low-Clot-Blue-Silk/Lv2/img", 81 | img2: ".jpg?auto=format,compress&q=90&updated_at=1606325265&w=1000", 82 | cantidad: 1 83 | }, 84 | { 85 | id: 9, 86 | title: "Nike Air Max 90 OG Volt (2020)", 87 | price: 799, 88 | image: require('./images/img09.jpg'), 89 | category: "nike", 90 | img1: "https://stockx-360.imgix.net/Nike-Air-Max-90-OG-White-Particle-Grey-Volt/Images/Nike-Air-Max-90-OG-White-Particle-Grey-Volt/Lv2/img", 91 | img2: ".jpg?auto=format,compress&q=90&updated_at=1606323250&w=1000", 92 | cantidad: 1 93 | }, 94 | { 95 | id: 10, 96 | title: "Nike Dunk High Varsity Maize", 97 | price: 501, 98 | image: require('./images/img10.jpg'), 99 | category: "nike", 100 | img1: "https://stockx-360.imgix.net/Nike-Dunk-High-Black-Varsity-Maize/Images/Nike-Dunk-High-Black-Varsity-Maize/Lv2/img", 101 | img2: ".jpg?auto=format,compress&q=90&updated_at=1609445259&w=1000", 102 | cantidad: 1 103 | }, 104 | { 105 | id: 11, 106 | title: "Nike Air Rubber Dunk Off-White UNC", 107 | price: 377, 108 | image: require('./images/img011.jpg'), 109 | category: "nike", 110 | img1: "https://stockx-360.imgix.net/Nike-Air-Rubber-Dunk-Off-White-UNC/Images/Nike-Air-Rubber-Dunk-Off-White-UNC/Lv2/img", 111 | img2: ".jpg?auto=format,compress&q=90&updated_at=1609438911&w=1000", 112 | cantidad: 1 113 | }, 114 | ], 115 | }; 116 | 117 | export default data; -------------------------------------------------------------------------------- /src/Data2.js: -------------------------------------------------------------------------------- 1 | const data = { 2 | status: "success", 3 | items: [ 4 | { 5 | id: 1, 6 | title: "Nike LD Waffle Sacai Black Nylon", 7 | price: 401, 8 | image: "https://stockx-360.imgix.net/Nike-LD-Waffle-Sacai-Black-Nylon/Images/Nike-LD-Waffle-Sacai-Black-Nylon/Lv2/img01.jpg?auto=format,compress&q=90&updated_at=1606321430&w=1000", 9 | category: "nike", 10 | img1: "https://stockx-360.imgix.net/Nike-LD-Waffle-Sacai-Black-Nylon/Images/Nike-LD-Waffle-Sacai-Black-Nylon/Lv2/img", 11 | img2: ".jpg?auto=format,compress&q=90&updated_at=1606321430&w=1000", 12 | cantidad: 1, 13 | }, 14 | { 15 | id: 2, 16 | title: "Nike Dunk Low Off-White Pine Green", 17 | price: 304, 18 | image: "https://stockx-360.imgix.net/Nike-Dunk-Low-Off-White-Pine-Green/Images/Nike-Dunk-Low-Off-White-Pine-Green/Lv2/img01.jpg?auto=format,compress&q=90&updated_at=1606319825&w=1000", 19 | category: "nike", 20 | img1: "https://stockx-360.imgix.net/Nike-Dunk-Low-Off-White-Pine-Green/Images/Nike-Dunk-Low-Off-White-Pine-Green/Lv2/img", 21 | img2: ".jpg?auto=format,compress&q=90&updated_at=1606319825&w=1000", 22 | cantidad: 1 23 | }, 24 | { 25 | id: 3, 26 | title: "Nike Air Force 1 Low Supreme Black", 27 | price: 475, 28 | image: "https://stockx-360.imgix.net/Nike-Air-Force-1-Low-Supreme-Box-Logo-Black/Images/Nike-Air-Force-1-Low-Supreme-Box-Logo-Black/Lv2/img01.jpg?auto=format,compress&q=90&updated_at=1606325289&w=1000", 29 | category: "nike", 30 | img1: "https://stockx-360.imgix.net/Nike-Air-Force-1-Low-Supreme-Box-Logo-Black/Images/Nike-Air-Force-1-Low-Supreme-Box-Logo-Black/Lv2/img", 31 | img2: ".jpg?auto=format,compress&q=90&updated_at=1606325289&w=1000", 32 | cantidad: 1 33 | }, 34 | { 35 | id: 4, 36 | title: "Nike LD Waffle Sacai White Nylon", 37 | price: 399, 38 | image: "https://stockx-360.imgix.net/Nike-LD-Waffle-Sacai-White-Nylon/Images/Nike-LD-Waffle-Sacai-White-Nylon/Lv2/img01.jpg?auto=format,compress&q=90&updated_at=1606325338&w=1000", 39 | category: "nike", 40 | img1: "https://stockx-360.imgix.net/Nike-LD-Waffle-Sacai-White-Nylon/Images/Nike-LD-Waffle-Sacai-White-Nylon/Lv2/img", 41 | img2: ".jpg?auto=format,compress&q=90&updated_at=1606325338&w=1000", 42 | cantidad: 1 43 | }, 44 | { 45 | id: 5, 46 | title: "Nike Dunk Low SP Kentucky (2021)", 47 | price: 405, 48 | image: "https://stockx-360.imgix.net/Nike-Dunk-Low-SP-Kentucky/Images/Nike-Dunk-Low-SP-Kentucky/Lv2/img01.jpg?auto=format,compress&q=90&updated_at=1606322330&w=1000", 49 | category: "nike", 50 | img1: " https://stockx-360.imgix.net/Nike-Dunk-Low-SP-Kentucky/Images/Nike-Dunk-Low-SP-Kentucky/Lv2/img", 51 | img2: ".jpg?auto=format,compress&q=90&updated_at=1606322330&w=1000", 52 | cantidad: 1 53 | }, 54 | { 55 | id: 6, 56 | title: "Nike Dunk Low Off-White University", 57 | price: 285, 58 | image: "https://stockx-360.imgix.net/Nike-Dunk-Low-Off-White-University-Red/Images/Nike-Dunk-Low-Off-White-University-Red/Lv2/img01.jpg?auto=format,compress&q=90&updated_at=1606321824&w=1000", 59 | category: "nike", 60 | img1: "https://stockx-360.imgix.net/Nike-Dunk-Low-Off-White-University-Red/Images/Nike-Dunk-Low-Off-White-University-Red/Lv2/img", 61 | img2: ".jpg?auto=format,compress&q=90&updated_at=1606321824&w=1000", 62 | cantidad: 1 63 | }, 64 | { 65 | id: 7, 66 | title: "Nike Air Max 2 Light Atmos", 67 | price: 360, 68 | image: "https://stockx-360.imgix.net/Nike-Air-Max-2-Light-Atmos/Images/Nike-Air-Max-2-Light-Atmos/Lv2/img01.jpg?auto=format,compress&q=90&updated_at=1606320966&w=1000", 69 | category: "nike", 70 | img1: "https://stockx-360.imgix.net/Nike-Air-Max-2-Light-Atmos/Images/Nike-Air-Max-2-Light-Atmos/Lv2/img", 71 | img2: ".jpg?auto=format,compress&q=90&updated_at=1606320966&w=1000", 72 | cantidad: 1 73 | }, 74 | { 75 | id: 8, 76 | title: "Nike Air Force 1 Low CLOT Blue Silk", 77 | price: 335, 78 | image: "https://stockx-360.imgix.net/Nike-Air-Force-1-Low-Clot-Blue-Silk/Images/Nike-Air-Force-1-Low-Clot-Blue-Silk/Lv2/img01.jpg?auto=format,compress&q=90&updated_at=1606325265&w=1000", 79 | category: "nike", 80 | img1: "https://stockx-360.imgix.net/Nike-Air-Force-1-Low-Clot-Blue-Silk/Images/Nike-Air-Force-1-Low-Clot-Blue-Silk/Lv2/img", 81 | img2: ".jpg?auto=format,compress&q=90&updated_at=1606325265&w=1000", 82 | cantidad: 1 83 | }, 84 | { 85 | id: 9, 86 | title: "Nike Air Max 90 OG Volt (2020)", 87 | price: 799, 88 | image: "https://stockx-360.imgix.net/Nike-Air-Max-90-OG-White-Particle-Grey-Volt/Images/Nike-Air-Max-90-OG-White-Particle-Grey-Volt/Lv2/img01.jpg?auto=format,compress&q=90&updated_at=1606323250&w=1000", 89 | category: "nike", 90 | img1: "https://stockx-360.imgix.net/Nike-Air-Max-90-OG-White-Particle-Grey-Volt/Images/Nike-Air-Max-90-OG-White-Particle-Grey-Volt/Lv2/img", 91 | img2: ".jpg?auto=format,compress&q=90&updated_at=1606323250&w=1000", 92 | cantidad: 1 93 | }, 94 | { 95 | id: 10, 96 | title: "Nike Dunk High Varsity Maize", 97 | price: 501, 98 | image: "https://stockx-360.imgix.net/Nike-Dunk-High-Black-Varsity-Maize/Images/Nike-Dunk-High-Black-Varsity-Maize/Lv2/img01.jpg?auto=format,compress&q=90&updated_at=1609445259&w=1000", 99 | category: "nike", 100 | img1: "https://stockx-360.imgix.net/Nike-Dunk-High-Black-Varsity-Maize/Images/Nike-Dunk-High-Black-Varsity-Maize/Lv2/img", 101 | img2: ".jpg?auto=format,compress&q=90&updated_at=1609445259&w=1000", 102 | cantidad: 1 103 | }, 104 | { 105 | id: 11, 106 | title: "Nike Air Rubber Dunk Off-White UNC", 107 | price: 377, 108 | image: "https://stockx-360.imgix.net/Nike-Air-Rubber-Dunk-Off-White-UNC/Images/Nike-Air-Rubber-Dunk-Off-White-UNC/Lv2/img01.jpg?auto=format,compress&q=90&updated_at=1609438911&w=1000", 109 | category: "nike", 110 | img1: "https://stockx-360.imgix.net/Nike-Air-Rubber-Dunk-Off-White-UNC/Images/Nike-Air-Rubber-Dunk-Off-White-UNC/Lv2/img", 111 | img2: ".jpg?auto=format,compress&q=90&updated_at=1609438911&w=1000", 112 | cantidad: 1 113 | }, 114 | ], 115 | }; 116 | 117 | export default data; -------------------------------------------------------------------------------- /.eslintcache: -------------------------------------------------------------------------------- 1 | [{"C:\\Users\\USER\\Desktop\\jehingson\\estudio\\youtube\\video5\\src\\index.js":"1","C:\\Users\\USER\\Desktop\\jehingson\\estudio\\youtube\\video5\\src\\reportWebVitals.js":"2","C:\\Users\\USER\\Desktop\\jehingson\\estudio\\youtube\\video5\\src\\App.js":"3","C:\\Users\\USER\\Desktop\\jehingson\\estudio\\youtube\\video5\\src\\context\\DataProvider.js":"4","C:\\Users\\USER\\Desktop\\jehingson\\estudio\\youtube\\video5\\src\\components\\Header.js":"5","C:\\Users\\USER\\Desktop\\jehingson\\estudio\\youtube\\video5\\src\\components\\Page.js":"6","C:\\Users\\USER\\Desktop\\jehingson\\estudio\\youtube\\video5\\src\\components\\page\\inicio\\index.js":"7","C:\\Users\\USER\\Desktop\\jehingson\\estudio\\youtube\\video5\\src\\components\\page\\productos\\index.js":"8","C:\\Users\\USER\\Desktop\\jehingson\\estudio\\youtube\\video5\\src\\Data.js":"9","C:\\Users\\USER\\Desktop\\jehingson\\estudio\\youtube\\video5\\src\\components\\Carrito.js":"10","C:\\Users\\USER\\Desktop\\jehingson\\estudio\\youtube\\video5\\src\\components\\page\\productos\\ProductosDetalles.js":"11","C:\\Users\\USER\\Desktop\\jehingson\\estudio\\youtube\\video5\\src\\components\\page\\productos\\productoItem.js":"12","C:\\Users\\USER\\Desktop\\jehingson\\estudio\\youtube\\video5\\src\\components\\page\\productos\\ProductoItem.js":"13","C:\\Users\\USER\\Desktop\\jehingson\\estudio\\youtube\\video5\\src\\Data2.js":"14"},{"size":500,"mtime":499162500000,"results":"15","hashOfConfig":"16"},{"size":362,"mtime":499162500000,"results":"17","hashOfConfig":"16"},{"size":509,"mtime":1610554890679,"results":"18","hashOfConfig":"16"},{"size":1583,"mtime":1611505120563,"results":"19","hashOfConfig":"16"},{"size":1001,"mtime":1610581173286,"results":"20","hashOfConfig":"16"},{"size":547,"mtime":1610559362435,"results":"21","hashOfConfig":"16"},{"size":431,"mtime":1610581052209,"results":"22","hashOfConfig":"16"},{"size":699,"mtime":1610581016906,"results":"23","hashOfConfig":"16"},{"size":4297,"mtime":1610579249068,"results":"24","hashOfConfig":"16"},{"size":2611,"mtime":1611505213931,"results":"25","hashOfConfig":"16"},{"size":3512,"mtime":1611505189957,"results":"26","hashOfConfig":"16"},{"size":925,"mtime":1610572224294,"results":"27","hashOfConfig":"16"},{"size":917,"mtime":1611505155584,"results":"28","hashOfConfig":"16"},{"size":5917,"mtime":1611505322644,"results":"29","hashOfConfig":"16"},{"filePath":"30","messages":"31","errorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0},"glrxny",{"filePath":"32","messages":"33","errorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0},{"filePath":"34","messages":"35","errorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0},{"filePath":"36","messages":"37","errorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0},{"filePath":"38","messages":"39","errorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0},{"filePath":"40","messages":"41","errorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0},{"filePath":"42","messages":"43","errorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0},{"filePath":"44","messages":"45","errorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0},{"filePath":"46","messages":"47","errorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0},{"filePath":"48","messages":"49","errorCount":0,"warningCount":1,"fixableErrorCount":0,"fixableWarningCount":0,"source":null},{"filePath":"50","messages":"51","errorCount":0,"warningCount":3,"fixableErrorCount":0,"fixableWarningCount":0,"source":null},{"filePath":"52","messages":"53","errorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0},{"filePath":"54","messages":"55","errorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0},{"filePath":"56","messages":"57","errorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0},"C:\\Users\\USER\\Desktop\\jehingson\\estudio\\youtube\\video5\\src\\index.js",[],"C:\\Users\\USER\\Desktop\\jehingson\\estudio\\youtube\\video5\\src\\reportWebVitals.js",[],"C:\\Users\\USER\\Desktop\\jehingson\\estudio\\youtube\\video5\\src\\App.js",[],"C:\\Users\\USER\\Desktop\\jehingson\\estudio\\youtube\\video5\\src\\context\\DataProvider.js",[],"C:\\Users\\USER\\Desktop\\jehingson\\estudio\\youtube\\video5\\src\\components\\Header.js",[],"C:\\Users\\USER\\Desktop\\jehingson\\estudio\\youtube\\video5\\src\\components\\Page.js",[],"C:\\Users\\USER\\Desktop\\jehingson\\estudio\\youtube\\video5\\src\\components\\page\\inicio\\index.js",[],"C:\\Users\\USER\\Desktop\\jehingson\\estudio\\youtube\\video5\\src\\components\\page\\productos\\index.js",[],"C:\\Users\\USER\\Desktop\\jehingson\\estudio\\youtube\\video5\\src\\Data.js",[],"C:\\Users\\USER\\Desktop\\jehingson\\estudio\\youtube\\video5\\src\\components\\Carrito.js",["58"],"C:\\Users\\USER\\Desktop\\jehingson\\estudio\\youtube\\video5\\src\\components\\page\\productos\\ProductosDetalles.js",["59","60","61"],"C:\\Users\\USER\\Desktop\\jehingson\\estudio\\youtube\\video5\\src\\components\\page\\productos\\productoItem.js",[],"C:\\Users\\USER\\Desktop\\jehingson\\estudio\\youtube\\video5\\src\\components\\page\\productos\\ProductoItem.js",[],"C:\\Users\\USER\\Desktop\\jehingson\\estudio\\youtube\\video5\\src\\Data2.js",[],{"ruleId":"62","severity":1,"message":"63","line":2,"column":8,"nodeType":"64","messageId":"65","endLine":2,"endColumn":12},{"ruleId":"66","severity":1,"message":"67","line":18,"column":10,"nodeType":"68","endLine":18,"endColumn":11},{"ruleId":"66","severity":1,"message":"69","line":32,"column":5,"nodeType":"70","endLine":32,"endColumn":21,"suggestions":"71"},{"ruleId":"72","severity":1,"message":"73","line":83,"column":33,"nodeType":"74","messageId":"75","endLine":83,"endColumn":35},"no-unused-vars","'Card' is defined but never used.","Identifier","unusedVar","react-hooks/exhaustive-deps","Assignments to the 'item' variable from inside React Hook useEffect will be lost after each render. To preserve the value over time, store it in a useRef Hook and keep the mutable value in the '.current' property. Otherwise, you can move this variable directly inside useEffect.","Literal","React Hook useEffect has missing dependencies: 'detalle.img1' and 'detalle.img2'. Either include them or remove the dependency array.","ArrayExpression",["76"],"array-callback-return","Array.prototype.map() expects a value to be returned at the end of arrow function.","ArrowFunctionExpression","expectedAtEnd",{"desc":"77","fix":"78"},"Update the dependencies array to be: [url, params.id, detalle.img1, detalle.img2]",{"range":"79","text":"80"},[938,954],"[url, params.id, detalle.img1, detalle.img2]"] -------------------------------------------------------------------------------- /src/index.css: -------------------------------------------------------------------------------- 1 | *{ 2 | padding: 0; 3 | margin: 0; 4 | font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', 'Oxygen', 5 | 'Ubuntu', 'Cantarell', 'Fira Sans', 'Droid Sans', 'Helvetica Neue', 6 | sans-serif; 7 | -webkit-font-smoothing: antialiased; 8 | -moz-osx-font-smoothing: grayscale; 9 | } 10 | 11 | code { 12 | font-family: source-code-pro, Menlo, Monaco, Consolas, 'Courier New', 13 | monospace; 14 | } 15 | .App{ 16 | max-width: 1555px; 17 | width: 100%; 18 | min-height: 100vh; 19 | margin: auto; 20 | box-shadow: 0 2px 6px #08a05ca4;; 21 | padding: 0 15px; 22 | box-sizing: border-box; 23 | 24 | } 25 | /*-----------------INICIO-------------------*/ 26 | .inicio{ 27 | width: 100%; 28 | margin: 0 auto; 29 | padding-top: 9rem ; 30 | } 31 | .inicio h1{ 32 | font-size: 2.5rem; 33 | color: #08a05c; 34 | } 35 | .inicio img{ 36 | width: 100%; 37 | } 38 | 39 | /* ----------------- HEADER -------------------*/ 40 | header{ 41 | width: 97%; 42 | min-height: 100px; 43 | max-width:1530px; 44 | overflow: hidden; 45 | display: flex; 46 | justify-content: space-around; 47 | align-items: center; 48 | flex-wrap: wrap; 49 | position: fixed; 50 | box-sizing: border-box ; 51 | background-color: white; 52 | box-shadow: 0 10px 10px #08a05c50; 53 | } 54 | a{ 55 | color: black; 56 | text-decoration: none; 57 | text-transform: uppercase; 58 | } 59 | a:hover{ 60 | color: #08a05c; 61 | } 62 | .menu{ 63 | display: none; 64 | } 65 | li{ 66 | list-style: none; 67 | } 68 | 69 | header ul{ 70 | display: flex; 71 | padding: 0; 72 | margin: 0; 73 | } 74 | header ul li{ 75 | padding: 0 1rem; 76 | } 77 | header ul li a{ 78 | font-weight: bold; 79 | } 80 | 81 | .cart{ 82 | position: relative; 83 | cursor: pointer; 84 | } 85 | .cart box-icon{ 86 | width: 45px; 87 | height: 45px; 88 | 89 | } 90 | .cart span{ 91 | position: absolute; 92 | top: -1rem; 93 | right: -1.5rem; 94 | width: 2.5rem; 95 | height: 2.5rem; 96 | display: flex; 97 | align-items: center; 98 | justify-content: center; 99 | color: white; 100 | padding: 0rem; 101 | font-size: 1.5rem; 102 | font-weight: 700; 103 | border-radius: 50%; 104 | background-color: crimson; 105 | } 106 | 107 | /*----------- PRODUCTOS ------------*/ 108 | .produ{ 109 | font-size: 2.4rem; 110 | padding: 10rem 0 0 0; 111 | color: #08a05c; 112 | } 113 | .productos{ 114 | padding: 5rem 3rem; 115 | margin: 0 auto; 116 | display: grid; 117 | grid-template-columns: repeat(auto-fit, minmax(22rem, 1fr)); 118 | gap: 3rem 1rem; 119 | box-sizing: border-box ; 120 | } 121 | .producto{ 122 | display: flex; 123 | flex-direction: column; 124 | align-items: center; 125 | box-shadow: 1px 10px 10px 2px rgba(0, 0, 0, 0.1); 126 | border: 6px solid transparent; 127 | cursor: pointer; 128 | border-radius: 5px; 129 | } 130 | .producto:hover{ 131 | border: 6px solid #08a05c57; 132 | ; 133 | } 134 | .producto__img img{ 135 | width: 310px; 136 | } 137 | .producto__footer{ 138 | padding: 1rem; 139 | } 140 | .producto__footer h1{ 141 | font-weight: 600; 142 | font-size: 1.5rem; 143 | color: #1a202c; 144 | font-family: Helvetica, sans-serif 145 | ; 146 | } 147 | .producto__footer p{ 148 | font-weight: 700; 149 | color: rgba(0, 0, 0, 0.555); 150 | text-transform: uppercase; 151 | font-size: 18px; 152 | } 153 | .producto__footer .price{ 154 | font-size: 2rem; 155 | color: #1a202c; 156 | } 157 | .productos .bottom{ 158 | width: 100%; 159 | height: 45px; 160 | display: grid; 161 | grid-template-columns: 2fr 1fr; 162 | gap: 1rem 2rem; 163 | } 164 | .bottom .btn{ 165 | border: none; 166 | outline: 0; 167 | cursor: pointer; 168 | border-radius: 5px; 169 | } 170 | .bottom button{ 171 | background-color: #3033d3; 172 | max-width: 250px; 173 | width: 100%; 174 | margin: 0 auto; 175 | font-size: 1.5rem; 176 | color: white; 177 | font-weight: 600; 178 | } 179 | .bottom div{ 180 | background-color:#08a05c; 181 | display: grid; 182 | align-items: center; 183 | text-align: center; 184 | margin-left: -2rem; 185 | border-radius: 5px; 186 | } 187 | .bottom div a{ 188 | color: white; 189 | font-weight: 700; 190 | } 191 | .bottom div a:hover{ 192 | color: white; 193 | } 194 | /*-----------------CARRITO -----------*/ 195 | .carritos{ 196 | position: fixed; 197 | top: 0; 198 | left: 0; 199 | width: 100%; 200 | height: 100%; 201 | transition: all 300ms ease-in-out; 202 | background-color: rgba(0, 0, 0, .6); 203 | z-index: 2; 204 | padding-bottom: 5rem; 205 | visibility: hidden; 206 | } 207 | .carrito{ 208 | position: fixed; 209 | top: 50%; 210 | left: 50%; 211 | transform: translate(-50%, -50%) scale(.5); 212 | width: 60%; 213 | height: 80%; 214 | padding: 1.6rem; 215 | border-radius: 8px; 216 | overflow-x: scroll; 217 | transition: all 300ms ease-in-out; 218 | background-color: white; 219 | opacity: 0; 220 | visibility: hidden; 221 | } 222 | .carrito h2{ 223 | text-align: center; 224 | font-size: 2rem; 225 | } 226 | .carritos.show{ 227 | visibility: visible; 228 | } 229 | 230 | .carrito.show{ 231 | transform: translate(-50%, -50%) scale(1.1); 232 | opacity: 1; 233 | visibility: visible; 234 | } 235 | .carrito__close box-icon{ 236 | display: inline-block; 237 | width: 50px; 238 | height: 50px; 239 | cursor: pointer; 240 | transform: all 300ms ease-in-out; 241 | margin: 3rem 0 0 2rem 242 | } 243 | .carrito__close box-icon:hover { 244 | fill: crimson; 245 | } 246 | .carrito__center{ 247 | width: 98%; 248 | margin: 0 auto; 249 | } 250 | .carrito__item{ 251 | display: grid; 252 | grid-template-columns: 1fr 2fr 1fr 1fr; 253 | width: 80%; 254 | margin: 2rem auto; 255 | box-shadow: 0 1px 10px saddlebrown; 256 | border-radius: 5px; 257 | } 258 | .carrito__item div{ 259 | display: flex; 260 | flex-direction: column; 261 | align-items: center; 262 | } 263 | .carrito__item img{ 264 | width: 10rem; 265 | } 266 | .carrito__item h3{ 267 | margin-top: 1.5rem; 268 | font-family: Helvetica, sans-serif; 269 | font-weight: 600; 270 | font-size: 1.5rem; 271 | } 272 | .carrito__item .price{ 273 | color: #1a202c; 274 | font-size: 2rem; 275 | font-weight: bold; 276 | text-align: start; 277 | margin-left: -17rem ; 278 | } 279 | .carrito__item box-icon{ 280 | fill:#08a05c; 281 | width: 40px; 282 | height: 40px; 283 | cursor: pointer; 284 | margin-top: .3rem; 285 | } 286 | .carrito__item .cantidad{ 287 | font-size: 2rem; 288 | font-weight: bold; 289 | } 290 | .carrito__item .remove__item box-icon{ 291 | width: 60px; 292 | height: 80px; 293 | fill: crimson; 294 | margin-top: 2rem; 295 | } 296 | .carrito__footer{ 297 | text-align: center; 298 | margin-bottom: 3rem; 299 | } 300 | .carrito__footer h3{ 301 | font-size: 2rem; 302 | font-weight: 700; 303 | letter-spacing: 1px; 304 | } 305 | .carrito__footer .btn{ 306 | display: inline-block; 307 | padding: .3rem 1rem; 308 | font-size: 1.2rem; 309 | background-color: #08a05c; 310 | border: 0; 311 | outline: 0; 312 | cursor: pointer; 313 | } 314 | .carrito__footer .btn:hover{ 315 | background-color: #0f5c39; 316 | color: white; 317 | } 318 | /*--------------DETALLES --------------*/ 319 | .detalles{ 320 | display: flex; 321 | flex-direction: column; 322 | width: 100%; 323 | padding: 13rem 1rem 0 1rem; 324 | box-sizing: border-box; 325 | } 326 | .detalles h2{ 327 | font-size: 3.5rem; 328 | width: 100%; 329 | max-width: 1000px; 330 | margin: 0 auto; 331 | font-family:Helvetica, sans-serif; 332 | color: #1a202c; 333 | } 334 | .detalles .price{ 335 | font-size: 2.5rem; 336 | font-weight: 700; 337 | color: #08a05c; 338 | } 339 | .detalles button{ 340 | max-width: 300px; 341 | margin: 1rem 0 0 0; 342 | padding: 1rem 1rem; 343 | border: none; 344 | outline: 0; 345 | background-color: #3033d3; 346 | font-size: 1.6rem; 347 | color: white; 348 | font-weight: 600; 349 | border-radius: 8px; 350 | cursor: pointer; 351 | } 352 | .detalles .grid{ 353 | display: grid; 354 | grid-template-columns: 1fr 1fr; 355 | gap: 2rem 1rem; 356 | max-width: 350px; 357 | } 358 | .detalles .grid > .nuevo, .tamano{ 359 | padding: 1rem 2rem; 360 | border-radius: 8px; 361 | font-size: 2rem; 362 | font-weight: 600; 363 | color: white; 364 | 365 | } 366 | .detalles .grid .nuevo{ 367 | background-color:#08a05c; 368 | 369 | } 370 | .detalles .grid .tamano{ 371 | background-color:#f1365b; 372 | display: flex; 373 | } 374 | .detalles .grid .tamano select{ 375 | border: none; 376 | outline: 0; 377 | font-size: 2rem; 378 | background-color:#f1365b; 379 | color: white; 380 | cursor: pointer; 381 | } 382 | .detalles img{ 383 | min-height: 300px; 384 | object-fit: contain; 385 | margin-top: -7rem; 386 | z-index: -1; 387 | } 388 | .detalles input{ 389 | max-width: 700px; 390 | margin: 0 auto; 391 | width: 100%; 392 | margin-bottom: 2rem; 393 | } 394 | .detalles .description{ 395 | font-size: 1.1rem; 396 | max-width: 1300px; 397 | width: 100%; 398 | letter-spacing: 1px; 399 | color: #5f5d5d; 400 | margin: 0 auto; 401 | font-weight: 500; 402 | } 403 | .detalles .description b{ 404 | font-size: 1.4rem; 405 | color: #30333a; 406 | } 407 | 408 | 409 | 410 | /* ------------- RELACIONADO --------- */ 411 | .relacionados{ 412 | text-align: center; 413 | background-color: #2e2e2e; 414 | color: white; 415 | max-width: 350px; 416 | width: 100%; 417 | margin: 5rem auto -2rem auto; 418 | padding: .5rem 1rem; 419 | font-size: 18px; 420 | letter-spacing: 3px; 421 | text-transform: uppercase; 422 | font-family: Helvetica, sans-serif 423 | ; 424 | } 425 | 426 | 427 | /* -------------MEDIA -------------*/ 428 | @media only screen and (max-width: 1000px){ 429 | .carrito__item{ 430 | width: 92%; 431 | } 432 | } 433 | @media only screen and (max-width: 888px){ 434 | .detalles input{ 435 | margin-top: -6rem; 436 | } 437 | } 438 | @media only screen and (max-width: 700px){ 439 | .carrito{ 440 | width: 100%; 441 | height: 100%; 442 | padding: 1rem; 443 | } 444 | .carrito__item h3{ 445 | font-size: 1.3rem; 446 | } 447 | .detalles h2{ 448 | font-size: 3rem; 449 | } 450 | 451 | } 452 | @media only screen and (max-width: 663px){ 453 | .detalles input{ 454 | margin-top: -8rem; 455 | } 456 | } 457 | 458 | @media only screen and (max-width: 570px){ 459 | header ul{ 460 | display: none; 461 | } 462 | .productos{ 463 | padding: 0; 464 | } 465 | .detalles h2{ 466 | font-size: 2.5rem; 467 | } 468 | .detalles input{ 469 | margin-top: 0rem ; 470 | } 471 | .detalles img{ 472 | object-fit: cover; 473 | width: 100%; 474 | height: 100%; 475 | margin: -1rem auto; 476 | } 477 | } 478 | @media only screen and (max-width: 450px){ 479 | .carrito__item h3{ 480 | font-size: .8rem; 481 | 482 | } 483 | .carrito__item .remove__item{ 484 | width: 20px; 485 | height: 20px; 486 | } 487 | .carrito__item box-icon{ 488 | width: 25px; 489 | height: 25px; 490 | } 491 | .detalles h2{ 492 | font-size:2rem; 493 | padding-top: 10rem ; 494 | } 495 | .detalles .grid > .nuevo, .tamano{ 496 | padding: 1rem 1rem; 497 | border-radius: 8px; 498 | font-size: 1.2rem; 499 | font-weight: 600; 500 | color: white; 501 | } 502 | .detalles .grid .tamano select{ 503 | font-size: 1.2rem; 504 | } 505 | .detalles img{ 506 | width: 300px; 507 | width: 100%; 508 | } 509 | .detalles{ 510 | padding: 1rem 0; 511 | } 512 | } --------------------------------------------------------------------------------