I need to create a 3D floor with cartoons placed on top. The floor has a grid where each cartoon is positioned. I want to maintain the same axis for both the floor and grid, but I need the images and text in each grid element to be at a 90-degree angle to the grid and floor position in order to achieve a 3D effect.
I have provided an image to illustrate my desired outcome. The current output is shown in the RED section, but I want it to look like the yellow section that I created using Photoshop. Please refer to this image for the desired output: Image Link
Custom CSS Code:
body {
background-color: #2ee5a2;
min-height: 100vh;
display: flex;
justify-content: center;
align-items: center;
font-size: 40px;
perspective: 10em;
perspective-origin: 50% calc(50% - 2em);
overflow: hidden;
}
.chatcontainer {
display: grid;
grid-template-columns: repeat(7, 30px);
grid-template-rows: repeat(7, 30px);
gap: 60px;
margin: 10%;
background-color: #aa69e7;
border: 1px solid;
transform: rotateY(0deg) rotateX(63deg);
}
.chatcontainer div img {
width: 50px;
}
.grid-element {
max-width: 500px;
transform: rotateY(0deg) rotateX(327deg);
}
.usernamelink {
color: #fafafa;
text-decoration: none;
bottom: 17px;
position: absolute;
transform: perspective(739px) rotateY(0deg) rotateX(327deg);
}
<div class="chatcontainer" id="chatcontainer">
<div class="static grid-element">
<img class="animatedGiff" src="https://s.cdpn.io/3/pacman-ghost-hi_1.png">
<span>
<b>
<a class="usernamelink" href="" target="_blank">username</a>
</b>
</span>
</div>
<div class="static grid-element">
<img class="animatedGiff" src="https://s.cdpn.io/3/pacman-ghost-hi_1.png">
<span>
<b>
<a class="usernamelink" href="" target="_blank">username</a>
</b>
</span>
</div>
</div>