How oriana0615/jogo-amigo-secreto works
Main Components
• User Interface (UI): Represented by the HTML (index.html) for structure and CSS (style.css) for styling, which together form the front-end.
• Interaction/Logic Layer: The JavaScript file (app.js) acts as the core of the application—it handles user input, validation, the sorting algorithm, animations, and integration with the Web Speech API for TTS.
• Assets and Media: The assets folder holds images (e.g., the banner and developer photo) used in the UI.
• Configuration & Customization: Although not explicitly included in the file tree, the README mentions a config.js segment to adjust parameters (like maxParticipants, animationDuration, darkMode, etc.), so this acts as a customizable module controlling behavior.
Relationships and Interactions
• User actions in the browser (typing in names, clicking buttons) trigger event listeners inside app.js.
• app.js performs validations (checking for invalid inputs, duplicate names, etc.), maintains the participants list, and manages the sorting logic using Math.random().
• Once sorting is done, the UI is updated with animations to display the result, and the accessibility module (using the Web Speech API) might read out the results.
• The configuration settings, if present, influence how these components behave (for instance, determining the maximum participants or animation times).
Architectural Patterns and Design Principles
• The project implements a clear separation between the static UI layer (HTML/CSS) and the dynamic behavior and logic layer (JavaScript).
• The use of modular design in app.js (with clearly separated functions for validation, sorting, and display) is a good practice.
• Strong emphasis on user experience aspects includes robust form validations and accessibility features, following best practices for web development.
Relevant Technologies
• HTML5: Used to structure the webpage.
• CSS3: Provides styling and responsive design, ensuring high contrast (for accessibility) and dark mode support.
• Web Speech API (TTS): Integrates accessibility by reading outputs on screen.
• Additional configuration might use a config.js file, which influences UI behavior and application constraints.