-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Modificações funções para mudar tema da página e exibir galeria de im…
…agens da série
- Loading branch information
1 parent
a51d91a
commit b0996be
Showing
4 changed files
with
51 additions
and
31 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
function getImagesList() { | ||
return [ | ||
{ | ||
'img': 'assets/images/content/serie-image-01.png', | ||
'alt': 'Imagem de Vecna' | ||
}, | ||
{ | ||
'img': 'assets/images/content/serie-image-02.png', | ||
'alt': 'Imagem ilustrativa dos amigos de Eleven' | ||
}, | ||
{ | ||
'img': 'assets/images/content/serie-image-03.png', | ||
'alt': 'Imagem Eleven assustada' | ||
}, | ||
{ | ||
'img': 'assets/images/content/serie-image-03.png', | ||
'alt': 'Imagem Eleven assustada' | ||
} | ||
] | ||
} | ||
|
||
export function gallery(galleryImagelist) { | ||
const imgList = getImagesList(); | ||
|
||
galleryImagelist.innerHTML = imgList.map(img => ` | ||
<li class="gallery-image invert-element"> | ||
<img src="${img.img}" alt="${img.alt}"/> | ||
</li>` | ||
).join(''); | ||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,12 +1,14 @@ | ||
export function switchTheme() { | ||
document.body.classList.toggle('dark-theme'); | ||
document.body.classList.toggle('light-theme'); | ||
|
||
const theme = document.body.classList[0]; | ||
const music = theme === 'light-theme' ? 'normal-world.mpeg' : 'inverted-world.mpeg' | ||
|
||
const audio = document.getElementById('music'); | ||
audio.src = `assets/musics/${music}`; | ||
audio.play(); | ||
audio.volume = 0.2; | ||
} | ||
export function switchTheme(switchThemeButton) { | ||
switchThemeButton.addEventListener('click', () => { | ||
document.body.classList.toggle('dark-theme'); | ||
document.body.classList.toggle('light-theme'); | ||
|
||
const theme = document.body.classList[0]; | ||
const music = theme === 'light-theme' ? 'normal-world.mpeg' : 'inverted-world.mpeg' | ||
|
||
const audio = document.getElementById('music'); | ||
audio.src = `assets/musics/${music}`; | ||
audio.play(); | ||
audio.volume = 0.2; | ||
}); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters