Works in codepen, Not on localhost
Briefly

When transitioning from CodePen to localhost, ensure API fetches are correctly set, focusing on CORS policies that may block requests from local environments.
Running your JavaScript in a local environment may lead to issues with mixed content or CORS, especially if attempting to access HTTP resources from an HTTPS site.
Read at SitePoint Forums | Web Development & Design Community
[
|
]