JSFiddle - React, Tailwind, and code Playground
HTML
<div id="gallery1">
<img src="http://mrsalvador.ru/old/img/superbox1/superbox-full-1.jpg" alt="" tabindex="0" />
<img src="http://mrsalvador.ru/old/img/superbox1/superbox-full-2.jpg" alt="" tabindex="0" />
<img src="http://mrsalvador.ru/old/img/superbox1/superbox-full-3.jpg" alt="" tabindex="0" />
<img src="http://mrsalvador.ru/old/img/superbox1/superbox-full-5.jpg" alt="" tabindex="0" />
<img src="http://mrsalvador.ru/old/img/superbox1/superbox-full-6.jpg" alt="" tabindex="0" />
<img src="http://mrsalvador.ru/old/img/superbox1/superbox-full-7.jpg" alt="" tabindex="0" />
<img src="http://mrsalvador.ru/old/img/superbox1/superbox-full-8.jpg" alt="" tabindex="0" />
<img src="http://mrsalvador.ru/old/img/superbox1/superbox-full-4.jpg" alt="" tabindex="0" />
<img src="http://mrsalvador.ru/old/img/superbox1/superbox-full-9.jpg" alt="" tabindex="0" />
<img src="http://mrsalvador.ru/old/img/superbox1/superbox-full-10.jpg" alt="" tabindex="0" />
<img src="http://mrsalvador.ru/old/img/superbox1/superbox-full-11.jpg" alt="" tabindex="0" />
<img src="http://mrsalvador.ru/old/img/superbox1/superbox-full-12.jpg" alt="" tabindex="0" />
</div>
CSS
#gallery1 {
position: relative;
padding-top: 50%;
-moz-user-select: none; user-select: none;
}
#gallery1 img {
position: absolute;
top: 25%;
left: 12.5%;
max-width: 24.5%;
max-height: 49.5%;
-webkit-transform: translate(-50%, -50%);
transform: translate(-50%, -50%);
-moz-user-select: none; user-select: none;
cursor: zoom-in;
}
#gallery1 img:nth-child(4n-2) {left: 37.5%;}
#gallery1 img:nth-child(4n-1) {left: 62.5%;}
#gallery1 img:nth-child(4n) {left: 87.5%;}
#gallery1 img:nth-child(n+5) {top: 75%;}
#gallery1 img:focus {
position: fixed;
top: 50%;
left: 50%;
z-index: 31;
max-width: 100%;
max-height: 100%;
outline: none;
pointer-events: none;
}
#gallery1 img:focus ~ div {
position: fixed;
top: 0;
left: 0;
right: 0;
bottom: 0;
z-index: 30;
background: rgba(240,240,240,.9);
cursor: zoom-out;
}