Skip to content

Commit 1bf9f2c

Browse files
authored
Merge pull request #44 from besscroft/dev
feat: 无障碍优化
2 parents fa6d608 + 65360f3 commit 1bf9f2c

File tree

12 files changed

+560
-132
lines changed

12 files changed

+560
-132
lines changed

.env.local renamed to .env

File renamed without changes.

.gitignore

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,6 @@ node_modules
33
dist
44
.output
55
.nuxt
6-
.env
6+
.env.local
77
.idea/
88
.vercel/

README.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,10 @@ Kamera
1313
图片存储兼容 S3 API、AList API、支持 CDN 配置。同时适配了 PC 和移动端的样式与交互。
1414
今天又是想当二次元摄影高手的一天呢!
1515

16+
### 无障碍支持
17+
18+
已经在尽力支持了,主要基于 [WAI-ARIA 规范](https://developer.mozilla.org/zh-CN/docs/Learn/Accessibility/WAI-ARIA_basics),有爱,无障碍!
19+
1620
### 如何部署
1721

1822
你可以 Fork 后点击下面的按钮来一键部署到 Vercel(自定义配置及容器部署请往下看)

components/Canvas.vue

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -81,11 +81,11 @@ onUnmounted(() => {
8181
>
8282
<template #header="{ close }">
8383
<div flex flex-row justify-between>
84-
<span>点击图片预览</span>
84+
<span aria-label="点击下方图片预览">点击图片预览</span>
8585
<div flex space-x-3>
8686
<ClientOnly>
8787
<UPopover mode="hover">
88-
<div i-carbon-overflow-menu-horizontal cursor-pointer />
88+
<div i-carbon-overflow-menu-horizontal cursor-pointer aria-label="更多操作按钮" />
8989
<template #panel>
9090
<div p-2>
9191
<div
@@ -95,6 +95,7 @@ onUnmounted(() => {
9595
transition-colors duration-200 transform cursor-pointer
9696
hover="bg-gray-100 dark:(bg-gray-700 text-white)"
9797
@click="shareHandle(obj?.detail, obj?.url)"
98+
aria-label="分享"
9899
>
99100
<span i-carbon-crowd-report text-xl me-4 />分享
100101
</div>
@@ -104,6 +105,7 @@ onUnmounted(() => {
104105
transition-colors duration-200 transform cursor-pointer
105106
hover="bg-gray-100 dark:(bg-gray-700 text-white)"
106107
@click="copyHandle(obj?.url)"
108+
aria-label="复制链接"
107109
>
108110
<span i-carbon-copy text-xl me-4 />复制链接
109111
</div>
@@ -112,7 +114,7 @@ onUnmounted(() => {
112114
</UPopover>
113115
</ClientOnly>
114116

115-
<div i-carbon-close-large cursor-pointer @click="close" />
117+
<div i-carbon-close-large cursor-pointer @click="close" aria-label="关闭当前图片详情" />
116118
</div>
117119
</div>
118120
</template>

components/Header.vue

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -96,6 +96,7 @@ onBeforeUnmount(() => {
9696
transition-colors duration-200 transform
9797
hover="bg-gray-100 dark:(bg-gray-700 text-white)"
9898
:class="route.path === item.to ? 'text-custom-green' : 'text-gray-700 dark:text-gray-200'"
99+
:aria-label="item.title"
99100
>
100101
<span :class="item.icon" text-xl me-4 />{{ item.title }}
101102
</NuxtLink>
@@ -109,6 +110,7 @@ onBeforeUnmount(() => {
109110
transition-colors duration-200 transform
110111
hover="bg-gray-100 dark:(bg-gray-700 text-white)"
111112
:class="route.path === item.to ? 'text-custom-green' : 'text-gray-700 dark:text-gray-200'"
113+
:aria-label="item.title"
112114
>
113115
<span :class="item.icon" text-xl me-4 />{{ item.title }}
114116
</NuxtLink>

components/NavBottom.vue

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,17 +4,17 @@ const isOpen = ref(false)
44

55
<template>
66
<div fixed inset-x-0 bottom-0 z-100 h-14 bg-white dark:bg-custom-black flex flex-row border-t-1>
7-
<NuxtLink to="/" flex flex-row items-center place-content-center h-full flex-1>
7+
<NuxtLink to="/" flex flex-row items-center place-content-center h-full flex-1 aria-label="首页">
88
<div i-carbon-aperture />
99
</NuxtLink>
10-
<NuxtLink to="/admin" flex flex-row items-center place-content-center h-full flex-1>
10+
<NuxtLink to="/admin" flex flex-row items-center place-content-center h-full flex-1 aria-label="控制台">
1111
<div i-carbon-earth-southeast-asia-filled />
1212
</NuxtLink>
1313
<NavBottomMenu v-slot="{ toggleVisible, show }" v-model="isOpen" flex flex-row items-center place-content-center h-full flex-1 cursor-pointer>
1414
<button
1515
flex items-center place-content-center h-full flex-1 class="select-none"
1616
:class="show ? '!text-primary' : ''"
17-
aria-label="More menu"
17+
aria-label="更多菜单"
1818
@click="toggleVisible"
1919
>
2020
<span :class="show ? 'i-carbon-close' : 'i-carbon-app'" />

components/NavBottomMenu.vue

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -192,6 +192,7 @@ onBeforeUnmount(() => {
192192
transition-colors duration-200 transform
193193
hover="bg-gray-100 dark:(bg-gray-700 text-white)"
194194
:class="route.path === item.to ? 'text-custom-green' : 'text-gray-700 dark:text-gray-200'"
195+
:aria-label="item.title"
195196
>
196197
<span :class="item.icon" text-xl me-4 />{{ item.title }}
197198
</NuxtLink>
@@ -208,6 +209,7 @@ onBeforeUnmount(() => {
208209
transition-colors duration-200 transform
209210
hover="bg-gray-100 dark:(bg-gray-700 text-white)"
210211
:class="route.path === item.to ? 'text-custom-green' : 'text-gray-700 dark:text-gray-200'"
212+
:aria-label="item.title"
211213
>
212214
<span :class="item.icon" text-xl me-4 />{{ item.title }}
213215
</NuxtLink>

package.json

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -13,19 +13,19 @@
1313
"typecheck": "vue-tsc --noEmit"
1414
},
1515
"devDependencies": {
16-
"@antfu/eslint-config": "^2.9.0",
17-
"@element-plus/nuxt": "^1.0.7",
16+
"@antfu/eslint-config": "^2.11.0",
17+
"@element-plus/nuxt": "^1.0.8",
1818
"@iconify-json/carbon": "^1.1.31",
1919
"@nuxt/eslint": "^0.3.0-beta.2",
2020
"@nuxtjs/color-mode": "^3.3.3",
2121
"@nuxtjs/device": "^3.1.1",
2222
"@pinia-plugin-persistedstate/nuxt": "^1.2.0",
2323
"@pinia/nuxt": "^0.5.1",
24-
"@unocss/eslint-config": "^0.58.6",
25-
"@unocss/nuxt": "^0.58.6",
24+
"@unocss/eslint-config": "^0.58.7",
25+
"@unocss/nuxt": "^0.58.7",
2626
"@vueuse/nuxt": "^10.9.0",
2727
"consola": "^3.2.3",
28-
"element-plus": "^2.6.1",
28+
"element-plus": "^2.6.2",
2929
"eslint": "^8.57.0",
3030
"eslint-plugin-format": "^0.1.0",
3131
"nuxt": "^3.11.1",
@@ -35,12 +35,12 @@
3535
},
3636
"dependencies": {
3737
"@formkit/auto-animate": "^0.8.1",
38-
"@nuxt/ui": "^2.14.2",
39-
"aws-sdk": "^2.1582.0",
38+
"@nuxt/ui": "^2.15.0",
39+
"aws-sdk": "^2.1586.0",
4040
"crypto-js": "^4.2.0",
4141
"exifreader": "^4.21.1",
4242
"jsonwebtoken": "^9.0.2",
43-
"postgres": "^3.4.3",
43+
"postgres": "^3.4.4",
4444
"vue-waterfall-plugin-next": "^2.4.3"
4545
}
4646
}

pages/admin/list.vue

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -200,7 +200,7 @@ definePageMeta({
200200
<div>
201201
<div p2 md:p8 pb-20>
202202
<div flex items-center justify-center justify-between w-full mt-4>
203-
<el-select v-model="type" m-2 max-w-80 placeholder="类型(查询条件)" @change="dataHandle">
203+
<el-select v-model="type" m-2 max-w-80 placeholder="类型(查询条件)" @change="dataHandle" aria-label="类型(查询条件)选择下拉框">
204204
<el-option
205205
v-for="item in imgTypeOptions"
206206
:key="item.value"

pages/admin/upload.vue

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -246,15 +246,15 @@ definePageMeta({
246246
<div w-full max-h-full flex flex-col items-center justify-center mx-auto p2 md:p8 pb-20 class="md:w-4/5 lg:w-3/5">
247247
<div my-6 md:my-16 mx-auto w-full rounded-md bg-white dark:bg-gray-800 shadow p-2>
248248
<div flex items-center justify-center pb-2>
249-
<el-select v-model="storage" m-2 placeholder="请选择存储">
249+
<el-select v-model="storage" m-2 placeholder="请选择存储" aria-label="存储选择下拉框">
250250
<el-option
251251
v-for="item in storageOptions"
252252
:key="item.value"
253253
:label="item.label"
254254
:value="item.value"
255255
/>
256256
</el-select>
257-
<el-select v-model="imgData.type" m-2 placeholder="请选择图片类别">
257+
<el-select v-model="imgData.type" m-2 placeholder="请选择图片类别" aria-label="图片类别选择下拉框">
258258
<el-option
259259
v-for="item in imgTypeOptions"
260260
:key="item.value"

0 commit comments

Comments
 (0)