JSFiddle - React, Tailwind, and code Playground
HTML
<div class="dashboard">
<div class="col">
<ul>
<li class="tile small">
<div>
<p>
Small Tile Content</p>
</div>
<div>
<p>
Tile Hover Content</p>
</div>
<page>Page Content</page></li>
<li class="tile small">
<div>
<p>
Small Tile Content</p>
</div>
<div>
<p>
Tile Hover Content</p>
</div>
<page>Page Content</page></li>
<li class="tile large">
<div>
<p>
Large Tile Content</p>
</div>
<div>
<p>
Tile Hover Content</p>
</div>
<page>Page Content</page></li>
<li class="tile medium">
<div>
<p>
Medium Tile Content</p>
</div>
<div>
<p>
Tile Hover Content</p>
</div>
<page> Page Content</page></li>
</ul>
</div>
<div class="col">
<ul>
<li class="tile medium">
<div>
<p>
Medium Tile Content</p>
</div>
<div>
<p>
Tile Hover Content</p>
</div>
<page> Page Content</page></li>
<li class="tile large">
<div>
<p>
Large Tile Content</p>
</div>
<div>
<p>
Tile Hover Content</p>
</div>
<page>Page Content</page></li>
<li class="tile small">
<div>
<p>
Small Tile Content</p>
</div>
<div>
<p>
Tile Hover Content</p>
</div>
<page>Page Content</page></li>
<li class="tile small">
<div>
<p>
Small Tile Content</p>
</div>
<div>
<p>
Tile Hover Content</p>
</div>
<page>Page Content</page></li>
</ul>
</div>
<div class="col">
<ul>
<li class="tile medium">
<div>
<p>
Medium Tile Content</p>
</div>
<div>
<p>
Tile Hover Content</p>
</div>
<page> Page Content</page></li>
<li class="tile large">
<div>
<p>
Large Tile Content</p>
</div>
<div>
<p>
Tile Hover Content</p>
</div>
<page>Page Content</page></li>
<li class="tile...
CSS
page {
visibility: hidden;
}
li.tile {
list-style-type: none;
}
.dashboard {
margin: 0 auto;
width: 100%;
padding: 1em;
transform: translateX(200px);
animation: start 1s ease-out forwards;
}
.col:first-child {
margin-left: 2em;
}
.col {
float: left;
margin-right: .5%;
width: 31%;
}
.close-button {
font-size: 1.5em;
width: 1em;
height: 1em;
position: absolute;
top: .75em;
right: .75em;
cursor: pointer;
line-height: .8em;
text-align: center
}
.tile {
float: left;
margin: 0 auto 1%;
color: white;
font-size: 1.3em;
text-align: center;
height: 8em;
font-weight: 300;
overflow: hidden;
cursor: pointer;
position: relative;
background-color: #fff;
color: #333;
position: relative;
-webkit-transition: background-color 0.2s ease-out;
-o-transition: background-color 0.2s ease-out;
transition: background-color 0.2s ease-out
}
.tile.small {
width: 49%;
margin-right: 2%;
}
.tile.medium {
width: 100%;
}
.tile.large {
height: 16.15em;
width: 100%;
}
ul .small:last-child {
margin-right: 0;
}
.tile div {
position: absolute;
top: 0;
left: 0;
right: 0;
bottom: 0;
width: 100%;
height: 100%;
text-align: center;
display: table;
padding: 0 1em;
-webkit-transition: all .3s ease
-o-transition: all .3s ease
transition: all .3s ease
}
.tile div:nth-child(2) {
visibility: hidden;
}
.tile div p {
display: table-cell;
vertical-align: middle;
}
.tile img {
width: 100%;
}
//ANIMATIONS
@keyframes start {
0%{
-webkit-transform: translateX(200px);
-ms-transform: translateX(200px);
-o-transform: translateX(200px);
transform: translateX(200px);
opacity: 0;
}
50%{
opacity: 1;
}
100%{
-webkit-transform: translateX(0);
-ms-transform: translateX(0);
-o-transform: translateX(0);
transform: translateX(0);
opacity: 1;
}
}
@keyframes fadeOutBack {
0% {
-webkit-transform: translateX(-2em)...