-
Notifications
You must be signed in to change notification settings - Fork 6
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
8 changed files
with
251 additions
and
62 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
fontawesome-free-6.4.0-web | ||
.vscode |
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,67 @@ | ||
@import url('https://fonts.googleapis.com/css2?family=Lexend:wght@100;200;300;400;500;600;700;800;900&display=swap'); | ||
|
||
|
||
:root {} | ||
|
||
body { | ||
font-family: "Lexend", sans-serif !important; | ||
} | ||
|
||
a { | ||
cursor: pointer !important; | ||
/* color: white; */ | ||
transition: all 0.3s ease-in; | ||
} | ||
|
||
nav a:hover { | ||
opacity: 0.8; | ||
scale: 1.05; | ||
} | ||
|
||
.nav-container { | ||
height: 90px; | ||
padding: 0 90px; | ||
justify-content: space-between !important; | ||
} | ||
|
||
.ms-9 { | ||
margin-left: 90px; | ||
} | ||
.mt-10 { | ||
margin-top: 170px; | ||
} | ||
.fw-200 { | ||
font-weight: 200; | ||
} | ||
.br-30 { | ||
border-radius: 30px; | ||
} | ||
.shd { | ||
box-shadow: 3px 3px 3px 0px #000; | ||
} | ||
|
||
header { | ||
height: 90vh; | ||
background-size: cover !important; | ||
/* background-position: center !important; */ | ||
/* background-position: center; */ | ||
background-repeat: no-repeat !important; | ||
transition: all 1s ease; | ||
} | ||
|
||
.content-container .content .logo-header { | ||
border-left: 6px solid red; | ||
border-right: 6px solid red; | ||
cursor: pointer; | ||
background-color: rgba(230, 24, 24, 0.3); | ||
} | ||
|
||
.container-mov { | ||
max-width: 1180px; | ||
} | ||
.container-mov .content .mov-info h1 { | ||
-webkit-background-clip: text; | ||
color: white; | ||
/* background-image: url(../fire-hell-fire.gif); */ | ||
font-size: 70px; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
@media screen and (max-width: 700px) { | ||
a { | ||
order: 3 !important; | ||
} | ||
} |
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,72 @@ | ||
const api_key = "5e750355564957a2353604d8a9344e94"; | ||
const api_url = | ||
"https://api.themoviedb.org/3/discover/movie?sort_by=popularity.desc&api_key=5e750355564957a2353604d8a9344e94&page=1"; | ||
const img_path = "https://image.tmdb.org/t/p/w1280"; | ||
const SEARCH_API = | ||
'https://api.themoviedb.org/3/search/movie?api_key=cdbfc8803073dbfaf418825d7b632341&query="'; | ||
|
||
// const search = document.getElementById('') | ||
const contentInfo = document.getElementById("content-info"); | ||
const moviesHeader = document.getElementById("moviesHeader"); | ||
|
||
getMovies(api_url); | ||
setInterval(() => { | ||
getMovies(api_url); | ||
}, 10000); | ||
async function getMovies(url) { | ||
const res = await fetch(url); | ||
const data = await res.json(); | ||
|
||
console.log(data.results); | ||
// setInterval(updateHeader(data.results), 1000) | ||
updateHeader(data.results); | ||
} | ||
|
||
let currentIndex = 0; | ||
let setTimeOut = 100000; | ||
function updateHeader(contents) { | ||
// setInterval(()=> { | ||
// currentIndex++ | ||
// },10000) | ||
currentIndex++ | ||
if(currentIndex >= contents.length) { | ||
currentIndex = 0 | ||
} | ||
contentInfo.innerHTML = ""; | ||
const content = contents[currentIndex]; | ||
const { title, vote_average, overview, poster_path } = content; | ||
|
||
moviesHeader.innerHTML = ` | ||
<div class="container-mov content-container m-auto position-relative" id="content-info"> | ||
<div class="content mt-5" style="width: 50%"> | ||
<div class="logo-header py-2 px-4" style="width: 200px"> | ||
<img class="img-fluid" src="img/logo.png" alt="" /> | ||
</div> | ||
<div class="mov-info"> | ||
<div class="movie-info-header-text mt-3"> | ||
<h1 class="fw-200">${title}</h1> | ||
</div> | ||
<div class="movie-info nav align-items-center gap-3"> | ||
<small id="rating" class="rating badge bg-light text-danger">${vote_average}</small> | ||
<h5 class="mov-type text-white" id="mov-type"></h5> | ||
</div> | ||
<div class="info mt-3"> | ||
<p class="mov-info text-white">${overview}</p> | ||
</div> | ||
</div> | ||
</div> | ||
</div> | ||
<img class="position-absolute br-30 shd" style="right: 60px; top: 90px" src="${ | ||
img_path + poster_path | ||
}" width="450" alt="" /> | ||
`; | ||
|
||
header.style.background = ` | ||
linear-gradient(to right, | ||
rgba(${0}, ${0}, ${0}, ${0.9}) 30%, | ||
rgba(${0}, ${0}, ${0}, ${0.2}), | ||
rgba(${0}, ${0}, ${0}, ${0.8})), | ||
url(${img_path + poster_path})`; | ||
// }); | ||
} |