.container{ position: relative; padding: 150px; background-color: #000; } .envelope{ width: 80px; height: 50px; border: 3px solid #fff; position: relative; overflow: hidden; &:before, &:after{ content:" "; position: absolute; left: 2px; width: 70px; height: 70px; border:3px solid #fff; transform:rotate(45deg); top:-42px; -webkit-border-radius: 5px; -moz-border-radius: 5px; border-radius: 10px; } animation: flip 2.5s infinite; } @keyframes flip { 0% { transform: perspective(100px) rotate3d(0, 1, 0, -360deg); animation-timing-function: linear; } 25% { transform: perspective(100px) rotate3d(0, 1, 0, -260deg); animation-timing-function: linear; } 50% { transform: perspective(100px) rotate3d(0, 1, 0, -170deg); animation-timing-function: linear; } 75% { transform: perspective(100px) rotate3d(0, 1, 0, -80deg); animation-timing-function: linear; } 100% { transform: perspective(100px) rotate3d(0, 1, 0, 0); animation-timing-function: linear; } }