No CSS foi definido as cores do gradiente da variável de descanso longo
[data-contexto="foco"] {
--main-bg-color: linear-gradient(180deg, #8B1FF8 0%, #041832 48.44%, #01080E 100%);
}
[data-contexto="descanso-curto"] {
--main-bg-color: linear-gradient(180deg, #0F725C 0%, #041832 48.44%, #01080E 100%);
}
[data-contexto="descanso-longo"] {
--main-bg-color: linear-gradient(180deg, #1875E9 0%, #01080E 48.44%, #0858a3 100%);
}
Logo após ela é referenciada ao clicar no botão de descanso longo
const html = document.querySelector('html');
const focoBt = document.querySelector('.app__card-button--foco');
const curtoBt = document.querySelector('.app__card-button--curto');
const longoBt = document.querySelector('.app__card-button--longo');
focoBt.addEventListener('click', () => {
html.setAttribute('data-contexto','foco')
})
focoBt.addEventListener('click', () => {
html.setAttribute('data-contexto','foco')
})
curtoBt.addEventListener('click', () => {
html.setAttribute('data-contexto','descanso-curto')
})
longoBt.addEventListener('click', () => {
html.setAttribute('data-contexto','descanso-longo')
})