“toggle” files to download as a zip folder

There’s a website called Vanilla Tweaks (https://vanillatweaks.net/picker/resource-packs/) where you can choose features which are then put into a zip file which you can download. I was trying to recreate this feature with basic java script but can’t seem to find anything helpful.

I looked it up online but could barely find anything. The only thing that seemed to help was JSZip but i’m not quite sure if it is possible to use it with folders inside of the zip file