Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

optimize web accessbility #129

Merged
merged 1 commit into from
Apr 12, 2018
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion src/components/Chrome.vue
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@
</div>
</div>
<!-- btn -->
<div class="vc-chrome-toggle-btn" @click="toggleViews">
<div class="vc-chrome-toggle-btn" aria-label="toggleViews" @click="toggleViews">
<div class="vc-chrome-toggle-icon">
<svg style="width:24px; height:24px" viewBox="0 0 24 24"
@mouseover="showHighlight"
Expand Down
1 change: 1 addition & 0 deletions src/components/Compact.vue
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
<div class="vc-compact">
<ul class="vc-compact-colors">
<li class="vc-compact-color-item" v-for="c in palette" :key="c"
:aria-label="'color:' + c"
@click="handlerClick(c)"
:class="{'vc-compact-color-item--white': c === '#FFFFFF' }"
:style="{background: c}">
Expand Down
1 change: 1 addition & 0 deletions src/components/Grayscale.vue
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
<div class="vc-grayscale">
<ul class="vc-grayscale-colors">
<li class="vc-grayscale-color-item" v-for="c in palette" :key="c"
:aria-label="'color:' + c"
@click="handlerClick(c)"
:class="{'vc-grayscale-color-item--white': c == '#FFFFFF'}"
:style="{background: c}">
Expand Down
8 changes: 4 additions & 4 deletions src/components/Photoshop.vue
Original file line number Diff line number Diff line change
Expand Up @@ -16,14 +16,14 @@
<div class="vc-ps-previews">
<div class="vc-ps-previews__label">new</div>
<div class="vc-ps-previews__swatches">
<div class="vc-ps-previews__pr-color" :style="{background: colors.hex}"></div>
<div class="vc-ps-previews__pr-color" :style="{background: currentColor}" @click="clickCurrentColor"></div>
<div class="vc-ps-previews__pr-color" :aria-label="'newColor:' + colors.hex" :style="{background: colors.hex}"></div>
<div class="vc-ps-previews__pr-color" :aria-label="'currentColor:' + currentColor" :style="{background: currentColor}" @click="clickCurrentColor"></div>
</div>
<div class="vc-ps-previews__label">current</div>
</div>
<div class="vc-ps-actions" v-if="!disableFields">
<div class="vc-ps-ac-btn" @click="handleAccept">OK</div>
<div class="vc-ps-ac-btn" @click="handleCancel">Cancel</div>
<div class="vc-ps-ac-btn" aria-label="confirm" @click="handleAccept">OK</div>
<div class="vc-ps-ac-btn" aria-label="cancel" @click="handleCancel">Cancel</div>
<div class="vc-ps-fields">
<!-- hsla -->
<ed-in label="h" desc="°" :value="hsv.h" @change="inputChange"></ed-in>
Expand Down
1 change: 1 addition & 0 deletions src/components/Sketch.vue
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,7 @@
</div>
<div class="vc-sketch-presets">
<div class="vc-sketch-presets-color"
:aria-label="'color:'+c"
v-for="c in presetColors"
:key="c"
:style="{background: c}"
Expand Down
3 changes: 2 additions & 1 deletion src/components/Slider.vue
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,10 @@
<hue v-model="colors" @change="hueChange"></hue>
</div>
<div class="vc-slider-swatches">
<div class="vc-slider-swatch" v-for="(offset, index) in swatches" :data-index="index"
<div class="vc-slider-swatch" v-for="(offset, index) in swatches" :key="index" :data-index="index"
@click="handleSwClick(index, offset)">
<div class="vc-slider-swatch-picker"
:aria-label="'color:' + 'hsl(' + colors.hsl.h + ', 50%, ' + (offset * 100) + '%)'"
:class="{'vc-slider-swatch-picker--active': offset == activeOffset}"
:style="{background: 'hsl(' + colors.hsl.h + ', 50%, ' + (offset * 100) + '%)'}"
></div>
Expand Down
1 change: 1 addition & 0 deletions src/components/Swatches.vue
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
<div class="vc-swatches-box">
<div class="vc-swatches-color-group" v-for="(group, $idx) in palette" :key="$idx">
<div :class="['vc-swatches-color-it', {'vc-swatches-color--white': c === '#FFFFFF' }]"
:aria-label="'color:' + c"
v-for="c in group" :key="c"
:data-color="c"
:style="{background: c}"
Expand Down
22 changes: 12 additions & 10 deletions src/components/common/EditableInput.vue
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<template>
<div class="vc-editable-input">
<input class="vc-input__input"
:aria-label="value"
:aria-label="desc?label+'('+desc+')':label"
v-model="val"
@keydown="handleKeyDown"
@input="update"
Expand Down Expand Up @@ -53,9 +53,10 @@ export default {
this.$emit('change', data)
}
},
handleBlur (e) {
console.log(e)
},
// **** unused
// handleBlur (e) {
// console.log(e)
// },
handleKeyDown (e) {
let val = this.val
let number = Number(val)
Expand All @@ -77,13 +78,14 @@ export default {
e.preventDefault()
}
}
},
handleDrag (e) {
console.log(e)
},
handleMouseDown (e) {
console.log(e)
}
// **** unused
// handleDrag (e) {
// console.log(e)
// },
// handleMouseDown (e) {
// console.log(e)
// }
}
}
</script>
Expand Down
2 changes: 1 addition & 1 deletion src/components/common/Hue.vue
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
@touchmove="handleChange"
@touchstart="handleChange">
<div class="vc-hue-pointer" :style="{top: pointerTop, left: pointerLeft}">
<div class="vc-hue-picker"></div>
<div role="huePicker" class="vc-hue-picker"></div>
</div>
</div>
</div>
Expand Down
4 changes: 2 additions & 2 deletions src/components/common/Saturation.vue
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
<template>
<div class="vc-saturation"
<div role="saturationPanel" class="vc-saturation"
:style="{background: bgColor}"
ref="container"
@mousedown="handleMouseDown"
@touchmove="handleChange"
@touchstart="handleChange">
<div class="vc-saturation--white"></div>
<div class="vc-saturation--black"></div>
<div class="vc-saturation-pointer" :style="{top: pointerTop, left: pointerLeft}">
<div role="currentSaturationPointer" class="vc-saturation-pointer" :style="{top: pointerTop, left: pointerLeft}">
<div class="vc-saturation-circle"></div>
</div>
</div>
Expand Down