Module: display

Manages rendering and updating the UI for films, series, and their details. Handles DOM manipulation for displaying media content and metadata.
Source:

Methods

(inner) createCollectionCard(collection) → {string}

Creates HTML for a single collection card. Clicking the card opens a modal that lists all films and series in the collection.
Parameters:
Name Type Description
collection Object The collection object ({ name, films, series }).
Source:
Returns:
HTML string for the collection card.
Type
string

(inner) createContentCard(item) → {string}

Generates the HTML for a single content card (film or series).
Parameters:
Name Type Description
item Object The content item to render.
Source:
Returns:
The HTML string for the content card.
Type
string

(inner) displayCollectionPage(collection)

Renders the collection page with films and series grids.
Parameters:
Name Type Description
collection Object
Source:

(async, inner) displayCollections() → {Promise.<void>}

Displays available collections in the collections grid. Fetches `data/collections.json` if `collectionsData` is not already loaded.
Source:
Returns:
Type
Promise.<void>

(inner) displayContent(items, containerId) → {void}

Renders a list of content items (films or series) into a specified container.
Parameters:
Name Type Description
items Array.<Object> Array of content items to display.
containerId string The DOM element ID where content will be injected.
Source:
Returns:
Type
void

(inner) displayFilms(films) → {void}

Displays a sorted list of films in the films grid container.
Parameters:
Name Type Description
films Array.<Object> Array of film objects to display.
Source:
Returns:
Type
void

(inner) displayPopularContent() → {void}

Displays the most popular films and series based on IMDb ratings. Sorts and selects the top 6 films and series, then renders them in their respective containers.
Source:
Returns:
Type
void

(inner) displaySeries(series) → {void}

Displays a sorted list of series in the series grid container.
Parameters:
Name Type Description
series Array.<Object> Array of series objects to display.
Source:
Returns:
Type
void

(inner) getItemType(item) → {string}

Determines the type of a content item (film or series).
Parameters:
Name Type Description
item Object The content item to check.
Source:
Returns:
Returns `"series"` if the item has a `seasons` property, otherwise `"film"`.
Type
string

(inner) getLatestFilm() → {Object}

Retrieves the most recently added film from the films data.
Source:
Returns:
The latest film object.
Type
Object

(inner) getLatestSeries() → {Object}

Retrieves the most recently added series from the series data.
Source:
Returns:
The latest series object.
Type
Object

(inner) renderFeaturedSlider() → {void}

Renders the featured slider with the latest film and series. Handles slider navigation, auto-sliding, and click events to open modals for featured items.
Source:
Returns:
Type
void

(inner) showCollectionPage(collectionName)

Navigates to the collection page and displays its content.
Parameters:
Name Type Description
collectionName string
Source:

(inner) showNoResults(messageopt) → {string}

Generates the HTML for a "no results" message.
Parameters:
Name Type Attributes Default Description
message string <optional>
"Aucun résultat trouvé" The message to display.
Source:
Returns:
The HTML string for the no results message.
Type
string