Module: main

js/main.js Main application logic for routing, filtering, searching, and initializing the app.
Source:

Methods

(inner) applyFilters()

Applies selected filters and sorting to the displayed items.
Source:

(inner) clearSearch()

Clears search input fields.
Source:

(inner) enableHorizontalWheelScroll(root)

Enables horizontal scrolling for elements with the 'scroll-row' class using the mouse wheel.
Parameters:
Name Type Description
root The root element to search within (default is document).
Source:

(inner) handleSearch(e)

Handles search input and updates the displayed content accordingly.
Parameters:
Name Type Description
e Event The input event.
Source:

(inner) initHero()

Initializes the hero section with a featured item or the latest item.
Source:

(inner) populateFilters()

Populates filter dropdowns based on available data.
Source:

(inner) resetFilters()

Resets all filters to default values and reapplies them.
Source:

(inner) router(view)

Routes to the specified view and updates the UI accordingly.
Parameters:
Name Type Description
view string The view to route to ('home', 'series', 'films', 'collections', 'actors').
Source:

(inner) textWhite(navHome, navSeries, navFilms, navCollections)

Sets navigation link colors to default (removes highlight).
Parameters:
Name Type Description
navHome HTMLElement Navigation link elements
navSeries HTMLElement Navigation link elements
navFilms HTMLElement Navigation link elements
navCollections HTMLElement Navigation link elements
Source: