How esti-martin/front-act05-escaparate works
Main Components
• User Interface Pages:
• index.html – The main dashboard that shows a listing of product cards.
• carrito.html – The shopping cart page where users can view and modify their chosen products.
• presupuesto.html – The budget/print page, which allows for a formatted print view.
• Assets:
• assets/data.json – Contains product data (name, description, price, stock, image links).
• Other images and resources possibly referenced by HTML or CSS.
• Presentation Layer:
• CSS Directory – Contains various CSS files (cards.css, carrito.css, formulario.css, menu.css, presupuesto.css, print.css, styles.css) that are each responsible for styling different sections/components (product cards, shopping cart, navigation menu, responsive layouts, etc.).
• Behavior/Logic Layer:
• JS Directory – Contains multiple JavaScript files (cards.js, carrito.js, icono-carrito.js, menu.js, presupuesto.js, scripts.js, stock.js) that add interactivity. For instance:
• cards.js and stock.js handle the product display and stock management.
• carrito.js and icono-carrito.js manage shopping cart functionalities.
• menu.js controls the responsive/hamburger menu behavior.
• presupuesto.js handles the budget printing functionality.
• scripts.js likely ties together general initialization and inter-component interaction.
Relationships and Interactions
• The HTML pages are the starting points for user interaction. They reference the CSS files to style the content and the JS files to enable dynamic behavior.
• JavaScript files interact with the DOM of each respective HTML page and pull in the product information from assets/data.json.
• CSS creates a cohesive, responsive design. For example, media queries in menu.css (and possibly in styles.css) support the transition from a multi-column dashboard to a mobile-friendly layout (with a hamburger/flyout filter menu).
• The structure implies a separation of concerns: layout (HTML), styling (CSS), and behavior/data manipulation (JS, JSON).
Architectural Patterns and Design Principles
• Componentization: The project is divided into logical components (UI pages, CSS styling modules, and JS behavior modules) that can be developed and maintained independently.
• Responsiveness: The responsive design principles (e.g., converting a vertical menu into a hamburger-style button on mobile) are central to the UI structure.
• Separation of Concerns: Different directories are dedicated to assets, styling, and scripts, emphasizing modularity.
• Data-driven UI: Utilizes an external JSON file for products, ensuring that the UI dynamically reflects the product data.