You would need to get it custom developed.
The guide you shown is only for specific themes, this case it states in that link it works for brooklyn theme.
Not all code works on all themes. It's like installing a ford motor onto a mazda car, it wont work, different parts, connects etc etc.
Same with coding, there's different classes, ids etc.
You essentially need to change the swatche/variant options, and show the featured variant image.
You could probably find, but this sort of thing you dont need js,
You just need some backend development, instead of showing the colours/text, you should the variant featured image. then throw some css to make it look pretty.