commit
This commit is contained in:
290
video.html
Normal file
290
video.html
Normal file
@@ -0,0 +1,290 @@
|
||||
<!DOCTYPE html>
|
||||
<html lang="en">
|
||||
<head>
|
||||
<meta charset="UTF-8">
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
||||
<title>Cost Calculator</title>
|
||||
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/swiper@10/swiper-bundle.min.css" />
|
||||
<style>
|
||||
* {
|
||||
margin: 0;
|
||||
padding: 0;
|
||||
box-sizing: border-box;
|
||||
}
|
||||
|
||||
/* .video-section{
|
||||
padding: 40px;
|
||||
} */
|
||||
/* testimonial video */
|
||||
.mySwiper-video {
|
||||
width: 80%;
|
||||
height: 100%;
|
||||
}
|
||||
|
||||
.mySwiper-video .swiper-slide {
|
||||
text-align: center;
|
||||
font-size: 18px;
|
||||
/* background: #fff; */
|
||||
display: flex;
|
||||
justify-content: center;
|
||||
align-items: center;
|
||||
/* margin-right: 10px !important; */
|
||||
}
|
||||
|
||||
.mySwiper-video .swiper-button-next::after,
|
||||
.mySwiper-video .swiper-button-prev::after {
|
||||
color: #1856A6 !important;
|
||||
font-size: 20px !important;
|
||||
font-weight: bold;
|
||||
padding: 10px 15px;
|
||||
background-color: rgba(255, 255, 255, 0.37);
|
||||
border-radius: 100%;
|
||||
|
||||
}
|
||||
.swiper-horizontal>.swiper-pagination-bullets,
|
||||
.swiper-pagination-bullets.swiper-pagination-horizontal {
|
||||
bottom: -9px !important;
|
||||
}
|
||||
|
||||
.video-container {
|
||||
position: relative;
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
overflow: hidden;
|
||||
border-radius: 10px;
|
||||
cursor: pointer;
|
||||
border-radius: 30px;
|
||||
}
|
||||
|
||||
.video-container .text {
|
||||
position: absolute;
|
||||
bottom: 40px;
|
||||
left: 0;
|
||||
background-color: white;
|
||||
padding: 20px 20px;
|
||||
border-radius: 30px;
|
||||
margin: 0 5px;
|
||||
width: 97%;
|
||||
}
|
||||
|
||||
.video-container .text p {
|
||||
color: #A259FF;
|
||||
}
|
||||
|
||||
.video-container .name {
|
||||
position: absolute;
|
||||
bottom: 0;
|
||||
left: 0;
|
||||
background-color: white;
|
||||
display: flex;
|
||||
justify-content: space-between;
|
||||
padding: 20px 20px;
|
||||
border-radius: 0 0 30px 30px;
|
||||
border-top: 1px solid #483286;
|
||||
margin: 0 5px;
|
||||
width: 97%;
|
||||
}
|
||||
|
||||
.video-container .name h4 {
|
||||
color: #A259FF;
|
||||
}
|
||||
|
||||
.video-container video {
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
object-fit: cover;
|
||||
border-radius: 30px;
|
||||
}
|
||||
|
||||
.play-button {
|
||||
position: absolute;
|
||||
top: 50%;
|
||||
left: 50%;
|
||||
transform: translate(-50%, -50%);
|
||||
font-size: 30px;
|
||||
color: #A259FF;
|
||||
background: rgb(255, 255, 255);
|
||||
border-radius: 50%;
|
||||
width: 70px;
|
||||
height: 70px;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
transition: opacity 0.3s ease-in-out;
|
||||
}
|
||||
|
||||
.video-container:hover .play-button,
|
||||
.video-container:hover .text {
|
||||
opacity: 0;
|
||||
/* Hide play button on hover */
|
||||
}
|
||||
|
||||
.video-container:hover .name {
|
||||
border: 0;
|
||||
border-radius: 30px;
|
||||
|
||||
}
|
||||
|
||||
|
||||
</style>
|
||||
</head>
|
||||
<body>
|
||||
<section class="video-section">
|
||||
<div class="container">
|
||||
|
||||
|
||||
<div class="swiper mySwiper-video">
|
||||
<div class="swiper-wrapper">
|
||||
<div class="swiper-slide">
|
||||
<div class="video-container">
|
||||
<video id="hoverVideo" src="assets/images/resource/prabinpoudel_video.mp4" playsinline loop
|
||||
preload="auto"></video>
|
||||
<div class="play-button" id="playBtn">▶</div>
|
||||
<div class="text">
|
||||
<p class="text-black text-14 ">Prabin Poudel</p>
|
||||
</div>
|
||||
<div class="name">
|
||||
<h4 class="text-14">Prabin Poudel</h4>
|
||||
<img class="w-100" src="" alt="">
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="swiper-slide">
|
||||
<div class="video-container">
|
||||
<video id="hoverVideo" src="assets/images/resource/prabinpoudel_video.mp4" playsinline loop
|
||||
preload="auto"></video>
|
||||
<div class="play-button" id="playBtn">▶</div>
|
||||
<div class="text">
|
||||
<p class="text-black text-14 ">Prabin Poudel</p>
|
||||
</div>
|
||||
<div class="name">
|
||||
<h4 class="text-14">Prabin Poudel</h4>
|
||||
<img class="w-100" src="" alt="">
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="swiper-slide">
|
||||
<div class="video-container">
|
||||
<video id="hoverVideo" src="assets/images/resource/prabinpoudel_video.mp4" playsinline loop
|
||||
preload="auto"></video>
|
||||
<div class="play-button" id="playBtn">▶</div>
|
||||
<div class="text">
|
||||
<p class="text-black text-14 ">Prabin Poudel</p>
|
||||
</div>
|
||||
<div class="name">
|
||||
<h4 class="text-14">Prabin Poudel</h4>
|
||||
<img class="w-100" src="" alt="">
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="swiper-slide">
|
||||
<div class="video-container">
|
||||
<video id="hoverVideo" src="assets/images/resource/prabinpoudel_video.mp4" playsinline loop
|
||||
preload="auto"></video>
|
||||
<div class="play-button" id="playBtn">▶</div>
|
||||
<div class="text">
|
||||
<p class="text-black text-14 ">Prabin Poudel</p>
|
||||
</div>
|
||||
<div class="name">
|
||||
<h4 class="text-14">Prabin Poudel</h4>
|
||||
<img class="w-100" src="" alt="">
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="swiper-slide">
|
||||
<div class="video-container">
|
||||
<video id="hoverVideo" src="assets/images/resource/prabinpoudel_video.mp4" playsinline loop
|
||||
preload="auto"></video>
|
||||
<div class="play-button" id="playBtn">▶</div>
|
||||
<div class="text">
|
||||
<p class="text-black text-14 ">Prabin Poudel</p>
|
||||
</div>
|
||||
<div class="name">
|
||||
<h4 class="text-14">Prabin Poudel</h4>
|
||||
<img class="w-100" src="" alt="">
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="swiper-slide">
|
||||
<div class="video-container">
|
||||
<video id="hoverVideo" src="assets/images/resource/prabinpoudel_video.mp4" playsinline loop
|
||||
preload="auto"></video>
|
||||
<div class="play-button" id="playBtn">▶</div>
|
||||
<div class="text">
|
||||
<p class="text-black text-14 ">Prabin Poudel</p>
|
||||
</div>
|
||||
<div class="name">
|
||||
<h4 class="text-14">Prabin Poudel</h4>
|
||||
<img class="w-100" src="" alt="">
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
</div>
|
||||
|
||||
<div class="swiper-button-next"></div>
|
||||
<div class="swiper-button-prev"></div>
|
||||
</div>
|
||||
</div>
|
||||
</section>
|
||||
<script src="https://cdn.jsdelivr.net/npm/swiper@10/swiper-bundle.min.js"></script>
|
||||
<script>
|
||||
var swiper = new Swiper(".mySwiper-video", {
|
||||
slidesPerView: 3,
|
||||
spaceBetween: 20,
|
||||
loop: true,
|
||||
navigation: {
|
||||
nextEl: ".swiper-button-next",
|
||||
prevEl: ".swiper-button-prev",
|
||||
},
|
||||
pagination: {
|
||||
el: ".swiper-pagination",
|
||||
clickable: true,
|
||||
},
|
||||
breakpoints: {
|
||||
0: {
|
||||
slidesPerView: 1
|
||||
},
|
||||
576: {
|
||||
slidesPerView: 2
|
||||
},
|
||||
992: {
|
||||
slidesPerView: 3
|
||||
},
|
||||
},
|
||||
});
|
||||
document.querySelectorAll(".video-container").forEach(container => {
|
||||
let video = container.querySelector("video");
|
||||
let playBtn = container.querySelector(".play-button");
|
||||
|
||||
function playVideo() {
|
||||
video.play().catch(error => console.log("Autoplay prevented:", error));
|
||||
playBtn.style.opacity = "0"; // Hide play button
|
||||
}
|
||||
|
||||
function pauseVideo() {
|
||||
setTimeout(() => {
|
||||
if (!video.matches(":hover")) {
|
||||
video.pause();
|
||||
playBtn.style.opacity = "1"; // Show play button again
|
||||
}
|
||||
}, 30);
|
||||
}
|
||||
|
||||
container.addEventListener("mouseover", playVideo);
|
||||
container.addEventListener("mouseout", pauseVideo);
|
||||
});
|
||||
|
||||
setTimeout(() => {
|
||||
document.querySelector(".line").classList.add("animate");
|
||||
}, 1000); // 1000ms = 1 second delay
|
||||
setTimeout(() => {
|
||||
document.querySelector(".uni-img").classList.add("animate");
|
||||
}, 1500); // 1000ms = 1 second delay
|
||||
|
||||
|
||||
</script>
|
||||
</body>
|
||||
</html>
|
||||
Reference in New Issue
Block a user