To minimise the scope of the functions and to make them have a single purpose it is recommended that all the code regarding the "frame" logic to be rendered only in the "renderCocktailDetails" function.
So after the modifications the main "logic" of the code should be the following:
window onload calls loadDetailsPage
loadDetailsPage calls renderHeaderImage
renderHeaderImage renders the header image
the renderHeaderImage appends the two icons that are returned from the "renderIcon" function
loadDetailsPage appends to the "body" element the result of the renderHeaderImage
loadDetailsPage calls renderCocktailDetails
renderCocktailDetails renders the title, tags, ingredient list, instruction list and bottom buttons.
https://github.com/Stellar-Junior-Dev/cocktailMasters-cosmin/blob/ea54941415d5eaccef593cf4838dec64aa70a9dd/detailsPage/script.js#L94
To minimise the scope of the functions and to make them have a single purpose it is recommended that all the code regarding the "frame" logic to be rendered only in the "renderCocktailDetails" function.
So after the modifications the main "logic" of the code should be the following: