@@ -27,6 +27,7 @@ import SpeechToText from "/mjs/components/SpeechToText.mjs"
27
27
import TextToSpeech from "/mjs/components/TextToSpeech.mjs"
28
28
import Transform from "/mjs/components/Transform.mjs"
29
29
import UiHome from "/mjs/components/UiHome.mjs"
30
+ import { prefixes , icons } from "/mjs/utils.mjs"
30
31
31
32
const HomeSection = {
32
33
id : '' ,
@@ -56,15 +57,17 @@ export default {
56
57
<div class="flex h-16 justify-between">
57
58
<div class="flex">
58
59
<div class="flex flex-shrink-0 items-center">
59
- <a href="/">
60
- <img class="cursor-pointer block h-8 w-auto" src="/img/logo.svg" alt="Your Company ">
60
+ <a href="/" title="Home" >
61
+ <img class="cursor-pointer block h-8 w-auto" src="/img/logo.svg" alt="Home ">
61
62
</a>
62
63
</div>
63
64
<div class="hidden sm:-my-px sm:ml-2 lg:ml-4 sm:flex sm:space-x-4 xl:space-x-6">
64
65
<a v-href="{admin:section.id}" v-for="section in sections"
65
66
:class="['inline-flex items-center border-b-2 px-1 pt-1 text-sm font-medium', routes.admin==section.id ? 'border-indigo-500 text-gray-900' : 'border-transparent text-gray-500 hover:border-gray-300 hover:text-gray-700']" aria-current="page">
67
+ <span class="lg:hidden xl:inline mr-2" :title="section.label">
68
+ <img :src="section.icon" class="w-6 h-6" :alt="section.label">
69
+ </span>
66
70
<span class="hidden lg:inline">{{section.label}}</span>
67
- <span class="lg:hidden">{{section.abbr}}</span>
68
71
</a>
69
72
</div>
70
73
</div>
@@ -121,8 +124,7 @@ export default {
121
124
:class="['block border-l-4 py-2 pl-3 pr-4 text-base font-medium', routes.admin==section.id
122
125
? 'border-indigo-500 bg-indigo-50 text-indigo-700'
123
126
: 'border-transparent text-gray-600 hover:border-gray-300 hover:bg-gray-50 hover:text-gray-800']" aria-current="page">
124
- <span class="hidden lg:inline">{{section.label}}</span>
125
- <span class="lg:hidden">{{section.abbr}}</span>
127
+ <span class="">{{section.label}}</span>
126
128
</a>
127
129
<a href="/auth/logout?redirect=/" class="block border-l-4 border-transparent py-2 pl-3 pr-4 text-base font-medium text-gray-600 hover:border-gray-300 hover:bg-gray-50 hover:text-gray-800" tabindex="-1">Sign out</a>
128
130
</div>
@@ -164,29 +166,18 @@ export default {
164
166
function toLabel ( id ) {
165
167
return humanify ( id ) . replace ( 'To' , 'to' )
166
168
}
167
- function toAbbr ( id ) {
168
- return toLabel ( id )
169
- . replaceAll ( 'Image' , 'img' )
170
- . replaceAll ( 'Text' , 'txt' )
171
- . replaceAll ( 'Speech' , 'spch' )
172
- . replaceAll ( ' to ' , '2' )
173
- . toLowerCase ( )
174
- }
175
169
const sections = Object . keys ( components ) . map ( id => ( {
176
170
id,
177
171
label : toLabel ( id ) ,
178
172
component : components [ id ] ,
179
- abbr : toAbbr ( id ) ,
173
+ icon : icons [ prefixes [ id ] ] ,
174
+ prefix : prefixes [ id ] ,
180
175
} ) )
181
176
182
177
const overrides = {
183
178
ImageUpscale : {
184
179
label : 'Upscale' ,
185
- abbr :'upscale'
186
180
} ,
187
- Transform : {
188
- abbr : 'ffmpeg'
189
- }
190
181
}
191
182
192
183
Object . keys ( overrides ) . forEach ( id => {
0 commit comments