Coder Wrap provides free to use snippets Coder Wrap provides free to use snippets

Back to Web elements
Preview Source Code
Download
HTML
CSS
/**Typeo CSS Start**/
@import url('https://fonts.googleapis.com/css2?family=Rubik:ital,wght@0,400;0,500;0,700;0,800;1,300;1,400;1,500;1,600;1,700&display=swap');

* {
 box-sizing: border-box;
}

body {
 margin: 0px;
 background-color: #fff;
}

/**Typeo CSS End**/
.videolist-scn, .videolist-scn * {
 --page-width: 1280px;
 --base-fm: 'Rubik', sans-serif;
 --title-size: 40px;
 --base-size: 16px;
 --white-clr: #ffffff;
 --theme-clr: #c25b41;
 --bg-clr: #fffbfa;
}

.videolist-scn {
 width: 100%;
 background-color: var(--bg-clr);
 font-family: var(--base-fm);
 display: flex;
 flex-flow: row wrap;
 justify-content: center;
 align-items: center;
 padding: 50px 0
}

.videolist-scn h2 {
 text-align: center;
 display: block;
 font-size: var(--title-size);
}

.videolist {
 display: flex;
 flex-flow: row wrap;
 width: calc(100% + 30px);
 margin-left: -15px;
}

.videolist .videoitem {
 width: 25%;
 padding: 15px;
 text-align: center;
}

.videoitem img {
 max-width: 100%;
 display: block;
 width: 100%;
}

.videoprt {
 position: relative;
 width: 100%;
 cursor: pointer;
}

.videoprt .videoicon {
 pointer-events: none;
 width: 60px;
 height: 60px;
 position: absolute;
 left: 50%;
 top: 50%;
 transform: translate(-50%, -50%);
 background-color: rgba(255, 255, 255, 0.85);
 border-radius: 100%;
}

.videoicon:before {
 content: '';
 width: 0;
 height: 0;
 border-style: solid;
 border-width: 12px 0 12px 20px;
 border-color: transparent transparent transparent #000000;
 position: absolute;
 left: 52%;
 top: 51%;
 transform: translate(-50%, -50%);
}

.videoicon:after {
 content: '';
 position: absolute;
 left: 50%;
 top: 50%;
 width: 64px;
 height: 64px;
 transform: translate(-50%, -50%);
 transform: translate(-50%, -50%) scale(1);
 -webkit-transform: translate(-50%, -50%) scale(1);
 animation: pulse-blue 2s infinite;
 box-shadow: 0 0 0 0 rgb(52 172 224);
 border-radius: 50%;
}

@keyframes pulse-blue {
 0% {
  transform: translate(-50%, -50%) scale(0.95);
  box-shadow: 0 0 0 0 rgb(255 255 255 / 0.7);
 }

 70% {
  transform: translate(-50%, -50%) scale(1);
  box-shadow: 0 0 0 10px rgba(255, 255, 255, 0);
 }

 100% {
  transform: translate(-50%, -50%) scale(0.95);
  box-shadow: 0 0 0 0 rgba(52, 172, 224, 0);
 }

}

.video-cont {
 padding: 15px;
}

.video-cont .clientname {
 display: block;
 font-size: 20px;
 font-weight: 500;
 margin-bottom: 6px;
}

.video-cont .clientcountry {
 color: var(--theme-clr);
}

/**Video Start**/
.video-overlay {
 position: absolute;
 left: 0px;
 top: 0px;
 width: 100%;
 height: 100%;
 background-color: rgba(0, 0, 0, 0.6);
 z-index: 1;
}

.video-model-group {
 width: 100%;
 height: 100%;
 pointer-events: none;
 opacity: 0;
}

.videomodel-show {
 opacity: 1;
 pointer-events: auto;
}

.video-model-group .video-overlay {
 z-index: 9999;
}

.video-model {
 position: fixed;
 left: 50%;
 top: 50%;
 margin: auto;
 z-index: 99999;
 width: calc(900px - 30px);
 background-color: #ffff;
 transform: translate(-50%, -50%);
 height: 500px;
}

.video-model video {
 width: calc(100% - 30px);
 display: block;
 position: absolute;
 left: 15px;
 top: 15px;
 height: calc(100% - 30px);
 object-fit: cover;
}

.videoclose {
 position: absolute;
 right: -20px;
 top: -20px;
 font-size: 22px;
 background-color: #fff;
 width: 36px;
 height: 36px;
 border-radius: 100%;
 text-align: center;
 line-height: 36px;
 cursor: pointer;
}
JS
//Video Open
 let video_btns = document.querySelectorAll('.videoitem .videoprt');
 let video_model = document.querySelector('.video-model-group');
 let video_source = document.querySelector('.video-model video');
 video_btns.forEach(function(videobtn) {
 videobtn.addEventListener('click', function(event) {
 let datavideo = videobtn.getAttribute('data-video');
 console.log('Video', datavideo);
 video_model.classList.add('videomodel-show');
 video_source.setAttribute('src', datavideo);
 });
 });
 //Video Close
 document.querySelector('.videoclose').addEventListener('click', function(){
 video_model.classList.remove('videomodel-show');
 video_source.setAttribute('src','');
 });

Related Web Elements