Drupal 8 block visibility on path with anchor

I have created a view using the TimelineJS library. I have a path of /where-we-work for the page display and the library generate an anchor for each node. I end up with paths like /where-we-work#events-x and /where-we-work#events-y. I am trying to display different blocks below this view depending upon the value of the anchor. My understanding is that PHP will not retrieve the anchor value of “events-y”. I have been told that jQuery is the way to go with this but I’m stumped about how to do this in block visibility with PHP. Can anyone point me in the right direction as to how to embed some jQuery code within PHP that retrieves the anchor and then determines whether this variable contains a string?

Drupal version: 

Source: https://www.drupal.org/taxonomy/term/22/feed