feat: added dinamic videos at why-program

gh-pages
Aliaksei Karzhou 1 year ago
parent 2f3396d8b3
commit 708b115a09
  1. 5
      assets/css/index.css
  2. BIN
      assets/img/videocontent-bg.jpg
  3. 21
      assets/js/reviews.js
  4. 3
      assets/scss/_l-why-program.scss
  5. 10
      index.html

@ -1770,6 +1770,7 @@ h3 {
position: relative; position: relative;
height: 573px; height: 573px;
margin: 0 -48px 30px; margin: 0 -48px 30px;
background: url(../img/videocontent-bg.jpg) center no-repeat;
background-color: #878787; background-color: #878787;
} }
@media (max-width: 992px) { @media (max-width: 992px) {
@ -1794,8 +1795,8 @@ h3 {
bottom: 0; bottom: 0;
z-index: 10; z-index: 10;
background-color: rgba(0, 0, 0, 0.1); background-color: rgba(0, 0, 0, 0.1);
-webkit-backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(4px);
backdrop-filter: blur(10px); backdrop-filter: blur(4px);
cursor: pointer; cursor: pointer;
} }
.why-program__video-content::after { .why-program__video-content::after {

Binary file not shown.

After

Width:  |  Height:  |  Size: 399 KiB

@ -3,7 +3,10 @@ const whyProgramVideoContent = document.querySelector('.why-program__video-conte
reviewsSlideVideos.forEach((videoEl) => { reviewsSlideVideos.forEach((videoEl) => {
videoEl.addEventListener('click', (event) => { videoEl.addEventListener('click', (event) => {
if (whyProgramVideoContent) whyProgramVideoContent.classList.remove('active'); if (whyProgramVideoContent) {
whyProgramVideoContent.classList.remove('active');
whyProgramVideoContent.innerHTML = '';
}
reviewsSlideVideos.forEach((video) => { reviewsSlideVideos.forEach((video) => {
if (video === event.currentTarget) { if (video === event.currentTarget) {
video.classList.add('active'); video.classList.add('active');
@ -30,6 +33,20 @@ reviewsSlideVideos.forEach((videoEl) => {
if (whyProgramVideoContent) { if (whyProgramVideoContent) {
whyProgramVideoContent.addEventListener('click', (event) => { whyProgramVideoContent.addEventListener('click', (event) => {
event.currentTarget.classList.add('active'); event.currentTarget.classList.add('active');
reviewsSlideVideos.forEach((video) => video.classList.remove('active')); event.currentTarget.innerHTML = `
<iframe
width="560"
height="315"
src="https://www.youtube.com/embed/XIMLoLxmTDw?si=wFzm5etjCkaNdMl5"
title="YouTube video player"
frameborder="0"
allow="accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture; web-share"
referrerpolicy="strict-origin-when-cross-origin"
allowfullscreen
></iframe>
`;
reviewsSlideVideos.forEach((video) => {
video.classList.remove('active');
});
}); });
} }

@ -48,6 +48,7 @@
position: relative; position: relative;
height: 573px; height: 573px;
margin: 0 -48px 30px; margin: 0 -48px 30px;
background: url(../img/videocontent-bg.jpg) center no-repeat;
background-color: $grey; background-color: $grey;
@include laptop { @include laptop {
@ -72,7 +73,7 @@
bottom: 0; bottom: 0;
z-index: 10; z-index: 10;
background-color: rgba($color: #000000, $alpha: 0.1); background-color: rgba($color: #000000, $alpha: 0.1);
backdrop-filter: blur(10px); backdrop-filter: blur(4px);
cursor: pointer; cursor: pointer;
} }

@ -850,16 +850,6 @@
<div class="why-program__video"> <div class="why-program__video">
<div class="why-program__video-content"> <div class="why-program__video-content">
<iframe
width="560"
height="315"
src="https://www.youtube.com/embed/XIMLoLxmTDw?si=wFzm5etjCkaNdMl5"
title="YouTube video player"
frameborder="0"
allow="accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture; web-share"
referrerpolicy="strict-origin-when-cross-origin"
allowfullscreen
></iframe>
</div> </div>
<div class="why-program__video-text"> <div class="why-program__video-text">
<b> <b>

Loading…
Cancel
Save