Skip to content

Commit

Permalink
feat (accessibility) : get focus on elements (#6)
Browse files Browse the repository at this point in the history
  • Loading branch information
codexarama committed May 13, 2021
1 parent 8e3e80e commit a13df56
Show file tree
Hide file tree
Showing 8 changed files with 44 additions and 19 deletions.
11 changes: 7 additions & 4 deletions css/styles.css

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

9 changes: 5 additions & 4 deletions js/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -23,17 +23,18 @@ const setCard = (photographer) => {
elmtFactory('img', {
src: 'images/portraits/' + `${photographer.portrait}`,
alt: `${photographer.name}`,
tabindex: '0'
})
),
elmtFactory('h2', { class: 'card__name' }, `${photographer.name}`)
elmtFactory('h2', { class: 'card__name', tabindex: '0' }, `${photographer.name}`)
),
elmtFactory(
'p',
{ class: 'card__location' },
{ class: 'card__location', tabindex: '0' },
`${photographer.city}` + ', ' + `${photographer.country}`
),
elmtFactory('p', { class: 'card__tagline' }, `${photographer.tagline}`),
elmtFactory('p', { class: 'card__price' }, `${photographer.price}` + '€'),
elmtFactory('p', { class: 'card__tagline', tabindex: '0' }, `${photographer.tagline}`),
elmtFactory('p', { class: 'card__price', tabindex: '0' }, `${photographer.price}` + '€'),
elmtFactory('ul', { class: 'tags' })
);

Expand Down
21 changes: 17 additions & 4 deletions js/profile.js
Original file line number Diff line number Diff line change
Expand Up @@ -13,14 +13,26 @@ const setId = (photographer) => {
elmtFactory(
'div',
{ class: 'id__infos' },
elmtFactory('h2', { class: 'card__name' }, `${photographer.name}`),
elmtFactory(
'h2',
{ class: 'card__name', tabindex: '0' },
`${photographer.name}`
),
elmtFactory(
'p',
{ class: 'card__location' },
{ class: 'card__location', tabindex: '0' },
`${photographer.city}` + ', ' + `${photographer.country}`
),
elmtFactory('p', { class: 'card__tagline' }, `${photographer.tagline}`),
elmtFactory('p', { class: 'card__price' }, `${photographer.price}` + '€'),
elmtFactory(
'p',
{ class: 'card__tagline', tabindex: '0' },
`${photographer.tagline}`
),
elmtFactory(
'p',
{ class: 'card__price', tabindex: '0' },
`${photographer.price}` + '€'
),
elmtFactory('ul', { class: 'tags' })
),
elmtFactory('div', { class: 'id__contact' }),
Expand All @@ -30,6 +42,7 @@ const setId = (photographer) => {
elmtFactory('img', {
src: 'images/portraits/' + `${photographer.portrait}`,
alt: `${photographer.name}`,
tabindex: '0',
})
)
);
Expand Down
5 changes: 4 additions & 1 deletion propage.html
Original file line number Diff line number Diff line change
Expand Up @@ -49,24 +49,27 @@
</button>
<i class="fas fa-chevron-down filter__arrow"></i>
<ul
tabindex="0"
tabindex="-1"
role="listbox"
aria-labelledby="orderBy"
class="filter__options">
<li
tabindex="0"
role='option'
id="Popularité"
aria-selected="true"
class="filter__option filter__option--1 selected">
Popularité
</li>
<li
tabindex="-1"
role='option'
id="Date"
class="filter__option filter__option--2">
Date
</li>
<li
tabindex="-1"
role='option'
id="Titre"
class="filter__option filter__option--3">
Expand Down
3 changes: 2 additions & 1 deletion sass/layout/_card.scss
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,8 @@
object-fit: cover;
transition: all 0.5s ease;

&:hover {
&:hover,
&:focus {
transform: scale(1.25);
transform-origin: 50% 50%;
}
Expand Down
8 changes: 6 additions & 2 deletions sass/layout/_gallery.scss
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,8 @@
object-fit: cover;
transition: all 0.5s ease;

&:hover {
&:hover,
&:focus {
transform: scale(1.25);
transform-origin: 50% 50%;
}
Expand All @@ -45,7 +46,10 @@
}

&__title {
width: 100%;
width: 88%;
white-space: nowrap;
overflow: hidden;
text-overflow: ellipsis;
}

&__likes {
Expand Down
1 change: 0 additions & 1 deletion sass/layout/_nav.scss
Original file line number Diff line number Diff line change
Expand Up @@ -22,5 +22,4 @@
outline: none;
box-shadow: 0 0 0 2px white, 0 0 0 3px $primaire-bg;
}

}
5 changes: 3 additions & 2 deletions sass/layout/_profile.scss
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,8 @@
object-fit: cover;
transition: all 0.5s ease;

&:hover {
&:hover,
&:focus {
transform: scale(1.25);
transform-origin: 50% 50%;
}
Expand All @@ -46,7 +47,7 @@
margin-left: 10px;
width: 70%;
}

&__contact {
margin-top: 10px;
position: fixed;
Expand Down

0 comments on commit a13df56

Please sign in to comment.