.video-container .btn { color: #B070AE; border-radius: 50%; padding: 10px; height: 8em; cursor: pointer; } .video-container { position: relative; } .video-container video { position: absolute; top: 0; left: 0; right: 0; bottom: 0; min-width: 100%; min-height: 100%; } .video-container .header { margin: 0 auto; padding: 8px 16px; position: absolute; right: 0; left: 0; top: calc(50% - 6em); text-align: center; } .video-container .text-focus-in { -webkit-animation: text-focus-in 0.5s cubic-bezier(0.550, 0.085, 0.680, 0.530) both; animation: text-focus-in 0.5s cubic-bezier(0.550, 0.085, 0.680, 0.530) both; } /** * ---------------------------------------- * animation text-focus-in * ---------------------------------------- */ @-webkit-keyframes text-focus-in { 0% { -webkit-filter: blur(12px); filter: blur(12px); opacity: 0; } 100% { -webkit-filter: blur(0px); filter: blur(0px); opacity: 1; } } @keyframes text-focus-in { 0% { -webkit-filter: blur(12px); filter: blur(12px); opacity: 0; } 100% { -webkit-filter: blur(0px); filter: blur(0px); opacity: 1; } } const video = document.querySelector('#player'); const play = document.querySelector('#play-circle'); const header = document.querySelector('.video-container .header'); header.style.display = 'none'; video.addEventListener('loadeddata', function(e){ header.style.display = 'block'; }); video.addEventListener('play', function(e){ header.style.display = 'none'; }); video.addEventListener('pause', function(e){ header.style.display = 'block'; }); play.addEventListener('click', function(e){ video.play(); header.style.display = 'none'; })