Yes, you can do it through JS but it’s not as simple as one might think.
First, you need an API to tell you where the visitor is actually located. However, doing it through the front-end would lead to some “misfires”. It won’t be accurate 100% of the time.
Once you have that in place, you can trigger your consent box.
It would be best if you hire a developer to help you out.
Do you have a developer you can recommend?