Skip to content

Commit

Permalink
Parte da saudação(greeting) adicionada
Browse files Browse the repository at this point in the history
Parte da saudação(greeting) adicionada na parte do script.js
  • Loading branch information
lucasvalgoi committed Jan 30, 2024
1 parent 29851d0 commit e0e3396
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 2 deletions.
2 changes: 1 addition & 1 deletion index.html
Original file line number Diff line number Diff line change
Expand Up @@ -97,7 +97,7 @@
<div class="playlist-container">
<div id="result-playlists">
<div class="playlist">
<h1 class="greeting">Boa Tarde</h1>
<h1 id="greeting"></h1>
<h2 class="session">Navegar por todas as seções</h2>
</div>

Expand Down
14 changes: 14 additions & 0 deletions script.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,17 @@
// PARTE DO GREETING //
const greetingElement = document.getElementById("greeting");
const currentHour = new Date().getHours();

if (currentHour >= 5 && currentHour < 12) {
greetingElement.textContent = "Bom Dia!";
} else if (currentHour >= 12 && currentHour < 18) {
greetingElement.textContent = "Boa Tarde!";
} else {
greetingElement.textContent = "Boa noite!"
}


// PARTE DO SEARCH //
const searchInput = document.getElementById('search-input');
const resultArtist = document.getElementById('result-artist');
const resultPlaylist = document.getElementById('result-playlists');
Expand Down
2 changes: 1 addition & 1 deletion src/styles/main-content.css
Original file line number Diff line number Diff line change
Expand Up @@ -105,7 +105,7 @@
margin: 24px;
}

.playlist .greeting {
.playlist #greeting {
color: #fff;
font-size: 32px;
font-weight: 700;
Expand Down

0 comments on commit e0e3396

Please sign in to comment.