I wrote a Dev article on this topic at
Click for details about the project, then my codepen at the end of the article contains the code.
A quick note about me. I am a retired Data Analyst wanting to contribute to the greater good of the learning community. All my stuff is free as I do this just as a hobby to keep my mind sharp at my age.