diff --git a/Procfile b/Procfile index e7d8fff..06a5728 100644 --- a/Procfile +++ b/Procfile @@ -1 +1 @@ -web: python manage.py migrate && gunicorn --timeout 120 hashflix.wsgi --log-file - \ No newline at end of file +web: python manage.py migrate && gunicorn hashflix.wsgi --log-file - \ No newline at end of file diff --git a/staticfiles/css/style_base.css b/staticfiles/css/style_base.css index 7f2dd0f..8efcb15 100644 --- a/staticfiles/css/style_base.css +++ b/staticfiles/css/style_base.css @@ -1,3 +1,172 @@ -.full { +* { + padding: 0; + margin: 0; + box-sizing: border-box; + text-decoration: none; +} + +a { + color: inherit; + text-decoration: none; +} + +.body { background-color: #000; + color: #f5f4f1; + font-family: "Poppins", sans-serif; +} +/* Style navbar */ +.navbar { + position: fixed; + padding: 1rem; + width: 100%; + display: flex; + justify-content: space-between; + background-color: transparent; + align-items: center; + z-index: 50; +} + +.group-nav { + display: flex; + align-items: center; +} + +.nav-btn { + padding: 0.1rem 0.4rem; + border: 1px solid rgb(255, 0, 0); + border-radius: 0.3rem; + margin: 0.3rem; + background-color: rgb(255, 0, 0); + transition: 1.02s; + color: #f5f4f1; +} + +.nav-btn:hover { + animation: pulse 1s infinite; +} +@keyframes pulse { + 0% { + transform: scale(1); + } + 50% { + transform: scale(1.2); + } + 100% { + transform: scale(1); + } +} + +.nav-search { + padding: 0.5rem; +} + +input[type="search"] { + height: 1.5rem; + border-radius: 0.4rem; + padding: 0rem 0.3rem; + color: rgb(15, 15, 15); +} + + +.nav-submit, +.invisible { + display: none; +} + +.navbar-bg { + background-color: rgb(0, 0, 0, 0.95); +} + +.hamburger{ + display: none; +} + +.hamburger { + display: none; + border: none; + background: none; + border-top: 3px solid #fff; /* Cria o primeiro traço do menu hamburger */ + cursor: pointer; +} +/* Criando os outros 2 traços do menu hamburger */ +.hamburger::after, +.hamburger::before { + content: " "; + display: block; + width: 30px; + height: 3px; + background: #fff; + margin-top: 5px; + position: relative; + transition: 0.3s; +} + +@media (max-width: 600px) { + + .hamburger { + display: block; + z-index: 1; /* Para ficar acima */ + } + + .group-nav { + position: fixed; + top: 0; + left: 0; + width: 100vw; /* Equivale a 100% da largura da tela*/ + height: 100vh; /* Equivale a 100% da altura da tela*/ + background: #3f0e0e; + clip-path: circle( + 100px at 90% -15% + ); /* circulo de 100px deixando 90% no eixo x e 15% negativo no eixo y*/ + transition: 1s ease-out; + + flex-direction: column; + justify-content: space-around; + align-items: center; + gap: 0; + pointer-events: none; /* Para o user nao clicar em algo que não está aparecendo na tela*/ + } + + .group-nav a { + font-size: 24px; + opacity: 0; + } + + + /* Estilos ativos */ + + .navbar.active .group-nav { + clip-path: circle(1500px at 90% -15%); + pointer-events: all; + } + + .navbar.active .group-nav a { + opacity: 1; + } + + .navbar.active .hamburger { + position: fixed; + top: 26px; + right: 16px; + border-top-color: transparent; + } + + .navbar.active .hamburger::before { + transform: rotate(135deg); + } + + .navbar.active .hamburger::after { + transform: rotate(-135deg); + top: -7px; + } + + .nav-btn{ + background-color: inherit; + border: none; + } + + .nav-btn a{ + font-size: 1rem; + } } diff --git a/staticfiles/css/style_carousel.css b/staticfiles/css/style_carousel.css new file mode 100644 index 0000000..dc8eae0 --- /dev/null +++ b/staticfiles/css/style_carousel.css @@ -0,0 +1,81 @@ +.container { + position: relative; + padding: 1rem; + max-width: 1880px; + margin: 0 auto; +} + +.gallery-wrapper { + overflow-x: auto; /* Faz a rolagem ficar no elemento div gallery-wrapper que é pai da gallery, ou seja se o gallery for maior a barra de rolagem é exibida*/ +} + +.gallery { + display: flex; + flex-flow: row nowrap; + gap: 0.5rem; +} + +.arrow-left3, +.arrow-left2, +.arrow-left, +.arrow-right { + position: absolute; + top: 0; + left: 0; + right: auto; + bottom: 0; + font-size: 1rem; + line-height: 250px; + width: 40px; + text-align: center; + color: #fff; + cursor: pointer; + border: none; + background: linear-gradient(to left, transparent 0%, rgb(201, 77, 77) 200%); + opacity: 0.3; + transition: all 200ms ease-in-out; +} + +.arrow-right { + left: auto; + right: 0; + background: linear-gradient( + to right, + transparent 0%, + rgb(201, 77, 77) 200% + ); +} + +.arrow-left3:hover, +.arrow-left2:hover, +.arrow-right:hover, +.arrow-left:hover { + opacity: 1; +} + +.item3, +.item2, +.item { + height: 15rem; + width: auto; + flex-shrink: 0; /* Para não diminuir para caber*/ + opacity: 0.6; + transition: all 200ms ease-in-out; +} + +.current-item3, +.current-item2, +.current-item { + opacity: 1; +} + +/* Hide scrollbar for Chrome, Safari and Opera */ +.gallery-wrapper::-webkit-scrollbar { + display: none; +} + +/* Hide scrollbar for IE, Edge and Firefox */ +.gallery-wrapper { + -ms-overflow-style: none; /* IE and Edge */ + scrollbar-width: none; /* Firefox */ +} diff --git a/staticfiles/css/style_criarconta.css b/staticfiles/css/style_criarconta.css new file mode 100644 index 0000000..1b00eab --- /dev/null +++ b/staticfiles/css/style_criarconta.css @@ -0,0 +1,116 @@ +@import url("https://fonts.googleapis.com/css2?family=Montserrat&family=Roboto:wght@500&display=swap"); + +.header { + min-height: 100vh; + position: relative; /* Adicione uma posição relativa para que possamos posicionar o pseudo-elemento */ + display: flex; + flex-direction: column; + justify-content: center; + align-items: center; +} + +.header::before { + content: ""; + position: absolute; + top: 0; + left: 0; + width: 100%; + height: 100%; + background-image: url("../images/background_netflix.jpg"); + background-repeat: no-repeat; + background-blend-mode: overlay; + background-size: cover; /* Ajuste para cobrir todo o cabeçalho */ + background-color: rgb(0, 0, 0, 0.7); + opacity: 0.7; /* Opacidade para a imagem de fundo */ + z-index: -1; /* Coloque o pseudo-elemento atrás do conteúdo */ +} + +.content-form { + width: 30rem; + height: auto; + background-color: rgb(0, 0, 0, 0.5); + display: flex; + flex-direction: column; +} + +.form-criarconta { + display: flex; + flex-direction: column; + justify-content: center; + flex-wrap: wrap; + padding: 2rem 4rem; + gap: 1rem; +} + +.title-form { + font-family: "Montserrat", sans-serif; + color: rgb(255, 255, 255); + font: 2rem bold; + margin: auto; + padding-top: 2rem; +} + +.form-criarconta input { + height: 3rem; + padding-left: 0.8rem; + border-radius: 0.3rem; + outline: none; + border: 1px rgb(204, 204, 204); + background-color: #313235; + color: hsl(0, 0%, 100%); +} + +.form-criarconta button { + height: 3rem; + border-radius: 0.3rem; + outline: none; + margin: auto; + width: 90%; + background-color: rgb(255, 0, 0); + border: transparent; + color: hsl(0, 0%, 100%); + text-align: center; + font-weight: bold; + transition: background-color -3s ease; +} + +.form-criarconta button:hover { + background-color: rgb(189, 8, 8); + cursor: pointer; +} + +.form-criarconta ul { + list-style-type: none; /* Retira o simbolo da lista */ +} + +.form-group { + display: flex; + flex-direction: column; + justify-content: center; +} + + +.is-invalid { + border: 1px solid rgb(255, 0, 0) !important; +} + +.invalid-feedback { + outline: none; + font-size: 0.8rem; + color: rgb(255, 0, 0); +} + +@media (max-width: 501px) { + .content-form { + width: 95%; + } + + .form-criarconta { + padding-inline:1rem; + } + + .form-criarconta small{ + text-align: center; + font-size: 0.8rem; + } +} diff --git a/staticfiles/css/style_detalhesfilmes.css b/staticfiles/css/style_detalhesfilmes.css new file mode 100644 index 0000000..7395539 --- /dev/null +++ b/staticfiles/css/style_detalhesfilmes.css @@ -0,0 +1,82 @@ +.content { + display: flex; + flex-direction: column; +} + +/* Inicio sec-filme */ +.sec-filme { + min-height: 100vh; + background-repeat: no-repeat; + background-size: cover; /* Redimensiona a imagem para caber */ + background-color: rgba(0, 0, 0); + display: flex; + flex-direction: column; + justify-content: flex-end; +} + +.title-film { + font-family: "Roboto", sans-serif; + font: 3rem bold; + padding: 2rem 1rem; + background-color: rgba(0, 0, 0, 0.4); +} + +.description-resume { + padding: 1rem 1rem; + max-width: 30rem; + max-height: 5rem; + overflow: hidden; /* ... */ + text-overflow: ellipsis; + white-space: nowrap; +} + +.btn-play { + padding: 0.8rem; + margin: 1rem; + width: 5rem; + text-align: center; + background-color: rgba(189, 16, 16, 0.527); + color: rgba(255, 255, 255); + border-radius: 0.5rem; + transition: 1.02; +} + +.btn-play:hover { + cursor: pointer; + transform: scale(1.06); +} + +/* Inicio sec-episodio */ +.sec-episodio { + min-height: 50vh; + display: flex; + flex-direction: column; + justify-content: space-evenly; +} + +.visualizacao { + padding: 1rem 0rem; +} + +.episod, +.description { + padding: 1rem 2rem; +} + +.link-epsod { + display: flex; +} + +.text-list:hover, +.link-epsod:hover { + color: rgb(243, 26, 26); +} + +.sec-related { + padding: 2rem; +} + +.subtitle { + font-size: 1.5em !important ; + padding: 1rem 0; +} diff --git a/staticfiles/css/style_editarperfil.css b/staticfiles/css/style_editarperfil.css new file mode 100644 index 0000000..82103ce --- /dev/null +++ b/staticfiles/css/style_editarperfil.css @@ -0,0 +1,116 @@ +@import url("https://fonts.googleapis.com/css2?family=Montserrat&family=Roboto:wght@500&display=swap"); + +.header { + min-height: 100vh; + position: relative; /* Adicione uma posição relativa para que possamos posicionar o pseudo-elemento */ + display: flex; + flex-direction: column; + justify-content: center; + align-items: center; +} + +.header::before { + content: ""; + position: absolute; + top: 0; + left: 0; + width: 100%; + height: 100%; + background-image: url("../images/background_netflix.jpg"); + background-repeat: no-repeat; + background-blend-mode: overlay; + background-size: cover; /* Ajuste para cobrir todo o cabeçalho */ + background-color: rgb(0, 0, 0, 0.7); + opacity: 0.7; /* Opacidade para a imagem de fundo */ + z-index: -1; /* Coloque o pseudo-elemento atrás do conteúdo */ +} + +.content-form { + width: 30rem; + height: auto; + background-color: rgb(0, 0, 0, 0.5); + display: flex; + flex-direction: column; +} + +.form-editarperfil { + display: flex; + flex-direction: column; + justify-content: center; + gap: 1rem; +} + +.title-form { + font-family: "Montserrat", sans-serif; + color: rgb(255, 255, 255); + font: 2rem bold; + margin: auto; + padding-block: 2rem; +} + +.form-group{ + padding-inline: 1rem; +} + +.form-editarperfil input { + height: 3rem; + padding-left: 0.8rem; + border-radius: 0.3rem; + outline: none; + width: 90%; + margin: auto; + border: 1px rgb(204, 204, 204); + background-color: #313235; + color: hsl(0, 0%, 100%); + flex-grow: 1; + flex-basis: auto; +} + +.form-editarperfil button { + height: 3rem; + border-radius: 0.3rem; + outline: none; + margin: auto; + width: 90%; + background-color: rgb(255, 0, 0); + border: transparent; + color: hsl(0, 0%, 100%); + text-align: center; + font-weight: bold; + transition: background-color -3s ease; +} + +.form-editarperfil button:hover { + background-color: rgb(189, 8, 8); + cursor: pointer; +} + +.form-editarperfil small { + text-align: center; +} + +.form-editarperfil ul { + list-style-type: none; /* Retira o simbolo da lista */ +} + +.form-group { + display: flex; + flex-direction: column; + justify-content: center; +} + +.is-invalid { + border: 1px solid rgb(255, 0, 0) !important; +} + +.invalid-feedback { + outline: none; + font-size: 0.8rem; + color: rgb(255, 0, 0); +} + +@media (max-width: 501px) { + .content-form { + width: 95%; + } +} diff --git a/staticfiles/css/style_footer.css b/staticfiles/css/style_footer.css new file mode 100644 index 0000000..548f4cb --- /dev/null +++ b/staticfiles/css/style_footer.css @@ -0,0 +1,8 @@ +.footer { + min-height: 8vh; + display: flex; + justify-content: space-between; + align-items: center; + padding: 0.8rem; + font-size: 0.8rem; +} diff --git a/staticfiles/css/style_homefilmes.css b/staticfiles/css/style_homefilmes.css new file mode 100644 index 0000000..c4ebeed --- /dev/null +++ b/staticfiles/css/style_homefilmes.css @@ -0,0 +1,64 @@ +.content { + display: flex; + flex-direction: column; +} + +/* Inicio sec-filme */ +.sec-filme { + min-height: 100vh; + background-repeat: no-repeat; + background-size: cover; /* Redimensiona a imagem para caber */ + background-color: rgba(0, 0, 0); + display: flex; + flex-direction: column; + justify-content: flex-end; +} + +.title-film { + font-family: "Roboto", sans-serif; + font: 3rem bold; + padding: 2rem 1rem; + background-color: rgba(0, 0, 0, 0.4); +} + +.description-resume { + padding: 1rem 1rem; + max-width: 30rem; + max-height: 5rem; + background-color: rgba(0, 0, 0, 0.4); + overflow: hidden; /* ... */ + text-overflow: ellipsis; + white-space: nowrap; +} + +.btn-play { + padding: 0.8rem; + margin: 1rem; + width: 5rem; + text-align: center; + background-color: rgba(189, 16, 16); + color: rgba(255, 255, 255); + border-radius: 0.5rem; + transition: 1.02; +} + +.btn-play:hover { + cursor: pointer; + transform: scale(1.06); +} + +/* Outras sections */ +.sec-assistidos, +.sec-novo, +.sec-emalta { + padding: 2rem; +} + +.subtitle { + font-size: 1.5em !important ; + padding: 1rem 0; +} + +.text-list:hover { + color: rgb(243, 26, 26); +} diff --git a/staticfiles/css/style_homepage.css b/staticfiles/css/style_homepage.css new file mode 100644 index 0000000..28e8de6 --- /dev/null +++ b/staticfiles/css/style_homepage.css @@ -0,0 +1,115 @@ +.content { + padding-top: 4.68rem; /*Ajuste isso de acordo com a altura da sua barra de navegação */ +} + +.header { + min-height: 100vh; + position: relative; /* Adicione uma posição relativa para que possamos posicionar o pseudo-elemento */ + display: flex; + flex-direction: column; + justify-content: center; + align-items: center; +} + +.header::before { + content: ""; + position: absolute; + top: 0; + left: 0; + width: 100%; + height: 100%; + background-image: url("../images/background_netflix.jpg"); + background-repeat: no-repeat; + background-blend-mode: overlay; + background-size: cover; /* Ajuste para cobrir todo o cabeçalho */ + background-color: rgb(0, 0, 0, 0.7); + opacity: 0.7; /* Opacidade para a imagem de fundo */ + z-index: -1; /* Coloque o pseudo-elemento atrás do conteúdo */ +} + +.title-header { + color: rgb(255, 255, 255); + font: 2rem bold; + padding: 0.8rem; +} + +.paragraph { + padding: 0.8rem; + font: 1.2rem bold; + max-width: 30rem; +} + +.form-access { + display: flex; + flex-direction: column; + gap: 0.3rem; + justify-content: center; + align-items: center; +} +.btn-access { + background-color: rgb(255, 0, 0); + padding: 0.55rem; + color: #fff; + border-color: rgb(255, 0, 0); +} + +.input-email { + height: 2.8rem; + padding: 0.3rem; + min-width: 15rem; +} + +.section { + min-height: 60vh; + padding:1rem 0; + display: flex; + justify-content: space-around; + flex-wrap: wrap; + align-items: center; + border-bottom: 0.4rem solid rgba(170, 177, 194, 0.5); +} + +.image-sec img{ + max-width: 100%; +} + + +.title-sec { + color: rgb(255, 255, 255); + font: 3rem bold; + padding: 0.8rem; +} + +.is-invalid { + border: 1px solid rgb(255, 0, 0) !important; +} + +.invalid-feedback { + outline: none; + font-size: 0.8rem; + color: rgb(255, 0, 0); +} + + +@media (max-width: 768px) { + .title-sec { + max-width: 30rem; + } +} + +@media (max-width: 682px) { + .section { + justify-content:center; + } + .paragraph, + .title-sec, + .title-header { + text-align: center; + } +} + +@media (max-width: 682px) { + .title-sec { + font-size: 2rem; + } +} diff --git a/staticfiles/css/style_login.css b/staticfiles/css/style_login.css new file mode 100644 index 0000000..7bfe8cd --- /dev/null +++ b/staticfiles/css/style_login.css @@ -0,0 +1,133 @@ +@import url("https://fonts.googleapis.com/css2?family=Montserrat&family=Roboto:wght@500&display=swap"); + +.header { + min-height: 100vh; + position: relative; /* Adicione uma posição relativa para que possamos posicionar o pseudo-elemento */ + display: flex; + flex-direction: column; + justify-content: center; + align-items: center; +} + +.header::before { + content: ""; + position: absolute; + top: 0; + left: 0; + width: 100%; + height: 100%; + background-image: url("../images/background_netflix.jpg"); + background-repeat: no-repeat; + background-blend-mode: overlay; + background-size: cover; /* Ajuste para cobrir todo o cabeçalho */ + background-color: rgb(0, 0, 0, 0.7); + opacity: 0.7; /* Opacidade para a imagem de fundo */ + z-index: -1; /* Coloque o pseudo-elemento atrás do conteúdo */ +} + +.content-form { + width: 30rem; + height: auto; + background-color: rgb(0, 0, 0, 0.5); + display: flex; + flex-direction: column; +} + +.form-login { + display: flex; + flex-direction: column; + justify-content: center; + padding: 4rem; + gap: 1rem; +} + +.title-form { + font-family: "Montserrat", sans-serif; + color: rgb(255, 255, 255); + font: 2rem bold; + padding-left: 4.9rem; + padding-top: 4.1rem; +} + +.form-login input { + height: 3rem; + padding-left: 0.8rem; + border-radius: 0.3rem; + outline: none; + width: 90%; + margin: auto; + border: 1px rgb(204, 204, 204); + background-color: #313235; + color: hsl(0, 0%, 100%); +} + +.form-login button { + height: 3rem; + border-radius: 0.3rem; + outline: none; + margin: auto; + width: 90%; + background-color: rgb(255, 0, 0); + border: transparent; + color: hsl(0, 0%, 100%); + text-align: center; + font-weight: bold; + transition: background-color -3s ease; +} + +.form-login button:hover { + background-color: rgb(189, 8, 8); + cursor: pointer; +} + +.form-group { + display: flex; + flex-direction: column; + justify-content: center; +} + +.inscrever { + color: rgb(255, 255, 255); + font: 1rem bold; + display: flex; + flex-direction: column; + text-align: center; +} + +.inscrever p { + text-decoration: underline; + color: rgb(197, 82, 66); + padding-bottom: 2rem; +} + +.is-invalid { + border: 1px solid rgb(255, 0, 0) !important; +} + +.invalid-feedback { + outline: none; + font-size: 0.8rem; + color: rgb(255, 0, 0); +} + +@media (max-width: 501px) { + .content-form { + width: 95%; + } + .form-login small{ + text-align: center; + font-size: 0.8rem; + } +} + +@media (max-width: 381px) { + .form-login { + padding: 2rem; + } + .form-login input{ + width: 100%; + } + .form-login button{ + width: 100%; + } +} diff --git a/staticfiles/css/style_logout.css b/staticfiles/css/style_logout.css new file mode 100644 index 0000000..8fe76b9 --- /dev/null +++ b/staticfiles/css/style_logout.css @@ -0,0 +1,50 @@ + +.header { + min-height: 100vh; + position: relative; /* Adicione uma posição relativa para que possamos posicionar o pseudo-elemento */ + display: flex; + flex-direction: column; + justify-content: center; + align-items: center; +} + +.header::before { + content: ""; + position: absolute; + top: 0; + left: 0; + width: 100%; + height: 100%; + background-image: url("../images/background_netflix.jpg"); + background-repeat: no-repeat; + background-blend-mode: overlay; + background-size: cover; /* Ajuste para cobrir todo o cabeçalho */ + background-color: rgb(0, 0, 0, 0.7); + opacity: 0.7; /* Opacidade para a imagem de fundo */ + z-index: -1; /* Coloque o pseudo-elemento atrás do conteúdo */ +} + +.title-header { + color: rgb(255, 255, 255); + font: 2rem bold; + padding: 0.8rem; +} + +.paragraph { + padding: 0.8rem; + font: 1.2rem bold; +} + +.group-btn { + display: flex; + flex-direction: row; + gap: 0.3rem; + justify-content: center; + align-items: center; + flex-wrap: wrap; +} + +.btn-access { + background-color: rgb(255, 0, 0); + padding: 0.55rem; +} diff --git a/staticfiles/css/style_pesquisa.css b/staticfiles/css/style_pesquisa.css new file mode 100644 index 0000000..46b411e --- /dev/null +++ b/staticfiles/css/style_pesquisa.css @@ -0,0 +1,22 @@ +.content{ + padding-top: 4.68rem; + min-height: 100vh; +} + +.search{ + display: flex; + flex-flow: row wrap; + gap: 1rem; +} + +.search-item{ + display: flex; + flex-direction: column; +} + +.item { + height: 15rem; + width: auto; + flex-shrink: 0; /* Para não diminuir para caber*/ + opacity: 0.6; +} diff --git a/staticfiles/images/background_netflix.jpg b/staticfiles/images/background_netflix.jpg new file mode 100644 index 0000000..73289bf Binary files /dev/null and b/staticfiles/images/background_netflix.jpg differ diff --git a/staticfiles/images/hashflix.png b/staticfiles/images/hashflix.png new file mode 100644 index 0000000..7609dae Binary files /dev/null and b/staticfiles/images/hashflix.png differ diff --git a/staticfiles/images/mobile-0819.jpg b/staticfiles/images/mobile-0819.jpg new file mode 100644 index 0000000..00c8f01 Binary files /dev/null and b/staticfiles/images/mobile-0819.jpg differ diff --git a/staticfiles/images/netflix_kid.png b/staticfiles/images/netflix_kid.png new file mode 100644 index 0000000..3e44481 Binary files /dev/null and b/staticfiles/images/netflix_kid.png differ diff --git a/staticfiles/images/python.png b/staticfiles/images/python.png new file mode 100644 index 0000000..2a9d196 Binary files /dev/null and b/staticfiles/images/python.png differ diff --git a/staticfiles/images/tv.png b/staticfiles/images/tv.png new file mode 100644 index 0000000..31c0a25 Binary files /dev/null and b/staticfiles/images/tv.png differ diff --git a/staticfiles/js/carousel.js b/staticfiles/js/carousel.js new file mode 100644 index 0000000..535d562 --- /dev/null +++ b/staticfiles/js/carousel.js @@ -0,0 +1,98 @@ +const controls = document.querySelectorAll(".control"); +let currentItem = 0; +const items = document.querySelectorAll(".item"); +const maxItems = items.length; + +controls.forEach((control) => { + control.addEventListener("click", () => { + const isLeft = control.classList.contains("arrow-left"); + + if (isLeft) { + currentItem -= 1; + } else { + currentItem += 1; + } + + if (currentItem >= maxItems) { + currentItem = 0; + } + // currentItem não pode ser < 0 + if (currentItem < 0) { + currentItem = maxItems - 1; + } + + items.forEach((item) => item.classList.remove("current-item")); + items[currentItem].scrollIntoView({ + inline: "center", + behavior: "smooth", + }); + + items[currentItem].classList.add("current-item"); + }); +}); + +const controls2 = document.querySelectorAll(".control2"); +let currentItem2 = 0; +const items2 = document.querySelectorAll(".item2"); +const maxItems2 = items2.length; + +controls2.forEach((control2) => { + control2.addEventListener("click", () => { + const isLeft2 = control2.classList.contains("arrow-left2"); + + if (isLeft2) { + currentItem2 -= 1; + } else { + currentItem2 += 1; + } + + if (currentItem2 >= maxItems2) { + currentItem2 = 0; + } + // currentItem não pode ser < 0 + if (currentItem2 < 0) { + currentItem2 = maxItems2 - 1; + } + + items2.forEach((item2) => item2.classList.remove("current-item2")); + items2[currentItem2].scrollIntoView({ + inline: "center", + behavior: "smooth", + }); + + items2[currentItem2].classList.add("current-item2"); + }); +}); + +const controls3 = document.querySelectorAll(".control3"); +let currentItem3 = 0; +const items3 = document.querySelectorAll(".item3"); +const maxItems3 = items3.length; + +controls3.forEach((control3) => { + control3.addEventListener("click", () => { + const isLeft3 = control3.classList.contains("arrow-left3"); + + if (isLeft3) { + currentItem3 -= 1; + } else { + currentItem3 += 1; + } + + if (currentItem3 >= maxItems3) { + currentItem3 = 0; + } + // currentItem não pode ser < 0 + if (currentItem3 < 0) { + currentItem3 = maxItems3 - 1; + } + + items3.forEach((item3) => item3.classList.remove("current-item3")); + items3[currentItem3].scrollIntoView({ + inline: "center", + behavior: "smooth", + }); + + items3[currentItem3].classList.add("current-item3"); + }); +}); diff --git a/staticfiles/js/navbar.js b/staticfiles/js/navbar.js new file mode 100644 index 0000000..4d2cd42 --- /dev/null +++ b/staticfiles/js/navbar.js @@ -0,0 +1,21 @@ +const nav = document.querySelector("nav"); //PEga a tag nav + +document.addEventListener("scroll", (e) => { + if (scrollY > 100) { + if (scrollY > window.innerHeight) { + nav.classList.add("invisible"); + } else { + nav.classList.add("navbar-bg"); + nav.classList.remove("invisible"); + } + } else { + nav.classList.remove("navbar-bg"); + nav.classList.remove("invisible"); + } +}); + + +const hamburger = document.querySelector(".hamburger"); +const navbar = document.querySelector(".navbar"); + +hamburger.addEventListener("click", () => navbar.classList.toggle("active"));