Trying to display an SVG on mobile and desktop browsers has its challenges. The square shape of the SVG makes centering it vertically and horizontally using 'contain' ineffective, resulting in a centered square image, which is not the desired outcome.
The goal is to center the image and zoom in on it, displaying only part of the image with the rest clipped by the viewport. Unfortunately, images cannot be uploaded for demonstration purposes, but the following drawing should provide clarity:
Mobile:
┌┄┄┄┄╔═══════╗┄┄┄┄┐
┆ ║ ║ ┆
┆ ║ ║ ┆
┆ ║ ║ ┆
┆ ║ ║ ┆
┆ ║ ║ ┆
┆ ║ ║ ┆
└┄┄┄┄╚═══════╝┄┄┄┄┘
^ ^
| |
viewport image
Desktop:
image
|
v
┌┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┐
╔═════════════════╗
║ ║
║ ║
║ ║
║ ║<-- viewport
║ ║
║ ║
╚═════════════════╝
└┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┘
Attempts at using 'object-fit: cover' have proven unsuccessful so far.