diff --git a/Astro/src/main/java/com/example/Astro/Controller/HomeController.java b/Astro/src/main/java/com/example/Astro/Controller/HomeController.java index 4f39a06..cab0811 100644 --- a/Astro/src/main/java/com/example/Astro/Controller/HomeController.java +++ b/Astro/src/main/java/com/example/Astro/Controller/HomeController.java @@ -6,22 +6,28 @@ Data: 24.09.2024 */ -import com.example.Astro.Model.User; -import com.example.Astro.Repository.UserRepository; -import com.example.Astro.service.TokenService; -import com.example.Astro.service.UserService; -import io.jsonwebtoken.Claims; +import java.time.LocalDate; + import org.springframework.beans.factory.annotation.Autowired; -import org.springframework.http.*; +import org.springframework.http.HttpEntity; +import org.springframework.http.HttpHeaders; +import org.springframework.http.HttpMethod; +import org.springframework.http.ResponseEntity; import org.springframework.security.crypto.bcrypt.BCryptPasswordEncoder; import org.springframework.stereotype.Controller; import org.springframework.ui.Model; -import org.springframework.web.bind.annotation.*; +import org.springframework.web.bind.annotation.GetMapping; +import org.springframework.web.bind.annotation.PathVariable; +import org.springframework.web.bind.annotation.PostMapping; +import org.springframework.web.bind.annotation.RequestParam; import org.springframework.web.client.RestTemplate; -import java.util.Optional; -import java.security.Principal; -import java.time.LocalDate; +import com.example.Astro.Model.User; +import com.example.Astro.Repository.UserRepository; +import com.example.Astro.service.TokenService; +import com.example.Astro.service.UserService; + +import io.jsonwebtoken.Claims; @Controller public class HomeController { @@ -43,6 +49,11 @@ public String login(){ return "login"; } + @GetMapping("/plano") + public String plano(){ + return "plano"; + } + @GetMapping("/sign") public String sign(){ return "sign"; @@ -65,9 +76,18 @@ public String home(@RequestParam("token") String token, Model model) { @GetMapping("/artist") public String artist() { return "artist";} + @GetMapping("/playlist") + public String playlist() {return "playlist";} + + @GetMapping("/album") + public String album() {return "album";} + @GetMapping("/busca") public String busca() {return "busca";} + @GetMapping("/setting") + public String setting() {return "setting";} + @GetMapping("/user") public String userProfile(@RequestParam("token") String token, Model model) { try { @@ -91,19 +111,6 @@ public String userProfile(@RequestParam("token") String token, Model model) { } } - - @GetMapping("/playlist/{id}") - public String playlist(@PathVariable("id") String id, @RequestParam("token") String token, Model model) { - model.addAttribute("token", token); - return "playlist"; - } - - @GetMapping("/album/{id}") - public String album(@PathVariable("id") String id, @RequestParam("token") String token, Model model) { - model.addAttribute("token", token); - return "album"; - } - @GetMapping("/single/{id}") public String single(@PathVariable("id") String id, @RequestParam("token") String token, Model model) { model.addAttribute("token", token); diff --git a/Astro/src/main/java/com/example/Astro/Model/User.java b/Astro/src/main/java/com/example/Astro/Model/User.java index edd461f..f7fc857 100644 --- a/Astro/src/main/java/com/example/Astro/Model/User.java +++ b/Astro/src/main/java/com/example/Astro/Model/User.java @@ -8,7 +8,6 @@ @Entity @Table(name = "User_Details") public class User { - @Id @GeneratedValue(strategy = GenerationType.IDENTITY) @Column(name = "idUser_Details") @@ -41,7 +40,6 @@ public User(Long idUserDetails, String email, String password, String username, this.username = username; this.lastAccess = lastAccess; this.token = token; - } // Getters e Setters diff --git a/Astro/src/main/resources/application.properties b/Astro/src/main/resources/application.properties index 798be67..920f7b1 100644 --- a/Astro/src/main/resources/application.properties +++ b/Astro/src/main/resources/application.properties @@ -16,4 +16,4 @@ spring.jpa.properties.hibernate.dialect=org.hibernate.dialect.MySQLDialect # Spotify API spotify.client.id=8b8a8c66585b4376b70f7362c50fbdf0 -spotify.client.secret=e856e53832ad4651a0dc1ab0ba1d33fc +spotify.client.secret=e856e53832ad4651a0dc1ab0ba1d33fc diff --git a/Astro/src/main/resources/static/css/components/navbar.css b/Astro/src/main/resources/static/css/components/navbar.css index 1d1e9de..f4d6b74 100644 --- a/Astro/src/main/resources/static/css/components/navbar.css +++ b/Astro/src/main/resources/static/css/components/navbar.css @@ -8,7 +8,7 @@ 3. Estilos do lado direito da barra de navegação 4. Estilos do botão de brilho - Data: 20 de Outubro de 2024 + Data: 21 de Outubro de 2024 */ nav.navigation-bar { @@ -59,6 +59,19 @@ nav.navigation-bar { gap: 1rem; transition: all 500ms ease; + .hamburger { + display: none; + cursor: pointer; + font-size: 24px; + color: var(--font-all); + transition: 250ms; + + &:hover { + color: var(--tertiary); + text-shadow: 0 0 10px var(--tertiary-shadow); + } + } + h6#albumTitleNav { width: 100%; font-size: 18px; @@ -214,3 +227,83 @@ a.btn-user { background-position: 180px; } } + +@media screen and (max-width: 550px) { + nav.navigation-bar { + grid-area: 1 / 1 / 2 / 8; + } + + .side-left .hamburger { + display: block; + } + + a.btn-user { + width: 40px; + } + + .btn-shine { + padding: 12px 24px; + font-size: 14px; + } +} + +@media screen and (max-width: 321px) { + .btn-shine { + display: none; + } +} + +.overlay-menu { + position: fixed; + padding: 1rem; + top: 0; + left: 0; + right: 0; + bottom: 0; + background: var(--black-shadow); + backdrop-filter: blur(10px); + color: var(--font-all); + display: none; + flex-direction: column; + align-items: flex-start; + justify-content: flex-start; + z-index: 1000; + opacity: 0; + transform: translateY(-20px); + transition: opacity 0.3s ease, transform 0.3s ease; +} + +.overlay-menu.visible { + opacity: 1; + transform: translateY(0); +} + +.menu-item { + margin: 15px 0; + color: var(--font-all); + text-decoration: none; + font-size: 24px; + display: flex; + align-items: center; + transform: all 250ms; + + span { + margin-right: 1rem; + } + + &:hover { + color: var(--tertiary); + border-bottom: 2px solid var(--tertiary); + } +} + +.close-button { + position: absolute; + top: 20px; + right: 20px; + background: transparent; + border: none; + color: white; + font-size: 30px; + cursor: pointer; +} \ No newline at end of file diff --git a/Astro/src/main/resources/static/css/components/player.css b/Astro/src/main/resources/static/css/components/player.css index 2149321..2873433 100644 --- a/Astro/src/main/resources/static/css/components/player.css +++ b/Astro/src/main/resources/static/css/components/player.css @@ -9,7 +9,7 @@ 4. Trackbar do player 5. Botão de volume do player - Data: 20 de Outubro de 2024 + Data: 21 de Outubro de 2024 */ /* Player */ @@ -158,85 +158,6 @@ button:is(#prevButton, #playPauseButton, #nextButton) { color: var(--white-shadow); } -/* Media screen */ - -@media screen and (max-width: 1025px) { - .containner_player { - bottom: 10px; - } - - .player { - height: 95px; - } - - .player_infoMusic #musicName { - font-size: 1em; - } - - .player_infoMusic #artistName { - font-size: 0.5em; - } -} - -@media screen and (max-width: 426px) { - .containner_player { - padding: 0; - bottom: 80px; - } - - .player { - margin: 0; - border-bottom-left-radius: 0; - border-bottom-right-radius: 0; - height: 110px; - place-items: center; - justify-content: space-around; - } - - .player_image #imgSong { - width: 60px; - height: 60px; - } - - .player_infoMusic, - .player_infoMusic #musicName { - width: 120px; - } - - #heartMusic, - #randomPlayerMusic { - font-size: 1em; - } - - .controls { - display: flex; - flex-direction: row; - justify-content: center; - position: absolute; - top: -50px; - left: 28%; - background: transparent; - background: var(--background-details-shadow); - -webkit-backdrop-filter: blur(20px); - backdrop-filter: blur(50px); - } - - .progress-bar, - .container_volume, - .fi-rr-menu-burger, - .container_faixas .container_faixas_detalhes, - .container_faixas .container_faixas_detalhes.open, - .container_faixas { - display: none; - } - - #duration, - #currentTime { - margin: 0 1px; - font-size: 0.5em; - } -} - .volume-control { display: flex; flex-direction: column-reverse; @@ -321,3 +242,51 @@ span.volume_off { border-color: transparent; color: transparent; } + +/* Media screen */ + +@media screen and (max-width: 1025px) { + .player { + height: 95px; + } + + .player_infoMusic #musicName { + font-size: 1em; + } + + .player_infoMusic #artistName { + font-size: 0.5em; + } +} + +@media screen and (max-width: 550px) { + .container_player { + grid-area: 3 / 1 / 4 / 8; + } + .player_image #imgSong { + width: 60px; + height: 60px; + } + + .side-left { + width: 80%; + } + + .player_infoMusic { + width: 100%; + } + + #randomPlayerMusic, + #nextButton, + #prevButton, + .container_volume, + .timecode_player, + .volume-control { + display: none; + } + + #heartMusic, + .playPauseButton { + display: flex; + } +} diff --git a/Astro/src/main/resources/static/css/components/sidebar.css b/Astro/src/main/resources/static/css/components/sidebar.css index 29bcac9..883a252 100644 --- a/Astro/src/main/resources/static/css/components/sidebar.css +++ b/Astro/src/main/resources/static/css/components/sidebar.css @@ -5,7 +5,7 @@ Seções principais: 1. Estilos da sidebar - Data: 20 de Outubro de 2024 + Data: 21 de Outubro de 2024 */ .sidebar { @@ -94,7 +94,8 @@ backdrop-filter: blur(10px); } -.sidebar li a, .sidebar li button { +.sidebar li a, +.sidebar li button { display: flex; height: 100%; width: 100%; @@ -228,3 +229,9 @@ hr { transition: opacity 0.5s ease; opacity: 0; } + +@media screen and (max-width: 550px) { + .sidebar { + display: none; + } +} \ No newline at end of file diff --git a/Astro/src/main/resources/static/css/index.css b/Astro/src/main/resources/static/css/index.css index aa6f224..245a504 100644 --- a/Astro/src/main/resources/static/css/index.css +++ b/Astro/src/main/resources/static/css/index.css @@ -2,7 +2,7 @@ Arquivo: eroor.css Descrição: Este arquivo contém os estilos da página index do Astro. - Data: 20 de Outubro de 2024 + Data: 21 de Outubro de 2024 */ body { @@ -261,6 +261,7 @@ section.container2 { box-shadow: 0 5px 5px var(--shadow-shadow); .wrapper-track { + width: 100%; display: flex; justify-content: space-evenly; align-items: stretch; @@ -304,6 +305,7 @@ section.music-section { var(--shadow) 10%, var(--secondary-shadow) 100% ); + display: flex; justify-content: space-evenly; align-items: center; @@ -324,8 +326,8 @@ section.music-section { top: 0; left: 0; border-radius: 12px; - background: url("https://images.theconversation.com/files/512871/original/file-20230301-26-ryosag.jpg?ixlib=rb-4.1.0&rect=97%2C79%2C5799%2C5817&q=45&auto=format&w=926&fit=clip") #000000 - no-repeat center center; + background: url("https://images.theconversation.com/files/512871/original/file-20230301-26-ryosag.jpg?ixlib=rb-4.1.0&rect=97%2C79%2C5799%2C5817&q=45&auto=format&w=926&fit=clip") + #000000 no-repeat center center; background-size: cover; z-index: 2; opacity: 0; @@ -344,7 +346,7 @@ section.music-section { position: absolute; background: url("https://images.vexels.com/content/161229/preview/vinyl-record-pattern-illustration-5517d1.png") no-repeat center center; - background-size: fill; + background-size: contain; z-index: 0; animation: rotateDicos 10s infinite linear; } @@ -392,7 +394,8 @@ section.container3 { text-shadow: 0 0 25px var(--tertiary-shadow); } - p, a { + p, + a { margin: 0.5rem 0; font-size: 24px; text-align: center; @@ -625,6 +628,35 @@ footer { .buttons button.button-sign { font-size: 24px; } + + section.container2 .wrapper-track { + display: grid; + grid-template-columns: repeat(2, 1fr); + place-items: center; + .wrapper-item { + align-items: center; + } + } + + section.music-section { + flex-direction: column; + gap: 2rem; + .music-image { + width: 400px; + height: 400px; + } + .music-detai { + width: 100%; + align-items: center; + text-align: center; + h1 { + font-size: 48px; + } + p { + font-size: 20px; + } + } + } } /* Smartphone */ @@ -634,36 +666,160 @@ footer { } .containner-info { margin-left: 0; - top: 10%; - -webkit-transform: translateY(-10%); - transform: translateY(-10%); - } - img.logo-image { - width: 310px; - height: auto; + top: 50%; + -webkit-transform: translateY(-50%); + transform: translateY(-50%); } + .containner-info-subtitle { + width: 50%; margin-top: -70px; margin-left: 3rem; } + + img.logo-image { + width: 310px; + height: auto; + } + h2.montserrat-regular { font-size: 21px; } + .console-container, .wrapper h3 { font-size: 18px; } + .buttons button.button-sign { font-size: 21px; } + .buttons { margin-left: 2rem; } - .wrapper-track { - flex-direction: column; + section.container2 .wrapper-track { + display: flex; + margin: 0 auto; + flex-wrap: wrap; justify-content: center; gap: 2rem; + align-items: stretch; + } + + section.music-section { + flex-direction: column; + + .music-image { + left: -50px; + width: 300px; + height: 300px; + } + + .music-detai { + width: 100%; + align-items: center; + text-align: center; + + h1 { + font-size: 42px; + } + + p { + font-size: 18px; + } + } + } + + section.container3 { + height: 350px; + h1 { + font-size: 42px; + } + + p, + a { + font-size: 18px; + } + + .circle { + width: 250px; + height: 250px; + } + + .circle1::after, + .circle2::after { + width: 15px; + height: 15px; + } + } + + section.container4 { + height: 700px; + h1 { + font-size: 42px; + } + + .container-wrapper { + flex-direction: column; + gap: 2rem; + + img { + width: 200px; + } + + .container-details { + width: 100%; + align-items: center; + text-align: center; + gap: 1rem; + + h2 { + font-size: 28px; + } + + p { + text-align: center; + width: 75%; + font-size: 18px; + } + + a.button-redirect { + font-size: 21px; + } + } + } + } + + footer { + padding: 2rem 0; + padding-inline: 2rem; + + .footer-container { + flex-direction: column; + align-items: center; + text-align: center; + justify-content: center; + gap: 2rem; + .footer-container-item { + img { + margin-top: 0; + } + } + } + + .others-informations { + flex-wrap: wrap; + gap: 2rem; + p { + font-size: 16px; + } + + a { + font-size: 16px; + } + } } } @@ -754,8 +910,14 @@ footer { } /* Animation-timeline */ -.leFadeIn span { animation-name: leFadeIn } +.leFadeIn span { + animation-name: leFadeIn; +} @keyframes leFadeIn { - from { opacity: 0 } - to { opacity: 1 } -} \ No newline at end of file + from { + opacity: 0; + } + to { + opacity: 1; + } +} diff --git a/Astro/src/main/resources/static/css/root/variables.css b/Astro/src/main/resources/static/css/root/variables.css index bdbc9df..ef10b78 100644 --- a/Astro/src/main/resources/static/css/root/variables.css +++ b/Astro/src/main/resources/static/css/root/variables.css @@ -36,7 +36,7 @@ --tertiary-shadow: #29f24749; } -:root.light { +.light { --font-all: #121212; /* Cor do texto */ --background-all: #f3f3f3; /* Cor de fundo */ @@ -60,7 +60,7 @@ --tertiary-shadow: rgba(41, 242, 71, 0.3); /* Sombra da cor terciária */ } -:root.dark { +.dark { --font-all: #ffffff; /* Cor do texto em branco para contraste */ --background-all: #121212; /* Cor de fundo preta */ @@ -84,7 +84,7 @@ --tertiary-shadow: rgba(102, 102, 102, 0.3); /* Sombra da cor terciária */ } -:root.ocean { +.ocean { --font-all: #ffffff; /* Cor do texto em branco para contraste */ --background-all: #121212; /* Cor de fundo preta */ @@ -108,7 +108,7 @@ --tertiary-shadow: rgba(38, 166, 154, 0.3); /* Sombra da cor terciária */ } -:root.fire { +.fire { --font-all: #ffffff; /* Cor do texto em branco para contraste */ --background-all: #ff4c4c; /* Cor de fundo preta */ diff --git a/Astro/src/main/resources/static/css/screen/home.css b/Astro/src/main/resources/static/css/screen/home.css index 0287f85..9d06150 100644 --- a/Astro/src/main/resources/static/css/screen/home.css +++ b/Astro/src/main/resources/static/css/screen/home.css @@ -9,7 +9,7 @@ 4. Estilos da seção de músicas 5. Estilos da seção de álbuns - Data: 20 de Outubro de 2024 + Data: 21 de Outubro de 2024 */ body { @@ -86,6 +86,7 @@ main { h1 { z-index: 20; font-size: 2.5em; + word-wrap: break-word; color: var(--font-all); text-shadow: 0 0 25px var(--secondary); letter-spacing: 3px; @@ -254,3 +255,29 @@ a.artist-link { background-size: 200% 200%; } } + +@media screen and (max-width: 550px) { + body { + grid-template-rows: auto 1fr auto; + } + + main { + grid-area: 2 / 1 / 3 / 8; + overflow-y: scroll; + scrollbar-width: none; + + &::-webkit-scrollbar { + display: none; + } + + .wrapper.first-acess { + p.subtitle { + font-size: 18px; + } + + span#userNameAcess { + font-size: 1.2em; + } + } + } +} diff --git a/Astro/src/main/resources/static/css/screen/settings.css b/Astro/src/main/resources/static/css/screen/settings.css new file mode 100644 index 0000000..281a902 --- /dev/null +++ b/Astro/src/main/resources/static/css/screen/settings.css @@ -0,0 +1,190 @@ +body { + padding: 1rem; + width: 100%; + height: 100vh !important; + display: grid; + grid-template-columns: 80px 1fr 1fr 1fr 1fr; + grid-template-rows: auto 1fr auto; + grid-column-gap: 16px; + grid-row-gap: 16px; + + background: linear-gradient( + to top, + var(--primary-shadow) 0%, + var(--shadow) 10% + ), + var(--shadow); + behavior: smooth; +} + +main { + padding-right: 1rem; + grid-area: 2 / 2 / 3 / 6; + overflow-x: hidden; + position: relative; +} + +.user-banner { + height: 250px; + background: linear-gradient(to left, var(--primary) 0%, #f3f3f3 100%); + border-radius: 24px; + position: relative; + color: var(--font-all); + + .user-banner-details { + width: calc(100% - 280px); + display: flex; + justify-content: space-between; + align-items: center; + position: absolute; + bottom: 0.5rem; + left: 260px; + + h1#userNameAcess { + max-width: 50%; + font-size: 2.5em; + white-space: wrap; + overflow: hidden; + text-overflow: ellipsis; + text-shadow: 0 0 24px var(--secondary-shadow-light); + } + + a { + background-color: transparent; + color: var(--font-all); + border: 2px solid var(--white); + letter-spacing: 1px; + font-size: 1em; + padding: 0.5rem 1rem; + border-radius: 24px; + cursor: pointer; + transition: all 0.3s; + text-decoration: none; + + &:hover { + background-color: var(--white); + color: var(--primary); + } + } + } + + .user-banner-image img#userImage { + position: absolute; + left: 50px; + top: 100%; + transform: translateY(-50%); + border-radius: 100%; + --size: 200px; + width: var(--size); + height: var(--size); + border: 5px solid var(--shadow); + object-fit: cover; + } +} + +section.settings-container { + display: flex; + justify-content: baseline; + justify-content: space-between; + margin-top: 7rem; + color: var(--font-all); + gap: 1rem; + + article.general, + article.themes { + width: 40%; + + h2 { + margin-bottom: 1rem; + font-size: 26px; + color: var(--font-all); + letter-spacing: 3px; + } + } + + .container-user { + margin: 1.5rem 0; + user-select: none; + + input { + padding: 0.5rem; + border: 0; + outline: none; + background: transparent; + border-bottom: 1px solid var(--white); + color: var(--font-all); + width: 100%; + } + } + + .wrapper-themes { + display: flex; + flex-wrap: wrap; + gap: 1rem; + + .container-temas { + display: flex; + align-items: center; + flex-direction: column; + + p.nome-tema { + margin-top: 0.5rem; + font-size: 12px; + } + + button { + --size: 100px; + width: var(--size); + height: var(--size); + border-radius: 12px; + border: 0; + cursor: pointer; + filter: grayscale(0.7); + transition: 250ms; + + &:hover { + filter: grayscale(0); + } + + &:active { + filter: grayscale(0); + } + + &#defaultTheme { + background: linear-gradient( + to top, + #05061e 0%, + #4b0072 50%, + #ff3d20 100% + ); + } + + &#lightMode { + background: linear-gradient(to top, #e0e0e0 0%, #b5b5b5 100%); + } + + &#darkMode { + background: linear-gradient(to top, #121212 0%, #666666 100%); + } + + &#fireMode { + background: linear-gradient( + to top, + #581515 0%, + #820808 50%, + #c62323 100% + ); + } + + &#oceanMode { + background: linear-gradient( + to top, + #092d29 0%, + #26a69a 50%, + #61c0bf 100% + ); + } + } + } + } +} diff --git a/Astro/src/main/resources/static/css/screen/sign.css b/Astro/src/main/resources/static/css/screen/sign.css index 0dca72d..8a4fa65 100644 --- a/Astro/src/main/resources/static/css/screen/sign.css +++ b/Astro/src/main/resources/static/css/screen/sign.css @@ -8,7 +8,7 @@ 3. Estilos dos elementos da página 4. Estilos do botão de login com Google - Data: 20 de Outubro de 2024 + Data: 21 de Outubro de 2024 */ @@ -42,7 +42,7 @@ label.logo-title { main.container { height: 100%; position: absolute; - max-width: 550px; + max-width: 650px; left: 50%; -webkit-transform: translateX(-50%); transform: translateX(-50%); @@ -80,7 +80,7 @@ main.container a { } .form-container { - margin: 1rem 0; + margin: 1rem auto; width: 520px; } @@ -98,6 +98,7 @@ main.container a { } .form-container input { + position: relative; margin: 0.5rem 0; padding: 0.8rem 0.5rem; width: 100%; @@ -137,6 +138,7 @@ main.container a { } .password-input { + position: relative; display: -webkit-box; display: -ms-flexbox; display: flex; @@ -149,7 +151,11 @@ main.container a { } input[type="submit"].button-submit { - width: 100%; + position: relative; + left: 50%; + -webkit-transform: translateX(-50%); + transform: translateX(-50%); + width: 80%; padding: 1rem 0; border: 0; border-radius: 12px; @@ -192,6 +198,67 @@ p { font-size: 21px; color: var(--tertiary); cursor: pointer; + + a.terms { + font-size: 21px; + } +} + +/*Google button*/ +#login-button { + margin: 1rem 0; + position: relative; + left: 50%; + -webkit-transform: translateX(-50%); + transform: translateX(-50%); + width: 80%; + padding: 0.8rem 0; + border: 0; + border-radius: 12px; + cursor: pointer; + display: flex; + align-items: center; + justify-content: center; + transition: 500ms; + background: var(--black-shadow); + color: var(--font-all); + + &:hover, &:focus { + background: var(--white); + box-shadow: 0 0 25px rgba(255, 255, 255, 0.5); + color: var(--secondary); + } +} + +#login-button::before { + content: ''; + background: url('https://www.svgrepo.com/show/303108/google-icon-logo.svg') no-repeat center; + background-size: 16px 16px; + display: inline-block; + --size: 16px; + width: var(--size); + height: var(--size); + margin-right: 10px; +} + + +/*Media*/ + +@media screen and (min-width: 1080) { + main.container h1 { + font-size: 64px; + } + a { + font-size: 24px; + } + .form-container input { + font-size: 18px; + } + + input[type="submit"].button-submit { + font-size: 18px; + padding: 1rem; + } } @media screen and (max-width: 850px) { @@ -213,19 +280,19 @@ p { } label.logo-title, a { - font-size: 14px; + font-size: 21px; } main.container { width: 100%; - left: 50%; - -webkit-transform: translateX(-50%); - transform: translateX(-50%); + left: 25%; + -webkit-transform: translateX(-25%); + transform: translateX(-25%); } main.container h1 { font-size: 32px; } main.container a { - font-size: 14px; + font-size: 21px; } .form-container { margin-top: 8px; @@ -238,9 +305,9 @@ p { } p { font-size: 12px; - } - p a.bebas-neue-regular { - font-size: 12px; + a.terms { + font-size: 12px; + } } } @@ -261,41 +328,3 @@ p { opacity: 1; } } - -#login-button { - width: 100%; - padding: 1rem 0; - border: 0; - border-radius: 12px; - background: var; /* Cor do botão Google */ - color: white; /* Texto branco */ - font-size: 21px; - cursor: pointer; - transition: 500ms; - display: flex; - align-items: center; - justify-content: center; - font-weight: bold; -} - -#login-button:hover { - background: #357ae8; /* Cor mais escura ao passar o mouse */ - box-shadow: 0 0 25px rgba(66, 133, 244, 0.5); -} - -#login-button:focus { - outline: none; /* Remove o contorno padrão */ - box-shadow: 0 0 0 3px rgba(66, 133, 244, 0.5); /* Efeito de foco */ -} - -/* Para adicionar um ícone ao botão, se desejar */ -#login-button::before { - content: ''; - background: url('C:\Users\Aluno\Documents\GitHub\Astro-reimagination\Astro\src\main\resources\static\favicon/google.png') no-repeat center; /* Caminho do ícone do Google */ - background-size: 20px 20px; /* Ajuste o tamanho do ícone */ - display: inline-block; - width: 20px; /* Largura do ícone */ - height: 20px; /* Altura do ícone */ - margin-right: 10px; /* Espaçamento entre o ícone e o texto */ -} - diff --git a/Astro/src/main/resources/static/css/screen/user.css b/Astro/src/main/resources/static/css/screen/user.css index 49abff7..22451d9 100644 --- a/Astro/src/main/resources/static/css/screen/user.css +++ b/Astro/src/main/resources/static/css/screen/user.css @@ -77,7 +77,7 @@ main { cursor: default; } - button#seguir { + a { background-color: transparent; color: var(--font-all); border: 2px solid var(--white); @@ -87,6 +87,7 @@ main { border-radius: 24px; cursor: pointer; transition: all 0.3s; + text-decoration: none; &:hover { background-color: var(--white); diff --git a/Astro/src/main/resources/static/favicon/android-chrome-192x192.png b/Astro/src/main/resources/static/favicon/android-chrome-192x192.png index 7745ceb..fbc6626 100644 Binary files a/Astro/src/main/resources/static/favicon/android-chrome-192x192.png and b/Astro/src/main/resources/static/favicon/android-chrome-192x192.png differ diff --git a/Astro/src/main/resources/static/favicon/android-chrome-512x512.png b/Astro/src/main/resources/static/favicon/android-chrome-512x512.png index 5a02e08..d89f2aa 100644 Binary files a/Astro/src/main/resources/static/favicon/android-chrome-512x512.png and b/Astro/src/main/resources/static/favicon/android-chrome-512x512.png differ diff --git a/Astro/src/main/resources/static/favicon/apple-touch-icon.png b/Astro/src/main/resources/static/favicon/apple-touch-icon.png index f2e2e53..e57f950 100644 Binary files a/Astro/src/main/resources/static/favicon/apple-touch-icon.png and b/Astro/src/main/resources/static/favicon/apple-touch-icon.png differ diff --git a/Astro/src/main/resources/static/favicon/favicon-16x16.png b/Astro/src/main/resources/static/favicon/favicon-16x16.png index 4c653a6..8ba1bbd 100644 Binary files a/Astro/src/main/resources/static/favicon/favicon-16x16.png and b/Astro/src/main/resources/static/favicon/favicon-16x16.png differ diff --git a/Astro/src/main/resources/static/favicon/favicon-32x32.png b/Astro/src/main/resources/static/favicon/favicon-32x32.png index 93c23a8..76feb63 100644 Binary files a/Astro/src/main/resources/static/favicon/favicon-32x32.png and b/Astro/src/main/resources/static/favicon/favicon-32x32.png differ diff --git a/Astro/src/main/resources/static/favicon/favicon.ico b/Astro/src/main/resources/static/favicon/favicon.ico index 83b52c1..2e75ab8 100644 Binary files a/Astro/src/main/resources/static/favicon/favicon.ico and b/Astro/src/main/resources/static/favicon/favicon.ico differ diff --git a/Astro/src/main/resources/static/favicon/google.png b/Astro/src/main/resources/static/favicon/google.png deleted file mode 100644 index 0fceb20..0000000 Binary files a/Astro/src/main/resources/static/favicon/google.png and /dev/null differ diff --git a/Astro/src/main/resources/static/images/placeholder.png b/Astro/src/main/resources/static/images/placeholder.png index 316506c..c73347b 100644 Binary files a/Astro/src/main/resources/static/images/placeholder.png and b/Astro/src/main/resources/static/images/placeholder.png differ diff --git a/Astro/src/main/resources/static/js/albums.js b/Astro/src/main/resources/static/js/albums.js index 8d1ed04..85ff897 100644 --- a/Astro/src/main/resources/static/js/albums.js +++ b/Astro/src/main/resources/static/js/albums.js @@ -70,13 +70,24 @@ const displayAlbumData = (albumData) => { albumImage.alt = albumData.name; albumImage.classList.add("album-image"); - const albumTitleNav = document.getElementById("albumTitleNav"); - albumTitleNav.textContent = albumData.name; - const albumTitle = document.getElementById("albumTitleElement"); - albumTitle.textContent = albumData.name; - const albumArtist = document.getElementById("albumArtistElement"); - albumArtist.textContent = albumData.artists[0].name; - albumArtist.href = `artist.html?id=${albumData.artists[0].id}`; + document.getElementById("albumTitleElement").textContent = albumData.name; + const albumArtistElement = document.getElementById("albumArtistElement"); + albumArtistElement.innerHTML = ""; // Limpar qualquer conteúdo existente no elemento + + albumData.artists.forEach((artist) => { + const artistLink = document.createElement("a"); + artistLink.classList.add("montserrat-regular"); // Classe para estilização + artistLink.href = `/artist?id=${artist.id}`; // Definir o link para o artista + artistLink.textContent = artist.name; // Nome do artista + + albumArtistElement.appendChild(artistLink); // Adicionar o link ao elemento + + // Adicionar uma vírgula e espaço entre os links, exceto no último + if (artist !== albumData.artists[albumData.artists.length - 1]) { + const separator = document.createTextNode(", "); + albumArtistElement.appendChild(separator); // Adicionar a vírgula após cada artista, exceto o último + } + }); // Criar a lista de faixas const trackList = document.createElement("ul"); @@ -90,7 +101,7 @@ const displayAlbumData = (albumData) => { const trackNumber = document.createElement("span"); trackNumber.classList.add("track-number", "montserrat-regular"); - trackNumber.textContent = `#${track.track_number}`; + trackNumber.innerHTML = `#${track.track_number}`; trackNumber.dataset.trackNumber = track.track_number; const trackPicture = document.createElement("picture"); @@ -119,24 +130,29 @@ const displayAlbumData = (albumData) => { const trackTitle = document.createElement("h3"); trackTitle.classList.add("montserrat-bold"); - trackTitle.textContent = track.name; + trackTitle.innerHTML = track.name; trackTitle.dataset.trackTitle = track.name; - const trackArtists = document.createElement("a"); - trackArtists.classList.add("montserrat-regular"); - trackArtists.href = `artist.html?id=${track.artists[0].id}`; - let artistNames = track.artists[0].name; - if (track.artists.length > 1) { - for (let i = 1; i < track.artists.length; i++) { - artistNames += ", " + track.artists[i].name; // Concatena os nomes com uma vírgula - } - } + const trackArtistsContainer = document.createElement("div"); // Contêiner para armazenar todos os links dos artistas + trackArtistsContainer.classList.add("artists-container"); // Classe opcional para estilização - trackArtists.textContent = artistNames; - trackArtists.dataset.trackArtist = track.artists[0].name; + track.artists.forEach((artist) => { + const trackArtistLink = document.createElement("a"); + trackArtistLink.classList.add("montserrat-regular"); // Classe para estilização + trackArtistLink.href = `/artist?id=${artist.id}`; // Definir o link para o artista + trackArtistLink.textContent = artist.name; // Nome do artista + + trackArtistsContainer.appendChild(trackArtistLink); // Adicionar o link ao contêiner + + // Adicionar uma vírgula e espaço entre os links, exceto no último + if (artist !== track.artists[track.artists.length - 1]) { + const separator = document.createTextNode(", "); + trackArtistsContainer.appendChild(separator); // Adicionar a vírgula após cada artista, exceto o último + } + }); trackInfo.appendChild(trackTitle); - trackInfo.appendChild(trackArtists); + trackInfo.appendChild(trackArtistsContainer); const trackDuration = document.createElement("span"); trackDuration.classList.add("montserrat-regular"); diff --git a/Astro/src/main/resources/static/js/api/apiAcess.js b/Astro/src/main/resources/static/js/api/apiAcess.js index 3f6c8f9..c4bb453 100644 --- a/Astro/src/main/resources/static/js/api/apiAcess.js +++ b/Astro/src/main/resources/static/js/api/apiAcess.js @@ -351,7 +351,7 @@ const exibirAlbums = (albums) => { : "Artista desconhecido"; slide.innerHTML = ` - + ${albumName}
${albumName}
diff --git a/Astro/src/main/resources/static/js/generator/menus.js b/Astro/src/main/resources/static/js/generator/menus.js index 392acf6..6a03900 100644 --- a/Astro/src/main/resources/static/js/generator/menus.js +++ b/Astro/src/main/resources/static/js/generator/menus.js @@ -59,7 +59,7 @@ document.addEventListener("DOMContentLoaded", function () { setTimeout(() => { notificationItem.remove(); }, 500); // Tempo do fade - }, 5000); // Tempo antes de iniciar o fade + }, 3000); // Tempo antes de iniciar o fade } // Criação da sidebar const sidebar = document.createElement("div"); @@ -71,7 +71,7 @@ document.addEventListener("DOMContentLoaded", function () { // Adicionando itens à lista navList.appendChild( createMenuItem( - 'publicHome', + 'public', "Home", "home" ) @@ -86,7 +86,7 @@ document.addEventListener("DOMContentLoaded", function () { navList.appendChild(document.createElement("hr")); // Separator navList.appendChild( createMenuItem( - 'folderBiblioteca', + 'folder', "Biblioteca", null, true, @@ -109,28 +109,30 @@ document.addEventListener("DOMContentLoaded", function () { ) ); + // Exit section // Exit section const exitContainer = document.createElement("div"); exitContainer.classList.add("exit-container"); const exitItem = createMenuItem( - 'exit_to_appSair', + 'exit_to_app', "Sair", - "/", - true, // Define como um botão + true, () => { - // Aqui você pode adicionar a lógica de logout se necessário - window.location.href = "/"; // Redireciona para a página inicial + console.log("Saindo"); // Imprime mensagem no console + logout(); // Chama a função de logout } ); + exitContainer.addEventListener("click", () => logout()) + // Adiciona a classe logoutBtn ao botão - exitItem.firstChild.classList.add("logoutBtn"); + exitItem.firstChild.id = "logoutBtn"; exitContainer.appendChild(exitItem); navList.appendChild(exitContainer); // Montagem da lista e sidebar sidebar.appendChild(navList); - document.body.appendChild(sidebar); + document.body.prepend(sidebar); }); diff --git a/Astro/src/main/resources/static/js/generator/navbar.js b/Astro/src/main/resources/static/js/generator/navbar.js new file mode 100644 index 0000000..44f13fa --- /dev/null +++ b/Astro/src/main/resources/static/js/generator/navbar.js @@ -0,0 +1,149 @@ +/** + * Função para criar a barra de navegação do Astro + * @ohthias + */ + +const createNavigationBar = () => { + const nav = document.createElement("nav"); + nav.className = "navigation-bar"; + + const sideLeft = document.createElement("div"); + sideLeft.className = "side-left"; + + const hamburgerIcon = document.createElement("i"); + hamburgerIcon.className = "material-icons hamburger"; + hamburgerIcon.textContent = "menu"; + + const logoLink = document.createElement("a"); + logoLink.href = "/home"; + logoLink.className = "nav-logo bebas-neue-regular"; + logoLink.textContent = "Astro"; + + sideLeft.appendChild(hamburgerIcon); + sideLeft.appendChild(logoLink); + + // Obtém o caminho da URL atual + const currentPage = window.location.pathname.split("/").pop().split(".")[0]; // Ex: 'playlist' ou 'album' + + // Verifica se a página atual é playlist ou álbum + if (currentPage === "playlist" || currentPage === "album") { + const navMenu = document.createElement("section"); + navMenu.className = "nav-menu"; + navMenu.id = "controllerNav"; + navMenu.style.display = "none"; + + const controllerButtons = document.createElement("div"); + controllerButtons.className = "controller-buttons"; + + const playButton = document.createElement("button"); + playButton.id = "playButton"; + playButton.className = "controller-button"; + playButton.setAttribute("aria-label", "Play"); + + const playIcon = document.createElement("span"); + playIcon.className = "material-symbols-outlined"; + playIcon.textContent = "play_arrow"; + + playButton.appendChild(playIcon); + + const favoriteButton = document.createElement("button"); + favoriteButton.id = "favoriteButton"; + favoriteButton.className = "controller-button"; + favoriteButton.setAttribute("aria-label", "Favorite"); + + const favoriteIcon = document.createElement("span"); + favoriteIcon.className = "material-symbols-outlined"; + favoriteIcon.textContent = "favorite"; + + favoriteButton.appendChild(favoriteIcon); + + controllerButtons.appendChild(playButton); + controllerButtons.appendChild(favoriteButton); + navMenu.appendChild(controllerButtons); + + sideLeft.appendChild(navMenu); + } + + const sideRight = document.createElement("div"); + sideRight.className = "side-right"; + + const premiumLink = document.createElement("a"); + premiumLink.href = "/plano"; + premiumLink.className = "btn-shine montserrat-bold"; + premiumLink.innerHTML = "Seja premium"; + + const userLink = document.createElement("a"); + userLink.href = "/user"; + userLink.className = "btn-user"; + + const userImage = document.createElement("img"); + userImage.src = "/images/placeholder.png"; + userImage.alt = "placeholder"; + userImage.className = "user-perfil"; + + userLink.appendChild(userImage); + sideRight.appendChild(premiumLink); + sideRight.appendChild(userLink); + + nav.appendChild(sideLeft); + nav.appendChild(sideRight); + + // Menu do hamburger + const overlayMenu = document.createElement("div"); + overlayMenu.className = "overlay-menu"; + overlayMenu.style.display = "none"; + + // Botão de fechar + const closeButton = document.createElement("button"); + closeButton.className = "close-button"; + closeButton.innerHTML = "×"; // Símbolo de fechar + closeButton.setAttribute("aria-label", "Fechar menu"); + + const menuItems = [ + { name: "Home", icon: "home", link: "/home" }, + { name: "Busca", icon: "search", link: "/busca" }, + { name: "Sair", icon: "logout", link: "/" }, + ]; + + menuItems.forEach((item) => { + const menuItem = document.createElement("a"); + menuItem.href = item.link; + + const itemIcon = document.createElement("span"); + itemIcon.className = "material-icons"; + itemIcon.textContent = item.icon; + + menuItem.appendChild(itemIcon); + menuItem.appendChild(document.createTextNode(item.name)); + menuItem.className = "menu-item montserrat-bold"; + + if (item.name === "Sair") { + menuItem.classList.add("logoutBtn"); + } + + overlayMenu.appendChild(menuItem); + }); + + overlayMenu.appendChild(closeButton); // Adiciona o botão de fechar + document.body.appendChild(nav); + document.body.appendChild(overlayMenu); + + // Evento para mostrar/ocultar o menu + hamburgerIcon.addEventListener("click", () => { + overlayMenu.style.display = "flex"; // Torna o menu visível + setTimeout(() => { + overlayMenu.classList.add("visible"); // Adiciona a classe de visibilidade após a exibição + }, 10); // Delay para permitir a aplicação da transição + }); + + // Evento para fechar o menu + closeButton.addEventListener("click", () => { + overlayMenu.classList.remove("visible"); + setTimeout(() => { + overlayMenu.style.display = "none"; + }, 300); + }); +}; + +// Chamar a função para gerar a barra de navegação +createNavigationBar(); diff --git a/Astro/src/main/resources/static/js/generator/player.js b/Astro/src/main/resources/static/js/generator/player.js index 0895950..f68d1c5 100644 --- a/Astro/src/main/resources/static/js/generator/player.js +++ b/Astro/src/main/resources/static/js/generator/player.js @@ -1,121 +1,147 @@ -document.addEventListener("DOMContentLoaded", function () { - // Criação da estrutura do player - const containerPlayer = document.createElement("div"); - containerPlayer.classList.add("container_player"); - - const player = document.createElement("div"); - player.classList.add("player"); - - // Seção esquerda do player - const sideLeft = document.createElement("div"); - sideLeft.classList.add("side-left"); - - const playerImage = document.createElement("div"); - playerImage.classList.add("player_image"); - const imgSong = document.createElement("img"); - imgSong.id = "imgSong"; - imgSong.src = "https://fakeimg.pl/210x210/e9e9e9/e9e9e9"; - imgSong.alt = "Song_Image"; - playerImage.appendChild(imgSong); - - const playerInfoMusic = document.createElement("div"); - playerInfoMusic.classList.add("player_infoMusic"); - const musicName = document.createElement("span"); - musicName.id = "musicName"; - musicName.classList.add("montserrat-bold"); - musicName.textContent = "Título da Música"; - const artistName = document.createElement("span"); - artistName.id = "artistName"; - artistName.classList.add("montserrat-regular"); - artistName.textContent = "Artista"; - playerInfoMusic.appendChild(musicName); - playerInfoMusic.appendChild(artistName); - - sideLeft.appendChild(playerImage); - sideLeft.appendChild(playerInfoMusic); - - // Seção dos controles do usuário - const userPrefers = document.createElement("div"); - userPrefers.classList.add("user-prefers"); - - const heartMusic = document.createElement("button"); - heartMusic.id = "heartMusic"; - heartMusic.innerHTML = 'favorite'; - - const prevButton = document.createElement("button"); - prevButton.id = "prevButton"; - prevButton.innerHTML = 'skip_previous'; - - const playPauseButton = document.createElement("button"); - playPauseButton.id = "playPauseButton"; - playPauseButton.innerHTML = 'play_arrow'; - - const nextButton = document.createElement("button"); - nextButton.id = "nextButton"; - nextButton.innerHTML = 'skip_next'; - - const randomPlayerMusic = document.createElement("button"); - randomPlayerMusic.id = "randomPlayerMusic"; - randomPlayerMusic.innerHTML = 'shuffle'; - - userPrefers.appendChild(heartMusic); - userPrefers.appendChild(prevButton); - userPrefers.appendChild(playPauseButton); - userPrefers.appendChild(nextButton); - userPrefers.appendChild(randomPlayerMusic); - - // Audio player - const audioPlayer = document.createElement("audio"); - audioPlayer.id = "player"; - audioPlayer.src = ""; - - // Barra de progresso e tempo - const timecodePlayer = document.createElement("div"); - timecodePlayer.classList.add("timecode_player"); - - const currentTime = document.createElement("span"); - currentTime.id = "currentTime"; - currentTime.classList.add("montserrat-medium"); - currentTime.textContent = "0:00"; - - const progressBar = document.createElement("div"); - progressBar.classList.add("progress-bar"); - progressBar.id = "progressBar"; - progressBar.style.cursor = "pointer"; - const progress = document.createElement("div"); - progress.classList.add("progress"); - progressBar.appendChild(progress); - - const duration = document.createElement("span"); - duration.id = "duration"; - duration.classList.add("montserrat-medium"); - duration.textContent = "0:00"; - - timecodePlayer.appendChild(currentTime); - timecodePlayer.appendChild(progressBar); - timecodePlayer.appendChild(duration); - - // Controle de volume - const volumeControl = document.createElement("div"); - volumeControl.classList.add("volume-control"); - const volumeSlider = document.createElement("input"); - volumeSlider.type = "range"; - volumeSlider.id = "volumeSlider"; - volumeSlider.min = "0"; - volumeSlider.max = "1"; - volumeSlider.step = "0.01"; - volumeSlider.value = "1"; - volumeControl.appendChild(volumeSlider); - - // Montagem da estrutura do player - player.appendChild(sideLeft); - player.appendChild(userPrefers); - player.appendChild(audioPlayer); - player.appendChild(timecodePlayer); - player.appendChild(volumeControl); - - containerPlayer.appendChild(player); - - // Adiciona a estrutura na página - document.body.appendChild(containerPlayer); -}); +// Criação da estrutura HTML usando JavaScript +const containerPlayer = document.createElement("div"); +containerPlayer.className = "container_player"; + +const player = document.createElement("div"); +player.className = "player"; + +const sideLeft = document.createElement("div"); +sideLeft.className = "side-left"; + +const playerImage = document.createElement("div"); +playerImage.className = "player_image"; + +const imgSong = document.createElement("img"); +imgSong.id = "imgSong"; +imgSong.src = "https://fakeimg.pl/210x210/e9e9e9/e9e9e9"; +imgSong.alt = "Song_Image"; +playerImage.appendChild(imgSong); + +const playerInfoMusic = document.createElement("div"); +playerInfoMusic.className = "player_infoMusic"; + +const musicName = document.createElement("span"); +musicName.id = "musicName"; +musicName.className = "montserrat-bold"; +musicName.textContent = "Título da Música"; + +const artistName = document.createElement("span"); +artistName.id = "artistName"; +artistName.className = "montserrat-regular"; +artistName.textContent = "Artista"; + +playerInfoMusic.appendChild(musicName); +playerInfoMusic.appendChild(artistName); +sideLeft.appendChild(playerImage); +sideLeft.appendChild(playerInfoMusic); +player.appendChild(sideLeft); + +// Controles de usuário +const userPrefers = document.createElement("div"); +userPrefers.className = "user-prefers"; + +const heartMusicButton = document.createElement("button"); +heartMusicButton.id = "heartMusic"; +const heartIcon = document.createElement("span"); +heartIcon.className = "material-symbols-outlined heart"; +heartIcon.textContent = "favorite"; +heartMusicButton.appendChild(heartIcon); + +const prevButton = document.createElement("button"); +prevButton.id = "prevButton"; +const prevIcon = document.createElement("span"); +prevIcon.className = "material-symbols-outlined skip_previous"; +prevIcon.textContent = "skip_previous"; +prevButton.appendChild(prevIcon); + +const playPauseButton = document.createElement("button"); +playPauseButton.id = "playPauseButton"; +const playIcon = document.createElement("span"); +playIcon.className = "material-symbols-outlined play_arrow"; +playIcon.textContent = "play_arrow"; +playPauseButton.appendChild(playIcon); + +const nextButton = document.createElement("button"); +nextButton.id = "nextButton"; +const nextIcon = document.createElement("span"); +nextIcon.className = "material-symbols-outlined skip_next"; +nextIcon.textContent = "skip_next"; +nextButton.appendChild(nextIcon); + +const randomPlayerMusicButton = document.createElement("button"); +randomPlayerMusicButton.id = "randomPlayerMusic"; +const shuffleIcon = document.createElement("span"); +shuffleIcon.className = "material-symbols-outlined shuffle"; +shuffleIcon.textContent = "shuffle"; +randomPlayerMusicButton.appendChild(shuffleIcon); + +userPrefers.appendChild(heartMusicButton); +userPrefers.appendChild(prevButton); +userPrefers.appendChild(playPauseButton); +userPrefers.appendChild(nextButton); +userPrefers.appendChild(randomPlayerMusicButton); +player.appendChild(userPrefers); + +// Player de áudio +const audioPlayer = document.createElement("audio"); +audioPlayer.id = "player"; +audioPlayer.src = ""; +player.appendChild(audioPlayer); + +// Barra de progresso e tempo +const timecodePlayer = document.createElement("div"); +timecodePlayer.className = "timecode_player"; + +const currentTime = document.createElement("span"); +currentTime.id = "currentTime"; +currentTime.className = "montserrat-medium"; +currentTime.textContent = "0:00"; + +const progressBar = document.createElement("div"); +progressBar.className = "progress-bar"; +progressBar.id = "progressBar"; +progressBar.style.cursor = "pointer"; + +const progress = document.createElement("div"); +progress.className = "progress"; +progressBar.appendChild(progress); + +const duration = document.createElement("span"); +duration.id = "duration"; +duration.className = "montserrat-medium"; +duration.textContent = "0:00"; + +timecodePlayer.appendChild(currentTime); +timecodePlayer.appendChild(progressBar); +timecodePlayer.appendChild(duration); +player.appendChild(timecodePlayer); + +// Controle de volume +const volumeControl = document.createElement("div"); +volumeControl.className = "volume-control"; + +const volumeIcon = document.createElement("span"); +volumeIcon.className = "material-symbols-outlined volume_up"; +volumeIcon.textContent = "volume_up"; + +const volumeToolkit = document.createElement("div"); +volumeToolkit.className = "volume-toolkit"; + +const volumeSlider = document.createElement("input"); +volumeSlider.type = "range"; +volumeSlider.id = "volumeSlider"; +volumeSlider.min = "0"; +volumeSlider.max = "1"; +volumeSlider.step = "0.01"; +volumeSlider.value = "1"; + +volumeToolkit.appendChild(volumeSlider); +volumeControl.appendChild(volumeIcon); +volumeControl.appendChild(volumeToolkit); +player.appendChild(volumeControl); + +// Adiciona o player ao container +containerPlayer.appendChild(player); + +// Adiciona o container ao body (ou outro elemento desejado) +document.body.appendChild(containerPlayer); diff --git a/Astro/src/main/resources/static/js/home.js b/Astro/src/main/resources/static/js/home.js index d35b12b..db1cf80 100644 --- a/Astro/src/main/resources/static/js/home.js +++ b/Astro/src/main/resources/static/js/home.js @@ -2,15 +2,13 @@ const getTokenFromLocalStorage = () => { return localStorage.getItem('authToken'); // Obtém o token do localStorage } -// Função para decodificar o token JWT const parseJwt = (token) => { try { const base64Url = token.split('.')[1]; // Obtém o payload (a segunda parte do token) - const base64 = decodeURIComponent(atob(base64Url).split('').map(function(c) { - return '%' + ('00' + c.charCodeAt(0).toString(16)).slice(-2); - }).join('')); + const base64 = atob(base64Url); // Decodifica o Base64 + const jsonPayload = decodeURIComponent(escape(base64)); // Corrige problemas de codificação - return JSON.parse(base64); // Retorna o payload como um objeto JavaScript + return JSON.parse(jsonPayload); // Retorna o payload como um objeto JavaScript } catch (error) { console.error("Erro ao decodificar o token JWT", error); return null; @@ -27,18 +25,20 @@ document.addEventListener("DOMContentLoaded", function () { if (decodedToken) { // Obtém o nome de usuário do token decodificado (supondo que esteja no campo 'sub') + const userName = decodedToken.sub || "Nome não disponível"; const userEmail = decodedToken.email || "Email não disponível"; const userCreationDate = decodedToken.iat ? new Date(decodedToken.iat * 1000).toLocaleDateString() : "Data de criação não disponível"; // Exibindo as informações no HTML document.getElementById("userNameAcess").innerHTML = userName; - document.getElementById("userEmail").innerHTML = userEmail; - document.getElementById("userCreationDate").innerHTML = userCreationDate; + document.querySelector("input#userNameAcess").value = userName; + document.getElementById("userEmail").value = userEmail; + } else { console.error("Falha ao decodificar o token."); } } else { console.error("Token não encontrado no localStorage."); } -}); \ No newline at end of file +}); diff --git a/Astro/src/main/resources/static/js/playlist.js b/Astro/src/main/resources/static/js/playlist.js index 6ad3d11..6823ae2 100644 --- a/Astro/src/main/resources/static/js/playlist.js +++ b/Astro/src/main/resources/static/js/playlist.js @@ -73,13 +73,10 @@ const displayPlaylistData = (playlistData) => { playlistImage.alt = playlistData.name; playlistImage.classList.add("album-image"); - const playlistTitleNav = document.getElementById("albumTitleNav"); - playlistTitleNav.textContent = playlistData.name; - const playlistTitle = document.getElementById("albumTitleElement"); - playlistTitle.textContent = playlistData.name; + document.getElementById("playlistName").innerHTML = playlistData.name const playlistOwner = document.getElementById("albumArtistElement"); - playlistOwner.textContent = playlistData.owner.display_name; - playlistOwner.href = `user.html?username=${playlistData.name}`; + playlistOwner.innerHTML = playlistData.owner.display_name + playlistOwner.href = `user?id=${playlistData.id}`; // Criar a lista de faixas const trackList = document.createElement("ul"); @@ -132,7 +129,7 @@ const displayPlaylistData = (playlistData) => { const trackArtists = document.createElement("a"); trackArtists.classList.add("montserrat-regular"); - trackArtists.href = `artist.html?id=${track.artists[0].id}`; + trackArtists.href = `/artist?id=${track.artists[0].id}`; let artistNames = track.artists[0].name; if (track.artists.length > 1) { for (let i = 1; i < track.artists.length; i++) { diff --git a/Astro/src/main/resources/static/js/search/search.js b/Astro/src/main/resources/static/js/search/search.js index 950338d..363da8d 100644 --- a/Astro/src/main/resources/static/js/search/search.js +++ b/Astro/src/main/resources/static/js/search/search.js @@ -1,82 +1,98 @@ const searchArtists = async (query) => { - try { - const response = await fetch(`/api/spotify/search?query=${encodeURIComponent(query)}`); - if (!response.ok) { - throw new Error("Network response was not ok"); - } - const data = await response.json(); - exibirResultados(data); - } catch (error) { - console.error("Erro ao buscar dados da API Spotify", error); + try { + const response = await fetch( + `/api/spotify/search?query=${encodeURIComponent(query)}` + ); + if (!response.ok) { + throw new Error("Network response was not ok"); } - }; + const data = await response.json(); + exibirResultados(data); + } catch (error) { + console.error("Erro ao buscar dados da API Spotify", error); + } +}; - const exibirResultados = (data) => { - const listaArtistas = document.getElementById("lista-artistas"); - const listaMusicas = document.getElementById("lista-musicas"); - const listaPlaylists = document.getElementById("lista-playlists"); +const exibirResultados = (data) => { + const listaArtistas = document.getElementById("lista-artistas"); + const listaMusicas = document.getElementById("lista-musicas"); + const listaPlaylists = document.getElementById("lista-playlists"); - listaArtistas.innerHTML = ""; // Limpa a lista de artistas - listaMusicas.innerHTML = ""; // Limpa a lista de músicas - listaPlaylists.innerHTML = ""; // Limpa a lista de playlists + listaArtistas.innerHTML = ""; // Limpa a lista de artistas + listaMusicas.innerHTML = ""; // Limpa a lista de músicas + listaPlaylists.innerHTML = ""; // Limpa a lista de playlists - // Exibir artistas - if (data.artists && data.artists.items.length > 0) { - data.artists.items.forEach(artista => { - const item = document.createElement('a'); - item.href = `./artist?id=${artista.id}` - item.classList.add("track-item") - const imagemUrl = artista.images.length > 0 ? artista.images[0].url : 'https://via.placeholder.com/50'; - item.innerHTML = ` + // Exibir artistas + if (data.artists && data.artists.items.length > 0) { + data.artists.items.forEach((artista) => { + const item = document.createElement("a"); + item.href = `./artist?id=${artista.id}`; + item.classList.add("track-item"); + const imagemUrl = + artista.images.length > 0 + ? artista.images[0].url + : "https://via.placeholder.com/50"; + item.innerHTML = ` ${artista.name}

${artista.name}

`; - listaArtistas.appendChild(item); - }); - } + listaArtistas.appendChild(item); + }); + } - // Exibir músicas - if (data.tracks && data.tracks.items.length > 0) { - data.tracks.items.forEach(musica => { - const item = document.createElement('div'); - item.classList.add("track-item") - const imagemUrl = musica.album.images.length > 0 ? musica.album.images[0].url : 'https://via.placeholder.com/50'; - item.innerHTML = ` - ${musica.name} -
-

${musica.name}

-

${musica.name}

-
- `; - listaMusicas.appendChild(item); - }); - } + // Exibir músicas + if (data.tracks && data.tracks.items.length > 0) { + data.tracks.items.forEach((musica) => { + const item = document.createElement("div"); + item.classList.add("track-item"); + const imagemUrl = + musica.album.images.length > 0 + ? musica.album.images[0].url + : "https://via.placeholder.com/50"; - // Exibir playlists - if (data.playlists && data.playlists.items.length > 0) { - data.playlists.items.forEach(playlist => { - const item = document.createElement('a'); - item.href = `/playlist?id=${playlist.id}` - item.classList.add("track-item") - const imagemUrl = playlist.images.length > 0 ? playlist.images[0].url : 'https://via.placeholder.com/50'; - item.innerHTML = ` + // Mapear os nomes dos artistas + const artistas = musica.artists.map((artista) => artista.name).join(", "); + + item.innerHTML = ` + ${musica.name} +
+

${musica.name}

+

${artistas}

+
+ `; + listaMusicas.appendChild(item); + }); + } + + // Exibir playlists + if (data.playlists && data.playlists.items.length > 0) { + data.playlists.items.forEach((playlist) => { + const item = document.createElement("a"); + item.href = `/playlist?id=${playlist.id}`; + item.classList.add("track-item"); + const imagemUrl = + playlist.images.length > 0 + ? playlist.images[0].url + : "https://via.placeholder.com/50"; + item.innerHTML = ` ${playlist.name}

${playlist.name}

Criado por: ${playlist.owner.display_name}

`; - listaPlaylists.appendChild(item); - }); - } - }; + listaPlaylists.appendChild(item); + }); + } +}; - // Listener para a barra de busca - document.querySelector('#search').addEventListener('input', (event) => { - const query = event.target.value; - if (query.length > 2) { // Apenas busca se o tamanho for maior que 2 - searchArtists(query); - } - }); \ No newline at end of file +// Listener para a barra de busca +document.querySelector("#search").addEventListener("input", (event) => { + const query = event.target.value; + if (query.length > 2) { + // Apenas busca se o tamanho for maior que 2 + searchArtists(query); + } +}); diff --git a/Astro/src/main/resources/static/js/swipe.js b/Astro/src/main/resources/static/js/swipe.js index 424b0a5..0c461a6 100644 --- a/Astro/src/main/resources/static/js/swipe.js +++ b/Astro/src/main/resources/static/js/swipe.js @@ -3,12 +3,34 @@ document.addEventListener("DOMContentLoaded", function () { swipers.forEach((swiperContainer) => { const swiper = new Swiper(swiperContainer, { - slidesPerView: 7, + slidesPerView: 7, // Valor padrão para telas maiores spaceBetween: 10, navigation: { nextEl: swiperContainer.querySelector(".swiper-button-next"), prevEl: swiperContainer.querySelector(".swiper-button-prev"), }, + breakpoints: { + 320: { + slidesPerView: 2, // Para telas muito pequenas + spaceBetween: 10, + }, + 420: { + slidesPerView: 3, // Para telas pequenas + spaceBetween: 10, + }, + 550: { + slidesPerView: 4, // Para tablets + spaceBetween: 10, + }, + 1024: { + slidesPerView: 6, // Para laptops + spaceBetween: 10, + }, + 1440: { + slidesPerView: 7, // Para telas grandes + spaceBetween: 10, + }, + }, }); }); -}); \ No newline at end of file +}); diff --git a/Astro/src/main/resources/static/js/theme.js b/Astro/src/main/resources/static/js/theme.js new file mode 100644 index 0000000..55fd200 --- /dev/null +++ b/Astro/src/main/resources/static/js/theme.js @@ -0,0 +1,7 @@ +document.addEventListener("DOMContentLoaded", () => { + const rootElement = document.documentElement; + const theme = localStorage.getItem("theme"); // Obtendo o tema armazenado + if (theme) { + rootElement.classList.add(theme); // Adicionando a classe com o tema armazenado + } +}); \ No newline at end of file diff --git a/Astro/src/main/resources/static/js/token.js b/Astro/src/main/resources/static/js/token.js index 491e794..58b637c 100644 --- a/Astro/src/main/resources/static/js/token.js +++ b/Astro/src/main/resources/static/js/token.js @@ -26,9 +26,9 @@ document.addEventListener('DOMContentLoaded', addTokenToLinks); // Função para logout (chamada pelo botão de logout) function logout() { + window.confirm("Você realmente quer sair?") localStorage.removeItem('authToken'); // Remove o token do armazenamento local + localStorage.removeItem('theme') + localStorage.removeItem('driveInitialized') window.location.href = '/login'; // Redireciona para a página de login -} - -// Adiciona o evento de logout ao botão de logout -document.getElementById('logoutBtn').addEventListener('click', logout); +} \ No newline at end of file diff --git a/Astro/src/main/resources/static/js/userInfo.js b/Astro/src/main/resources/static/js/userInfo.js new file mode 100644 index 0000000..2a46f5b --- /dev/null +++ b/Astro/src/main/resources/static/js/userInfo.js @@ -0,0 +1,27 @@ +const rootElement = document.documentElement; + +document.getElementById("defaultTheme").addEventListener("click", () => { + changeTheme(); +}); + +document.getElementById("lightMode").addEventListener("click", () => { + changeTheme("light"); +}); + +document.getElementById("darkMode").addEventListener("click", () => { + changeTheme("dark"); +}); + +document.getElementById("oceanMode").addEventListener("click", () => { + changeTheme("ocean"); +}); + +document.getElementById("fireMode").addEventListener("click", () => { + changeTheme("fire"); +}); + +function changeTheme(themeClass) { + rootElement.className = ""; // Remove all previous classes + rootElement.classList.add(themeClass); // Add the new theme class + localStorage.setItem("theme", themeClass) +} diff --git a/Astro/src/main/resources/templates/404.html b/Astro/src/main/resources/templates/404.html index 4fe1f16..c799e26 100644 --- a/Astro/src/main/resources/templates/404.html +++ b/Astro/src/main/resources/templates/404.html @@ -1,13 +1,13 @@ - + Erro - - - - + + + + diff --git a/Astro/src/main/resources/templates/album.html b/Astro/src/main/resources/templates/album.html index fd1437b..537b2a5 100644 --- a/Astro/src/main/resources/templates/album.html +++ b/Astro/src/main/resources/templates/album.html @@ -50,106 +50,6 @@ -
- -
-
- -
-
- Song_Image -
-
- Título da Música - Artista -
-
- - -
- - - - - -
- - - - - -
- 0:00 -
-
-
- 0:00 -
- - -
- -
-
-
-
@@ -200,13 +100,15 @@
- - - + + + + + + - diff --git a/Astro/src/main/resources/templates/artist.html b/Astro/src/main/resources/templates/artist.html index afe0b00..c125236 100644 --- a/Astro/src/main/resources/templates/artist.html +++ b/Astro/src/main/resources/templates/artist.html @@ -1,12 +1,13 @@ - + Astro - - - + + + + - -
-
- -
-
- Song_Image -
-
- Título da Música - Artista -
-
- - -
- - - - - -
- - - - - -
- 0:00 -
-
-
- 0:00 -
- - -
- volume_up -
- -
-
-
-
- - - - - + + + + + + + + diff --git a/Astro/src/main/resources/templates/busca.html b/Astro/src/main/resources/templates/busca.html index 2f3c362..ede29fe 100644 --- a/Astro/src/main/resources/templates/busca.html +++ b/Astro/src/main/resources/templates/busca.html @@ -1,5 +1,5 @@ - + @@ -39,97 +39,18 @@ href="https://unpkg.com/swiper/swiper-bundle.min.css" /> - + - - - + + + + -
-
- -
-
- Song_Image -
-
- Título da Música - Artista -
-
- - -
- - - - - -
- - - - - -
- 0:00 -
-
-
- 0:00 -
- - -
- -
-
-
- - -
- - + + + + + diff --git a/Astro/src/main/resources/templates/error.html b/Astro/src/main/resources/templates/error.html index d2bacfe..873470b 100644 --- a/Astro/src/main/resources/templates/error.html +++ b/Astro/src/main/resources/templates/error.html @@ -1,12 +1,13 @@ - + Erro - - - + + + + diff --git a/Astro/src/main/resources/templates/home.html b/Astro/src/main/resources/templates/home.html index 077049d..936f460 100644 --- a/Astro/src/main/resources/templates/home.html +++ b/Astro/src/main/resources/templates/home.html @@ -1,5 +1,5 @@ - + @@ -60,89 +60,6 @@ - - - -
-
- -
-
- Song_Image -
-
- Título da Música - Artista -
-
- - -
- - - - - -
- - - - - -
- 0:00 -
-
-
- 0:00 -
- - -
- volume_up -
- -
-
-
-
@@ -190,19 +107,14 @@

Pop

+ + + + - - + - - diff --git a/Astro/src/main/resources/templates/index.html b/Astro/src/main/resources/templates/index.html index 320d67f..78098d9 100644 --- a/Astro/src/main/resources/templates/index.html +++ b/Astro/src/main/resources/templates/index.html @@ -1,20 +1,38 @@ - + Astro - - - + + + + - + @@ -25,7 +43,9 @@
- + - diff --git a/Astro/src/main/resources/templates/login.html b/Astro/src/main/resources/templates/login.html index 2bd1e90..c4ef3ee 100644 --- a/Astro/src/main/resources/templates/login.html +++ b/Astro/src/main/resources/templates/login.html @@ -3,14 +3,14 @@ + + + + - + - - - - Entrar + -
diff --git a/Astro/src/main/resources/templates/planos.html b/Astro/src/main/resources/templates/plano.html similarity index 99% rename from Astro/src/main/resources/templates/planos.html rename to Astro/src/main/resources/templates/plano.html index 7f607b8..ac59056 100644 --- a/Astro/src/main/resources/templates/planos.html +++ b/Astro/src/main/resources/templates/plano.html @@ -1,5 +1,5 @@ - + diff --git a/Astro/src/main/resources/templates/playlist.html b/Astro/src/main/resources/templates/playlist.html index 6b199b4..5605a6c 100644 --- a/Astro/src/main/resources/templates/playlist.html +++ b/Astro/src/main/resources/templates/playlist.html @@ -51,106 +51,6 @@ - - -
-
- -
-
- Song_Image -
-
- Título da Música - Artista -
-
- - -
- - - - - -
- - - - - -
- 0:00 -
-
-
- 0:00 -
- - -
- -
-
-
-
@@ -169,7 +69,7 @@

▬▬▬▬▬▬

@@ -202,12 +102,16 @@
- - - + + + + + + + - + diff --git a/Astro/src/main/resources/templates/setting.html b/Astro/src/main/resources/templates/setting.html index e69de29..3505cae 100644 --- a/Astro/src/main/resources/templates/setting.html +++ b/Astro/src/main/resources/templates/setting.html @@ -0,0 +1,147 @@ + + + + + + + + + + Astro - username + + + + + + + + + + + + + + + + + + +
+
+
+

User

+ +
+ Voltar +
+
+
+ User_Image +
+
+ +
+
+

Geral

+
+ + +
+
+ + +
+
+ + +
+
+
+

Temas

+
+
+ +

Astro

+
+
+ +

Light Mode

+
+
+ +

Dark Mode

+
+
+ +

Fire Mode

+
+
+ +

Ocean Mode

+
+
+
+
+
+ + + + + + + + + + + + \ No newline at end of file diff --git a/Astro/src/main/resources/templates/sign.html b/Astro/src/main/resources/templates/sign.html index 8dbe715..154161f 100644 --- a/Astro/src/main/resources/templates/sign.html +++ b/Astro/src/main/resources/templates/sign.html @@ -1,14 +1,14 @@ - + - - - - + + + + Cadastrar -

+

Concordo com os termos da plataforma

+ - -
diff --git a/Astro/src/main/resources/templates/user.html b/Astro/src/main/resources/templates/user.html index 674509b..044fbbf 100644 --- a/Astro/src/main/resources/templates/user.html +++ b/Astro/src/main/resources/templates/user.html @@ -1,5 +1,5 @@ - + Astro - username - - - + + + + - -
-
- -
-
- Song_Image -
-
- Título da Música - Artista -
-
- - -
- - - - - -
- - - - - -
- 0:00 -
-
-
- 0:00 -
- - -
- volume_up -
- -
-
-
-

+
-
- 000 -
- 000 -
- + Editar
@@ -149,12 +60,12 @@

id="userImage" class="user-image" alt="User_Image" - src="https://placehold.co/250x250" + src="/images/placeholder.png" />
-
+
- - - - - - + + + + + + + + +