Skip to content

Commit

Permalink
feat(accessibility): larger touch zones (#106)
Browse files Browse the repository at this point in the history
  • Loading branch information
azarz committed Jul 24, 2024
1 parent 6ca0e41 commit a4803f5
Show file tree
Hide file tree
Showing 4 changed files with 24 additions and 24 deletions.
31 changes: 17 additions & 14 deletions src/css/map-buttons.css
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@
box-shadow: 0px 0px 10px rgba(0, 0, 0, 0.25);
z-index: 200;
border: 1px solid white;
padding: 3px;
}

#backTopLeftBtn {
Expand All @@ -18,6 +19,7 @@
left: calc(15px + var(--safe-area-inset-left));
background-image: url("assets/map-buttons/back.svg");
z-index: 3003;
padding: 0;
}

#bottomButtons {
Expand All @@ -30,7 +32,7 @@
#layerManagerBtn {
background-image: url("assets/map-buttons/layers.svg");
position: absolute;
bottom: 50px;
bottom: 56px;
}

#layerManagerBtn.active {
Expand All @@ -50,32 +52,34 @@
position: absolute;
left: 15px;
bottom: 0;
background-size: 70px;
}

#sideBySideRightLayer {
background-image: url("assets/map-buttons/compare/compare-layer-right.svg");
position: absolute;
right: 15px;
bottom: 0;
background-size: 70px;
}

#compareMode {
position: fixed;
top: calc(10px + var(--safe-area-inset-top));
right: calc(15px + var(--safe-area-inset-left));
width: 120px;
height: 40px;
width: 150px;
height: 50px;
display: flex;
flex-direction: row;
z-index: 2;
}

#compareMode > div {
width: 40px;
height: 40px;
width: 50px;
height: 50px;
background-position: center;
background-repeat: no-repeat;
background-size: 40px;
background-size: 50px;
filter: grayscale(1);
}

Expand Down Expand Up @@ -124,7 +128,7 @@
#compassBtn {
background-image: url("assets/map-buttons/compass.svg");
position: absolute;
bottom: 100px;
bottom: 112px;
}

#filterPoiBtn {
Expand All @@ -139,6 +143,7 @@
background-position: 13px center;
width: 70px;
transition: top 0.15s, transform 0.5s;
font-size: 14px;
}

#interactivityBtn {
Expand All @@ -150,8 +155,8 @@
overflow: hidden;
background-color: #fff0;
border-radius: 31px;
width: 54px;
height: 54px;
width: 60px;
height: 60px;
font-family: "Open Sans Semibold";
display: flex;
align-items: center;
Expand All @@ -176,9 +181,8 @@
}

#routeDrawMode {
width: 135px;
width: 145px;
justify-content: space-between;
font-size: 11px;
position: relative;
}

Expand Down Expand Up @@ -223,8 +227,6 @@

#routeDrawHelp {
background-color: var(--dark-green);
width: 34px;
height: 34px;
color: white;
border: unset;
justify-content: center;
Expand All @@ -237,6 +239,7 @@
font-family: "Open Sans Semibold";
margin-right: 6px;
right: unset;
font-size: 13px;
}

#routeDrawEdit {
Expand Down Expand Up @@ -306,7 +309,7 @@

#routeDrawEdit > .button > span {
position: absolute;
bottom: 10px;
bottom: 6px;
width: 42px;
display: flex;
justify-content: center;
Expand Down
2 changes: 1 addition & 1 deletion src/css/map.css
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
}

#bottomButtons > .maplibregl-control-container > .maplibregl-ctrl-bottom-left {
bottom: 50px;
bottom: 56px;
}

#routeDrawBtns.d-none + .maplibregl-control-container > .maplibregl-ctrl-bottom-left {
Expand Down
11 changes: 6 additions & 5 deletions src/css/nav.css
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
height: 60px ;
font-size: 12px;
background-color: white;
padding: 10px 0px max(calc(var(--safe-area-inset-bottom) - 10px - var(--nav-bar-height)), 0px) 0px;
padding: 8px 0px max(calc(var(--safe-area-inset-bottom) - 10px - var(--nav-bar-height)), 0px) 0px;
z-index: 3002;
flex-direction: row;
align-items: center;
Expand Down Expand Up @@ -39,9 +39,10 @@

.navitembtn > div {
margin-bottom: 5px;
height: 42px;
width: 42px;
flex-shrink: 0
height: 48px;
width: 48px;
flex-shrink: 0;
background-size: 48px;
}

.navbar.hoverable:focus-within > .navitembtn,
Expand Down Expand Up @@ -95,7 +96,7 @@
.subnav {
position: absolute;
background-color: var(--false-white);
bottom: calc(70px + max(calc(var(--safe-area-inset-bottom) - 10px - var(--nav-bar-height)), 0px));
bottom: calc(68px + max(calc(var(--safe-area-inset-bottom) - 10px - var(--nav-bar-height)), 0px));
left: -100%;
transition: transform 0.2s;
transition-timing-function: ease-out;
Expand Down
4 changes: 0 additions & 4 deletions src/js/nav.js
Original file line number Diff line number Diff line change
Expand Up @@ -182,15 +182,13 @@ class MenuNavigation {
break;
case "compareLayers1":
DOM.$tabContainer.style.removeProperty("top");
DOM.$bottomButtons.style.removeProperty("bottom");
DOM.$compareLayers2Window.classList.add("d-none");
DOM.$compareLayers1Window.classList.remove("d-none");
DOM.$sideBySideLeftLayer.classList.add("d-none");
Globals.currentScrollIndex = 2;
break;
case "compareLayers2":
DOM.$tabContainer.style.removeProperty("top");
DOM.$bottomButtons.style.removeProperty("bottom");
DOM.$compareLayers1Window.classList.add("d-none");
DOM.$compareLayers2Window.classList.remove("d-none");
DOM.$sideBySideRightLayer.classList.add("d-none");
Expand Down Expand Up @@ -424,7 +422,6 @@ class MenuNavigation {
break;
case "compareLayers1":
DOM.$tabContainer.style.top = "100vh";
DOM.$bottomButtons.style.bottom = "calc(42px + var(--safe-area-inset-bottom))";
DOM.$compareLayers1Window.classList.add("d-none");
DOM.$sideBySideLeftLayer.classList.remove("d-none");
Globals.currentScrollIndex = 0;
Expand All @@ -433,7 +430,6 @@ class MenuNavigation {
break;
case "compareLayers2":
DOM.$tabContainer.style.top = "100vh";
DOM.$bottomButtons.style.bottom = "calc(42px + var(--safe-area-inset-bottom))";
DOM.$sideBySideLeftLayer.style.removeProperty("left");
DOM.$compareLayers2Window.classList.add("d-none");
DOM.$sideBySideRightLayer.classList.remove("d-none");
Expand Down

0 comments on commit a4803f5

Please sign in to comment.