Skip to content

Commit

Permalink
Merge pull request #483 from apu52/Hotstar_Clone
Browse files Browse the repository at this point in the history
Hotstar_Clone
  • Loading branch information
cleveranu authored Jul 10, 2023
2 parents cea8dde + 86c3122 commit 60028f8
Show file tree
Hide file tree
Showing 39 changed files with 848 additions and 0 deletions.
7 changes: 7 additions & 0 deletions index.html
Original file line number Diff line number Diff line change
Expand Up @@ -387,6 +387,13 @@ <h3 class="card__heading">Random Fact Generator</h3>
<h3 class="card__heading">Stopwatch</h3>
</div>
</a>
<a class="card" href="projects/Hotstar_Clone/index.html">
<div class="card__background" style="background-image: url(projects/Hotstar_Clone/Hotstar.png)"></div>
<div class="card__content">
<p class="card__category">Website Frontend</p>
<h3 class="card__heading">Hotstar_Clone</h3>
</div>
</a>
</div>
</section>

Expand Down
Empty file.
Empty file.
Binary file added projects/Hotstar_Clone/Hotstar.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added projects/Hotstar_Clone/images/add.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added projects/Hotstar_Clone/images/disney.PNG
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added projects/Hotstar_Clone/images/geographic.PNG
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added projects/Hotstar_Clone/images/logo.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added projects/Hotstar_Clone/images/marvel.PNG
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added projects/Hotstar_Clone/images/nxt.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added projects/Hotstar_Clone/images/pixar.PNG
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added projects/Hotstar_Clone/images/play.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added projects/Hotstar_Clone/images/poster 1.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added projects/Hotstar_Clone/images/poster 10.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added projects/Hotstar_Clone/images/poster 11.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added projects/Hotstar_Clone/images/poster 12.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added projects/Hotstar_Clone/images/poster 2.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added projects/Hotstar_Clone/images/poster 3.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added projects/Hotstar_Clone/images/poster 4.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added projects/Hotstar_Clone/images/poster 5.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added projects/Hotstar_Clone/images/poster 6.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added projects/Hotstar_Clone/images/poster 7.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added projects/Hotstar_Clone/images/poster 8.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added projects/Hotstar_Clone/images/poster 9.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added projects/Hotstar_Clone/images/pre.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added projects/Hotstar_Clone/images/slider 1.PNG
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added projects/Hotstar_Clone/images/slider 2.PNG
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added projects/Hotstar_Clone/images/slider 3.PNG
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added projects/Hotstar_Clone/images/slider 4.PNG
Binary file added projects/Hotstar_Clone/images/slider 5.PNG
Binary file added projects/Hotstar_Clone/images/star-wars.PNG
392 changes: 392 additions & 0 deletions projects/Hotstar_Clone/index.html

Large diffs are not rendered by default.

116 changes: 116 additions & 0 deletions projects/Hotstar_Clone/index.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,116 @@
let movies = [
{
name: "falcon and the winter soldier",
des:
"Lorem ipsum dolor sit amet consectetur adipisicing elit. Velit porro et veniam excepturi, eaque voluptatem impedit nulla laboriosam facilis ut laboriosam libero!",
image: "images/slider 2.PNG"
},
{
name: "loki",
des:
"Lorem ipsum dolor sit amet consectetur adipisicing elit. Velit porro et veniam excepturi, eaque voluptatem impedit nulla laboriosam facilis ut laboriosam libero!",
image: "images/slider 1.PNG"
},
{
name: "wanda vision",
des:
"Lorem ipsum dolor sit amet consectetur adipisicing elit. Velit porro et veniam excepturi, eaque voluptatem impedit nulla laboriosam facilis ut laboriosam libero!",
image: "images/slider 3.PNG"
},
{
name: "raya and the last dragon",
des:
"Lorem ipsum dolor sit amet consectetur adipisicing elit. Velit porro et veniam excepturi, eaque voluptatem impedit nulla laboriosam facilis ut laboriosam libero!",
image: "images/slider 4.PNG"
},
{
name: "luca",
des:
"Lorem ipsum dolor sit amet consectetur adipisicing elit. Velit porro et veniam excepturi, eaque voluptatem impedit nulla laboriosam facilis ut laboriosam libero!",
image: "images/slider 5.PNG"
}
];

const carousel = document.querySelector(".carousel");
let sliders = [];

let slideIndex = 0; // track the current slide

const createSlide = () => {
if (slideIndex >= movies.length) {
slideIndex = 0;
}

// Create DOM Elements
let slide = document.createElement("div");
var imgElement = document.createElement("img");
let content = document.createElement("div");
let h1 = document.createElement("h1");
let p = document.createElement("p");

// attaching all elements
imgElement.appendChild(document.createTextNode(""));
h1.appendChild(document.createTextNode(movies[slideIndex].name));
p.appendChild(document.createTextNode(movies[slideIndex].des));
content.appendChild(h1);
content.appendChild(p);
slide.appendChild(content);
slide.appendChild(imgElement);
carousel.appendChild(slide);

// setting up image
imgElement.src = movies[slideIndex].image;
slideIndex++;

// setting elements classname
slide.className = "slider";
content.className = "slide-content";
h1.className = "movie-title";
p.className = "movie-des";

sliders.push(slide);

if (sliders.length) {
sliders[0].style.marginLeft = `calc(-${100 * (sliders.length - 2)}% - ${
30 * (sliders.length - 2)
}px)`;
}
};

for (let i = 0; i < 3; i++) {
createSlide();
}
setInterval(() => {
createSlide();
}, 3000);

//video cards

const videocards = [...document.querySelectorAll(".video-card")];
videocards.forEach((item) => {
item.addEventListener("mouseover", () => {
let video = item.children[1];
video.play();
});
item.addEventListener("mouseleave", () => {
let video = item.children[1];
video.pause();
});
});

//card sliders

let cardcontainers = [...document.querySelectorAll(".card-container")];
let preBtns = [...document.querySelectorAll(".pre-btn")];
let nxtBtns = [...document.querySelectorAll(".nxt-btn")];

cardcontainers.forEach((item, i) => {
let containerDimensions = item.getBoundingClientRect();
let containerWidth = containerDimensions.width;
nxtBtns[i].addEventListener("click", () => {
item.scrollLeft += containerWidth - 200;
});
preBtns[i].addEventListener("click", () => {
item.scrollLeft -= containerWidth + 200;
});
});
Loading

0 comments on commit 60028f8

Please sign in to comment.