How bjornlb21/amigo-secreto works
Main Components
• User Interface (UI):
• index.html: The main web page that users interact with.
• style.css: The stylesheet that defines the look and feel.
• Application Logic:
• app.js: Contains the core functionality including adding a friend, sorting a friend pairing, validating user input, and resetting lists.
• Assets:
Component Interactions and Relationships
• User Interaction Flow:
• Users open index.html in a browser.
• The browser loads style.css to style the HTML and app.js to provide dynamic behavior.
• JavaScript Functionality:
• In app.js, UI events (e.g., button clicks to "Agregar Amigo" or "Sortear Amigo") trigger functions that handle data validation, friend addition, friend drawing, and list resetting.
• These functions update the DOM elements on index.html to reflect state changes.
• Assets Integration:
• The assets folder is used to load any supporting media, such as images or the video referenced in the README, ensuring the app remains visually engaging.
Important Architectural Patterns
• Separation of Concerns:
• The project is organized so that the presentation (HTML/CSS) is separate from the business logic (JavaScript).
• Event-Driven Design:
• The web app responds to user events (clicks, inputs), which drive the application logic in app.js.
• Lightweight, Client-Side Application:
• There is no backend involved; all functionality is implemented in the client’s browser.