Hi,
Did you check this? https://www.youtube.com/watch?v=5vKaUwhZMX0&ab_channel=AEMTutorials Sorry, I haven't done this type of requirement myself, but the link you shared is a great starting point if you need to create your own implementation. Perhaps I would remove the UI part and adjust the JS ...