Improving accessibility

This commit is contained in:
Liyas Thomas
2020-03-26 22:21:41 +05:30
parent ec7951bd93
commit 754a1d0f06
3 changed files with 162 additions and 170 deletions

View File

@@ -590,6 +590,7 @@ pre {
input {
text-transform: uppercase;
min-width: 128px;
}
.trigger {
@@ -690,8 +691,12 @@ ul li,
ol li {
display: inline-flex;
flex-flow: column nowrap;
flex-grow: 1;
flex: 1;
justify-content: center;
&.shrink {
flex-grow: 0;
}
}
.flex-wrap {
@@ -714,7 +719,7 @@ ol li {
}
.show-on-large-screen {
display: inline-flex;
display: flex;
flex: 1;
}
@@ -791,7 +796,7 @@ ol li {
z-index: 10001;
transform: translateX(-50%);
box-shadow: 0 4px 24px rgba(black, 0.2);
transition: all .2s ease-in-out;
transition: all 0.2s ease-in-out;
}
}

View File

@@ -1,20 +1,11 @@
<template>
<pw-section class="green" icon="history" :label="$t('history')" ref="history">
<ul>
<div class="show-on-large-screen">
<li id="filter-history">
<input
aria-label="Search"
type="search"
:placeholder="$t('search')"
v-model="filterText"
/>
</li>
<button class="icon">
<i class="material-icons">search</i>
</button>
</div>
</ul>
<div class="show-on-large-screen">
<input aria-label="Search" type="search" :placeholder="$t('search')" v-model="filterText" />
<button class="icon">
<i class="material-icons">search</i>
</button>
</div>
<virtual-list
class="virtual-list"
:class="{ filled: filteredHistory.length }"
@@ -354,9 +345,9 @@ export default {
fb.currentUser !== null
? fb.currentHistory
: JSON.parse(window.localStorage.getItem("history")) || []
return this.history.filter(entry => {
return this.history.filter((entry) => {
const filterText = this.filterText.toLowerCase()
return Object.keys(entry).some(key => {
return Object.keys(entry).some((key) => {
let value = entry[key]
value = typeof value !== "string" ? value.toString() : value
return value.toLowerCase().includes(filterText)

View File

@@ -37,145 +37,143 @@
<pw-section class="blue" :label="$t('request')" ref="request">
<ul>
<div>
<li>
<label for="method">{{ $t("method") }}</label>
<span class="select-wrapper">
<v-popover>
<input
id="method"
class="method"
v-if="!customMethod"
v-model="method"
readonly
/>
<input v-else v-model="method" placeholder="CUSTOM" />
<template slot="popover">
<div>
<button
class="icon"
@click="
customMethod = false
method = 'GET'
"
v-close-popover
>
GET
</button>
</div>
<div>
<button
class="icon"
@click="
customMethod = false
method = 'HEAD'
"
v-close-popover
>
HEAD
</button>
</div>
<div>
<button
class="icon"
@click="
customMethod = false
method = 'POST'
"
v-close-popover
>
POST
</button>
</div>
<div>
<button
class="icon"
@click="
customMethod = false
method = 'PUT'
"
v-close-popover
>
PUT
</button>
</div>
<div>
<button
class="icon"
@click="
customMethod = false
method = 'DELETE'
"
v-close-popover
>
DELETE
</button>
</div>
<div>
<button
class="icon"
@click="
customMethod = false
method = 'CONNECT'
"
v-close-popover
>
CONNECT
</button>
</div>
<div>
<button
class="icon"
@click="
customMethod = false
method = 'OPTIONS'
"
v-close-popover
>
OPTIONS
</button>
</div>
<div>
<button
class="icon"
@click="
customMethod = false
method = 'TRACE'
"
v-close-popover
>
TRACE
</button>
</div>
<div>
<button
class="icon"
@click="
customMethod = false
method = 'PATCH'
"
v-close-popover
>
PATCH
</button>
</div>
<div>
<button
class="icon"
@click="
customMethod = true
method = 'CUSTOM'
"
v-close-popover
>
CUSTOM
</button>
</div>
</template>
</v-popover>
</span>
</li>
</div>
<li class="shrink">
<label for="method">{{ $t("method") }}</label>
<span class="select-wrapper">
<v-popover>
<input
id="method"
class="method"
v-if="!customMethod"
v-model="method"
readonly
/>
<input v-else v-model="method" placeholder="CUSTOM" />
<template slot="popover">
<div>
<button
class="icon"
@click="
customMethod = false
method = 'GET'
"
v-close-popover
>
GET
</button>
</div>
<div>
<button
class="icon"
@click="
customMethod = false
method = 'HEAD'
"
v-close-popover
>
HEAD
</button>
</div>
<div>
<button
class="icon"
@click="
customMethod = false
method = 'POST'
"
v-close-popover
>
POST
</button>
</div>
<div>
<button
class="icon"
@click="
customMethod = false
method = 'PUT'
"
v-close-popover
>
PUT
</button>
</div>
<div>
<button
class="icon"
@click="
customMethod = false
method = 'DELETE'
"
v-close-popover
>
DELETE
</button>
</div>
<div>
<button
class="icon"
@click="
customMethod = false
method = 'CONNECT'
"
v-close-popover
>
CONNECT
</button>
</div>
<div>
<button
class="icon"
@click="
customMethod = false
method = 'OPTIONS'
"
v-close-popover
>
OPTIONS
</button>
</div>
<div>
<button
class="icon"
@click="
customMethod = false
method = 'TRACE'
"
v-close-popover
>
TRACE
</button>
</div>
<div>
<button
class="icon"
@click="
customMethod = false
method = 'PATCH'
"
v-close-popover
>
PATCH
</button>
</div>
<div>
<button
class="icon"
@click="
customMethod = true
method = 'CUSTOM'
"
v-close-popover
>
CUSTOM
</button>
</div>
</template>
</v-popover>
</span>
</li>
<li>
<label for="url">{{ $t("url") }}</label>
<input
@@ -189,17 +187,15 @@
@input="pathInputHandler"
/>
</li>
<div>
<li>
<label class="hide-on-small-screen" for="send">&nbsp;</label>
<button :disabled="!isValidURL" @click="sendRequest" id="send" ref="sendButton">
{{ $t("send") }}
<span>
<i class="material-icons">send</i>
</span>
</button>
</li>
</div>
<li class="shrink">
<label class="hide-on-small-screen" for="send">&nbsp;</label>
<button :disabled="!isValidURL" @click="sendRequest" id="send" ref="sendButton">
{{ $t("send") }}
<span>
<i class="material-icons">send</i>
</span>
</button>
</li>
</ul>
<div class="blue">
<label for="label">{{ $t("label") }}</label>