Help with Modal refresh and targeting

At the moment I have run into some issues trying to run javascript to close modal and refresh to parent page when a user hits the refresh in browser.

At the moment when a user does this it reverts what was the modal page to a normal and it's running some CSS based on the content it looks awfull.

Also cannot find a way to target specific modal pages for CSS for sizes. Has anyone had any luck in adding HTML classes for each individual modal page?

Have you used this event trigger yet?

$(document).on('knack-modal-render.view_', function(event, view) {
$('#selector').css('visibility', 'hidden'); //etc

});