JSFiddle - React, Tailwind, and code Playground
by Sergey khorev
HTML
<div class="ph-item">
<div class="ph-col-12">
<div class="ph-picture"></div>
<div class="ph-row">
<div class="ph-col-6 big">вввв</div>
<div class="ph-col-4 empty big">вввв</div>
<div class="ph-col-2 big"></div>
<div class="ph-col-4"></div>
<div class="ph-col-8 empty"></div>
<div class="ph-col-6"></div>
<div class="ph-col-6 empty"></div>
<div class="ph-col-12"></div>
</div>
</div>
</div>
2 мин 25 сек
CSS
/**
* placeholder-loading v0.2.2
* Author: Zalog (https://www.zalog.ro/)
* License: MIT
**/
.ph-item {
position: relative;
display: flex;
flex-wrap: wrap;
padding: 30px 15px 15px;
overflow: hidden;
margin-bottom: 30px;
background-color: #fff;
border: 1px solid #e6e6e6;
border-radius: 2px
}
.ph-item,
.ph-item *,
.ph-item :after,
.ph-item :before {
box-sizing: border-box
}
.ph-item:before {
content: " ";
position: absolute;
top: 0;
right: 0;
bottom: 0;
left: 50%;
z-index: 1;
width: 500%;
margin-left: -250%;
-webkit-animation: phAnimation .8s linear infinite;
animation: phAnimation .8s linear infinite;
background: linear-gradient(90deg, hsla(0, 0%, 100%, 0) 46%, hsla(0, 0%, 100%, .35) 50%, hsla(0, 0%, 100%, 0) 54%) 50% 50%
}
.ph-item>* {
flex: 1 1 auto;
display: flex;
flex-flow: column;
padding-right: 15px;
padding-left: 15px
}
.ph-row {
display: flex;
flex-wrap: wrap;
margin-bottom: 7.5px
}
.ph-row div {
height: 10px;
margin-bottom: 7.5px;
background-color: #ced4da
}
.ph-row .big,
.ph-row.big div {
height: 20px;
margin-bottom: 15px
}
.ph-row .empty {
background-color: hsla(0, 0%, 100%, 0)
}
.ph-col-2 {
flex: 0 0 16.66667%
}
.ph-col-4 {
flex: 0 0 33.33333%
}
.ph-col-6 {
flex: 0 0 50%
}
.ph-col-8 {
flex: 0 0 66.66667%
}
.ph-col-10 {
flex: 0 0 83.33333%
}
.ph-col-12 {
flex: 0 0 100%
}
.ph-avatar {
position: relative;
width: 100%;
min-width: 60px;
background-color: #ced4da;
margin-bottom: 15px;
border-radius: 50%;
overflow: hidden
}
.ph-avatar:before {
content: " ";
display: block;
padding-top: 100%
}
.ph-picture {
width: 100%;
height: 120px;
background-color: #ced4da;
margin-bottom: 15px
}
@-webkit-keyframes phAnimation {
0% {
transform: translate3d(-30%, 0, 0)
}
to {
transform: translate3d(30%, 0, 0)
}
}
@keyframes phAnimation {
0% {
transform: translate3d(-30%, 0, 0)
}
to {
transform: translate3d(30%, 0,...