-
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.
AAdicionando funcionalidades de tema e também de acessibilidade para tamanho de fonte
- Loading branch information
1 parent
388d2e9
commit ffa6ce7
Showing
14 changed files
with
251 additions
and
63 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
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,28 @@ | ||
.accessibility { | ||
grid-column: 2 / -2; | ||
display: flex; | ||
align-items: center; | ||
justify-content: center; | ||
gap: 1rem; | ||
|
||
padding: 1rem 0 ; | ||
} | ||
|
||
|
||
.accessibility-font-size { | ||
text-align: center; | ||
} | ||
|
||
.button-font-size { | ||
margin: 10px; | ||
padding: 10px; | ||
font-size: 1rem; | ||
cursor: pointer; | ||
} | ||
|
||
.accessibility-theme { | ||
display: flex; | ||
flex-direction: column; | ||
align-items: center; | ||
width: 30vw; | ||
} |
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
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 |
---|---|---|
@@ -0,0 +1,66 @@ | ||
.button-theme { | ||
width: 90px; | ||
height: 50px; | ||
background-color: var(--gray); | ||
border-radius: 25px; | ||
position: relative; | ||
cursor: pointer; | ||
|
||
z-index: 9800; | ||
} | ||
|
||
.button-theme .indicator { | ||
width: 50px; | ||
height: 50px; | ||
background-color: #ffffff; | ||
border-radius: 50%; | ||
transform: scale(.8); | ||
position: absolute; | ||
left: 0; | ||
transition: .5s; | ||
} | ||
|
||
.button-theme.dark { | ||
background-color: var(--mediumGray); | ||
} | ||
|
||
.button-theme.dark .indicator { | ||
left: 40px; | ||
background-color: var(--black); | ||
} | ||
|
||
body.dark { | ||
background-color: var(--darkGray); | ||
} | ||
|
||
body.dark .titulo { | ||
color: var(--white); | ||
} | ||
|
||
body.dark .subtitulo { | ||
color: var(--white); | ||
} | ||
|
||
body.dark .subtituloSecundario { | ||
color: var(--white); | ||
} | ||
|
||
body.dark .corpo { | ||
color: var(--white); | ||
} | ||
|
||
body.dark .descricao { | ||
color: var(--white); | ||
} | ||
|
||
header.dark { | ||
background-color: var(--darkCyan); | ||
} | ||
|
||
header.dark .navegacao-primaria { | ||
background-color: var(--darkCyan); | ||
} | ||
|
||
footer.dark { | ||
background-color: var(--darkCyan); | ||
} |
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
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,7 +1,9 @@ | ||
import { setupNav } from './modules/nav.js'; | ||
import { setupSlider } from './modules/slider.js'; | ||
import { setupTheme } from './modules/theme.js' | ||
import { setupFontSize } from './modules/fontSizeControl.js'; | ||
|
||
document.addEventListener('DOMContentLoaded', () => { | ||
document.addEventListener('DOMContentLoaded', function () { | ||
setupNav(); | ||
setupSlider(); | ||
setupTheme(); | ||
setupFontSize(); | ||
}); |
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,33 @@ | ||
export function setupFontSize() { | ||
const increaseFontBtn = document.getElementById('increase-font'); | ||
const decreaseFontBtn = document.getElementById('decrease-font'); | ||
const root = document.documentElement; | ||
|
||
let titleFontSize = parseFloat(getComputedStyle(root).getPropertyValue('--tamanhoGrande')); | ||
let subtitleFontSize = parseFloat(getComputedStyle(root).getPropertyValue('--tamanhoMedio')); | ||
let bodyFontSize = parseFloat(getComputedStyle(root).getPropertyValue('--tamanhoPequeno')); | ||
|
||
increaseFontBtn.addEventListener('click', function () { | ||
|
||
titleFontSize += 0.125; // Incrementa em 0.125rem (equivalente a 2px se a base for 16px) | ||
subtitleFontSize += 0.125; | ||
bodyFontSize += 0.125; | ||
|
||
root.style.setProperty('--tamanhoGrande', titleFontSize + 'rem'); | ||
root.style.setProperty('--tamanhoMedio', subtitleFontSize + 'rem'); | ||
root.style.setProperty('--tamanhoPequeno', bodyFontSize + 'rem'); | ||
}); | ||
|
||
decreaseFontBtn.addEventListener('click', function () { | ||
if (bodyFontSize > 0.625) { // Limite para não ficar menor que 10px (0.625rem se a base for 16px) | ||
titleFontSize -= 0.125; | ||
subtitleFontSize -= 0.125; | ||
bodyFontSize -= 0.125; | ||
|
||
root.style.setProperty('--tamanhoGrande', titleFontSize + 'rem'); | ||
root.style.setProperty('--tamanhoMedio', subtitleFontSize + 'rem'); | ||
root.style.setProperty('--tamanhoPequeno', bodyFontSize + 'rem'); | ||
} | ||
}); | ||
|
||
} |
Oops, something went wrong.