Add some a11y to the mix
All checks were successful
continuous-integration/drone/push Build is passing

This commit is contained in:
2020-04-06 13:37:43 +02:00
parent 6561b24f75
commit 11e06c51c9
8 changed files with 40 additions and 33 deletions

View File

@@ -61,7 +61,7 @@
}) })
</script> </script>
<div class="toggle" bind:this={toggleEl}> <div class="toggle" role="switch" bind:this={toggleEl}>
<button data-layout="list" class:active={layoutSetting === 'list'} on:click={toggleLayout}> <button data-layout="list" class:active={layoutSetting === 'list'} on:click={toggleLayout}>
<svg xmlns="http://www.w3.org/2000/svg" width="19" height="17" viewBox="0 0 19 17"> <svg xmlns="http://www.w3.org/2000/svg" width="19" height="17" viewBox="0 0 19 17">
<g class="anim"> <g class="anim">

View File

@@ -6,7 +6,7 @@
const { name, slug, country } = location const { name, slug, country } = location
</script> </script>
<div class="location"> <div class="location" role="listitem">
<a href="/location/{country.slug}/{slug}" rel="prefetch" sapper-noscroll> <a href="/location/{country.slug}/{slug}" rel="prefetch" sapper-noscroll>
<img src={country.flag.full_url} alt="Flag of {country.name}"> <img src={country.flag.full_url} alt="Flag of {country.name}">
<div class="anim-mask mask-city"> <div class="anim-mask mask-city">

View File

@@ -33,10 +33,10 @@
}) })
</script> </script>
<div class="photo" bind:this={scope}> <div class="photo" role="figure" aria-labelledby="photo-{index + 1}" bind:this={scope}>
<div class="photo__location wrap"> <div class="photo__location wrap">
<div class="wrapper"> <div class="wrapper">
<h2 class="title-location"> <h2 class="title-location" id="photo-{index + 1}">
{#each name.split(', ') as line, i} {#each name.split(', ') as line, i}
<span class="line"> <span class="line">
<span>{name.split(', ')[i]},</span> <span>{name.split(', ')[i]},</span>

View File

@@ -172,6 +172,9 @@
class:is-active={id === currentPhoto.id} class:is-active={id === currentPhoto.id}
class:is-next={id === nextPhoto.id} class:is-next={id === nextPhoto.id}
on:click={openFullscreen} on:click={openFullscreen}
role="group"
aria-roledescription="slide"
aria-label="Photo {index + 1} of {photos.length}"
> >
<picture class="gallery__picture"> <picture class="gallery__picture">
<source media="(min-width: 968px)" data-srcset={getThumbnail(image.private_hash, 1200)}> <source media="(min-width: 968px)" data-srcset={getThumbnail(image.private_hash, 1200)}>

View File

@@ -13,7 +13,8 @@
<Switcher radius="30" /> <Switcher radius="30" />
</div> </div>
<ul class="footer__right"> <nav class="footer__right" >
<ul>
<li> <li>
<ul> <ul>
<li> <li>
@@ -36,5 +37,6 @@
</a> </a>
</li> </li>
</ul> </ul>
</nav>
</div> </div>
</footer> </footer>

View File

@@ -58,7 +58,7 @@
{/each} {/each}
</ul> </ul>
<div class="browse__locations" id="locations_list" bind:this={list}> <div class="browse__locations" id="locations_list" role="list" bind:this={list}>
{#each filteredLocations as location (location.id)} {#each filteredLocations as location (location.id)}
<div animate:flip="{{ duration: transitionDuration }}" <div animate:flip="{{ duration: transitionDuration }}"
in:receive="{{ key: location.id }}" in:receive="{{ key: location.id }}"

View File

@@ -106,7 +106,7 @@
</section> </section>
<section class="explore explore--homepage"> <section class="explore explore--homepage">
<div class="of" id="title-of" aria-label="of"> <div class="of" id="title-of" role="heading" aria-level="2" aria-label="of">
<div class="anim-mask"> <div class="anim-mask">
{@html charsToSpan('of')} {@html charsToSpan('of')}
</div> </div>

View File

@@ -35,11 +35,13 @@
font-size: 14px; font-size: 14px;
text-align: center; text-align: center;
& > ul {
@include breakpoint (sm) { @include breakpoint (sm) {
display: flex; display: flex;
align-items: center; align-items: center;
padding-top: 6px; padding-top: 6px;
} }
}
li { li {
display: block; display: block;