Skip to content

Commit

Permalink
website init.
Browse files Browse the repository at this point in the history
  • Loading branch information
pirateIV committed Jul 20, 2023
1 parent 7037efd commit 2b5b83d
Show file tree
Hide file tree
Showing 8 changed files with 251 additions and 62 deletions.
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
fontawesome-free-6.4.0-web
.vscode
7 changes: 7 additions & 0 deletions bootstrap.min.css

Large diffs are not rendered by default.

67 changes: 67 additions & 0 deletions css/main.css
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;
}
5 changes: 5 additions & 0 deletions css/media.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
@media screen and (max-width: 700px) {
a {
order: 3 !important;
}
}
Binary file added img/logo.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
160 changes: 98 additions & 62 deletions index.html
Original file line number Diff line number Diff line change
Expand Up @@ -5,71 +5,107 @@
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<title>Document</title>

<link rel="stylesheet" href="./index.css">
<link rel="stylesheet" href="css/main.css" />
<link rel="stylesheet" href="css/media.css">
<link
rel="stylesheet"
href="fontawesome-free-6.4.0-web/fontawesome-free-6.4.0-web/css/all.min.css"
/>
<link rel="stylesheet" href="bootstrap.min.css" />
</head>
<body>
<header>
<form action="" id="form">
<input
type="search"
id="search"
class="search"
placeholder="Search..."
/>
</form>
</header>
<main>
<header id="header">
<section class="w-100">
<nav
class="navbar navbar-expand-lg nav nav-container align-items-center w-100"
>
<a href="" class="order-md-0 order-1">
<img class="navbar-brand ms-9" width="160" src="img/logo.png"
/></a>

<main id="main">
<div class="movie">
<img
src="https://images.unsplash.com/photo-1687204209659-3bded6aecd79?ixlib=rb-4.0.3&ixid=M3wxMjA3fDB8MHxlZGl0b3JpYWwtZmVlZHwxOHx8fGVufDB8fHx8fA%3D%3D&auto=format&fit=crop&w=500&q=60"
alt=""
/>
<div class="movie-info">
<h3>Movie Title</h3>
<span class="green">9.8</span>
</div>
<div class="overview">
<h3>Overview</h3>
Lorem ipsum, dolor sit amet consectetur adipisicing elit. Ex
cupiditate odio ullam suscipit amet corrupti quisquam soluta, officiis
eum temporibus.
</div>
</div>
<div class="movie">
<img
src="https://images.unsplash.com/photo-1687204209659-3bded6aecd79?ixlib=rb-4.0.3&ixid=M3wxMjA3fDB8MHxlZGl0b3JpYWwtZmVlZHwxOHx8fGVufDB8fHx8fA%3D%3D&auto=format&fit=crop&w=500&q=60"
alt=""
/>
<div class="movie-info">
<h3>Movie Title</h3>
<span class="green">9.8</span>
</div>
<div class="overview">
<h3>Overview</h3>
Lorem ipsum, dolor sit amet consectetur adipisicing elit. Ex
cupiditate odio ullam suscipit amet corrupti quisquam soluta, officiis
eum temporibus.
</div>
</div>
<div class="movie">
<img
src="https://images.unsplash.com/photo-1687204209659-3bded6aecd79?ixlib=rb-4.0.3&ixid=M3wxMjA3fDB8MHxlZGl0b3JpYWwtZmVlZHwxOHx8fGVufDB8fHx8fA%3D%3D&auto=format&fit=crop&w=500&q=60"
alt=""
/>
<div class="movie-info">
<h3>Movie Title</h3>
<span class="green">9.8</span>
</div>
<div class="overview">
<h3>Overview</h3>
Lorem ipsum, dolor sit amet consectetur adipisicing elit. Ex
cupiditate odio ullam suscipit amet corrupti quisquam soluta, officiis
eum temporibus.
</div>
</div>
<i class="fas fa-bars d-md-none d-flex order-md-0 order-"></i>
<ul class="nav-links nav d-md-flex d-none align-items-center gap-4 order-md-0">
<li>
<a
class="text-uppercase text-decoration-none text-white"
href="home.html"
>Home
<i class="fas fa-angle-down"></i>
</a>
</li>
<li>
<a
class="text-uppercase text-decoration-none text-white"
href="genres.html"
>Genres
<i class="fas fa-angle-down"></i>
</a>
</li>
<li>
<a
class="text-uppercase text-decoration-none text-white"
href="pages.html"
>Pages
<i class="fas fa-angle-down"></i>
</a>
</li>
<li>
<a
class="text-uppercase text-decoration-none text-white"
href="tv-shows.html"
>Tv Shows
<i class="fas fa-angle-down"></i>
</a>
</li>
<li>
<a
class="text-uppercase text-decoration-none text-white"
href="movies.html"
>Movies</a
>
</li>
<li>
<a
class="text-uppercase text-decoration-none text-white"
href="news.html"
>News
<i class="fas fa-angle-down"></i>
</a>
</li>
<li>
<a
class="text-uppercase text-decoration-none text-white"
href="contact.html"
>Contact</a
>
</li>
</ul>

<ul class="nav-icons nav gap-3 align-items-center order-md-3 order-3">
<li>
<a href=""><i class="fas fa-search text-white"></i></a>
</li>
<li>
<a href=""><i class="fas fa-bell text-white"></i></a>
</li>
<li>
<a href=""><img src="user.png" width="30" alt="user" /></a>
</li>
</ul>
</nav>

<section id="moviesHeader" class="info-mov d-flex align-items-center">
<div
class="container-mov content-container m-auto"
id="content-info"
></div>
<img src="" alt="" />
</section>
</section>
</header>
</main>
</body>

<script src="./script.js"></script>
<script src="js/main.js"></script>
</body>
</html>
72 changes: 72 additions & 0 deletions js/main.js
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})`;
// });
}
Binary file added user.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.

0 comments on commit 2b5b83d

Please sign in to comment.