I'm working on a responsive image grid and looking to create a unique design. Instead of repeating the same image in each box, I would like to implement a mask that shows the image across all boxes, similar to this:
Additionally, I want to add a flipping effect to each box so that when it flips over, it reveals a different picture exclusive to that box.
Thank you in advance for any assistance provided.
div.grid {
font-size: 0;
width: 95%;
margin: 30px auto;
font-family: sans-serif;
}
a.grid {
font-size: 16px;
overflow: hidden;
display: inline-block;
margin-bottom: 8px;
width: calc(50% - 4px);
margin-right: 8px;
clip:
}
a.grid:nth-of-type(2n) {
margin-right: 0;
}
@media screen and (min-width: 50em) {
a.grid {
width: calc(25% - 6px);
}
a.grid:nth-of-type(2n) {
margin-right: 8px;
}
a.grid:nth-of-type(4n) {
margin-right: 0;
}
}
a.grid:hover img {
}
figure {
margin: 0;
}
img.grid {
border: none;
max-width: 100%;
height: auto;
display: block;
background: #ccc;
transition: transform .2s ease-in-out;
}
.p a {
display: inline;
font-size: 13px;
margin: 0;
}
.p {
text-align: center;
font-size: 13px;
padding-top: 100px;
}
<div class="grid">
<a class="grid" href="#">
<figure>
<img class="grid" src="https://static.pexels.com/photos/7613/pexels-photo.jpg" alt="">
</figure>
</a>
<a class="grid" href="#">
<figure>
<img class="grid" src="https://static.pexels.com/photos/7613/pexels-photo.jpg" alt="">
</figure>
</a>
<a class="grid" href="#">
<figure>
<img class="grid" src="https://static.pexels.com/photos/7613/pexels-photo.jpg" alt="">
</figure>
</a>
<a class="grid" href="#">
<figure>
<img class="grid" src="https://static.pexels.com/photos/7613/pexels-photo.jpg" alt="">
</figure>
</a>
<a class="grid" href="#">
<figure>
<img class="grid" src="https://static.pexels.com/photos/7613/pexels-photo.jpg" alt="">
</figure>
</a>
<a class="grid" href="#">
<figure>
<img class="grid" src="https://static.pexels.com/photos/7613/pexels-photo.jpg" alt="">
</figure>
</a>
<a class="grid" href="#">
<figure>
<img class="grid" src="https://static.pexels.com/photos/7613/pexels-photo.jpg" alt="">
</figure>
</a>
<a class="grid" href="#">
<figure>
<img class="grid" src="https://static.pexels.com/photos/7613/pexels-photo.jpg" alt="">
</figure>
</a>
<a class="grid" href="#">
<figure>
<img class="grid" src="https://static.pexels.com/photos/7613/pexels-photo.jpg" alt="">
</figure>
</a>
<a class="grid" href="#">
<figure>
<img class="grid" src="https://static.pexels.com/photos/7613/pexels-photo.jpg" alt="">
</figure>
</a>
</div>