How todomagichere/quizzity works
Project Identification
• This is a client-side web application—a geographical quiz game (Capital mode) built on top of a Leaflet map.
• The core purpose is to let users guess the location of cities using an interactive map. The gameplay revolves around accuracy and speed in placing guesses.
Main Components
a. User Interface:
• HTML pages (index.html and index_es.html) serve as the starting points.
• CSS assets (css/quizzity.css and libraries like Animate.css, Font Awesome) for styling.
b. JavaScript Logic:
• Core quiz logic in the JS files (js/quizzity.js and js/quizzity_es.js).
• Integration of third-party libraries: Leaflet for the map, jQuery for DOM manipulation, lodash for utility functions, Leaflet.awesome-markers for custom markers, and Leaflet.Geodesic for geodesic lines.
c. And Geospatial Data:
• The Leaflet-based map that integrates:
• Tiles stored in a hierarchically structured “tiles” directory (organized by zoom levels and coordinates).
• Geodata JSON files (in the geodata directory) that include city and capital information in different languages (EN/ES).
d. Third-Party Libraries/Components:
• The “bower_components” folder, which includes all external libraries and resources necessary for the map and UI (Leaflet, animate.css, jquery, etc.).
Relationships and Interactions
• The user interacts with the HTML pages which load the CSS for styling and JavaScript for interactivity.
• The JavaScript files (quizzity.js and its localized version) initialize the Leaflet map and load the corresponding geodata JSON files.
• The map component pulls tiles from the “tiles” directory based on user interactions (zoom and pan).
Architectural Patterns and Design Principles
• Client-Side Focus: The entire logic is executed within the browser. There is minimal back-end interaction since the game is a static web app.
• Separation of Concerns: UI (HTML/CSS) is separate from business logic (JS) and data (geodata JSON and map tiles).
• Modularization: The project makes use of external libraries (organized in bower_components) to modularize functionality.