chore(client): tweak ui
This commit is contained in:
		
							parent
							
								
									4f9b03a997
								
							
						
					
					
						commit
						57e533a5ef
					
				
					 5 changed files with 14 additions and 13 deletions
				
			
		|  | @ -18,7 +18,7 @@ | |||
| 			</div> | ||||
| 		</div> | ||||
| 		<div v-if="!narrow || hideTitle" class="tabs"> | ||||
| 			<button v-for="tab in tabs" :ref="(el) => tabRefs[tab.key] = el" v-tooltip="tab.title" class="tab _button" :class="{ active: tab.key != null && tab.key === props.tab }" @mousedown="(ev) => onTabMousedown(tab, ev)" @click="(ev) => onTabClick(tab, ev)"> | ||||
| 			<button v-for="tab in tabs" :ref="(el) => tabRefs[tab.key] = el" v-tooltip.noDelay="tab.title" class="tab _button" :class="{ active: tab.key != null && tab.key === props.tab }" @mousedown="(ev) => onTabMousedown(tab, ev)" @click="(ev) => onTabClick(tab, ev)"> | ||||
| 				<i v-if="tab.icon" class="icon" :class="tab.icon"></i> | ||||
| 				<span v-if="!tab.iconOnly" class="title">{{ tab.title }}</span> | ||||
| 			</button> | ||||
|  | @ -27,7 +27,7 @@ | |||
| 	</template> | ||||
| 	<div class="buttons right"> | ||||
| 		<template v-for="action in actions"> | ||||
| 			<button v-tooltip="action.text" class="_button button" :class="{ highlighted: action.highlighted }" @click.stop="action.handler" @touchstart="preventDrag"><i :class="action.icon"></i></button> | ||||
| 			<button v-tooltip.noDelay="action.text" class="_button button" :class="{ highlighted: action.highlighted }" @click.stop="action.handler" @touchstart="preventDrag"><i :class="action.icon"></i></button> | ||||
| 		</template> | ||||
| 	</div> | ||||
| </div> | ||||
|  |  | |||
|  | @ -7,10 +7,11 @@ import { popup, alert } from '@/os'; | |||
| 
 | ||||
| const start = isTouchUsing ? 'touchstart' : 'mouseover'; | ||||
| const end = isTouchUsing ? 'touchend' : 'mouseleave'; | ||||
| const delay = 100; | ||||
| 
 | ||||
| export default { | ||||
| 	mounted(el: HTMLElement, binding, vn) { | ||||
| 		const delay = binding.modifiers.noDelay ? 0 : 100; | ||||
| 
 | ||||
| 		const self = (el as any)._tooltipDirective_ = {} as any; | ||||
| 
 | ||||
| 		self.text = binding.value as string; | ||||
|  |  | |||
|  | @ -9,7 +9,7 @@ | |||
| 			</div> | ||||
| 		</div> | ||||
| 		<div class="tabs"> | ||||
| 			<button v-for="tab in tabs" :ref="(el) => tabRefs[tab.key] = el" v-tooltip="tab.title" class="tab _button" :class="{ active: tab.key != null && tab.key === props.tab }" @mousedown="(ev) => onTabMousedown(tab, ev)" @click="(ev) => onTabClick(tab, ev)"> | ||||
| 			<button v-for="tab in tabs" :ref="(el) => tabRefs[tab.key] = el" v-tooltip.noDelay="tab.title" class="tab _button" :class="{ active: tab.key != null && tab.key === props.tab }" @mousedown="(ev) => onTabMousedown(tab, ev)" @click="(ev) => onTabClick(tab, ev)"> | ||||
| 				<i v-if="tab.icon" class="icon" :class="tab.icon"></i> | ||||
| 				<span v-if="!tab.iconOnly" class="title">{{ tab.title }}</span> | ||||
| 			</button> | ||||
|  | @ -20,7 +20,7 @@ | |||
| 		<template v-if="actions"> | ||||
| 			<template v-for="action in actions"> | ||||
| 				<MkButton v-if="action.asFullButton" class="fullButton" primary @click.stop="action.handler"><i :class="action.icon" style="margin-right: 6px;"></i>{{ action.text }}</MkButton> | ||||
| 				<button v-else v-tooltip="action.text" class="_button button" :class="{ highlighted: action.highlighted }" @click.stop="action.handler" @touchstart="preventDrag"><i :class="action.icon"></i></button> | ||||
| 				<button v-else v-tooltip.noDelay="action.text" class="_button button" :class="{ highlighted: action.highlighted }" @click.stop="action.handler" @touchstart="preventDrag"><i :class="action.icon"></i></button> | ||||
| 			</template> | ||||
| 		</template> | ||||
| 	</div> | ||||
|  |  | |||
|  | @ -3,7 +3,7 @@ | |||
| 	<div class="body"> | ||||
| 		<div class="top"> | ||||
| 			<div class="banner" :style="{ backgroundImage: `url(${ $instance.bannerUrl })` }"></div> | ||||
| 			<button v-click-anime v-tooltip.right="$instance.name ?? i18n.ts.instance" class="item _button instance" @click="openInstanceMenu"> | ||||
| 			<button v-click-anime class="item _button instance" @click="openInstanceMenu"> | ||||
| 				<img :src="$instance.iconUrl || $instance.faviconUrl || '/favicon.ico'" alt="" class="icon"/> | ||||
| 			</button> | ||||
| 		</div> | ||||
|  |  | |||
|  | @ -3,12 +3,12 @@ | |||
| 	<div class="body"> | ||||
| 		<div class="top"> | ||||
| 			<div class="banner" :style="{ backgroundImage: `url(${ $instance.bannerUrl })` }"></div> | ||||
| 			<button v-click-anime v-tooltip.right="$instance.name ?? i18n.ts.instance" class="item _button instance" @click="openInstanceMenu"> | ||||
| 			<button v-click-anime v-tooltip.noDelay.right="$instance.name ?? i18n.ts.instance" class="item _button instance" @click="openInstanceMenu"> | ||||
| 				<img :src="$instance.iconUrl || $instance.faviconUrl || '/favicon.ico'" alt="" class="icon"/> | ||||
| 			</button> | ||||
| 		</div> | ||||
| 		<div class="middle"> | ||||
| 			<MkA v-click-anime v-tooltip.right="i18n.ts.timeline" class="item index" active-class="active" to="/" exact> | ||||
| 			<MkA v-click-anime v-tooltip.noDelay.right="i18n.ts.timeline" class="item index" active-class="active" to="/" exact> | ||||
| 				<i class="icon fas fa-home fa-fw"></i><span class="text">{{ i18n.ts.timeline }}</span> | ||||
| 			</MkA> | ||||
| 			<template v-for="item in menu"> | ||||
|  | @ -17,7 +17,7 @@ | |||
| 					:is="navbarItemDef[item].to ? 'MkA' : 'button'" | ||||
| 					v-else-if="navbarItemDef[item] && (navbarItemDef[item].show !== false)" | ||||
| 					v-click-anime | ||||
| 					v-tooltip.right="i18n.ts[navbarItemDef[item].title]" | ||||
| 					v-tooltip.noDelay.right="i18n.ts[navbarItemDef[item].title]" | ||||
| 					class="item _button" | ||||
| 					:class="[item, { active: navbarItemDef[item].active }]" | ||||
| 					active-class="active" | ||||
|  | @ -29,22 +29,22 @@ | |||
| 				</component> | ||||
| 			</template> | ||||
| 			<div class="divider"></div> | ||||
| 			<MkA v-if="$i.isAdmin || $i.isModerator" v-click-anime v-tooltip.right="i18n.ts.controlPanel" class="item" active-class="active" to="/admin"> | ||||
| 			<MkA v-if="$i.isAdmin || $i.isModerator" v-click-anime v-tooltip.noDelay.right="i18n.ts.controlPanel" class="item" active-class="active" to="/admin"> | ||||
| 				<i class="icon fas fa-door-open fa-fw"></i><span class="text">{{ i18n.ts.controlPanel }}</span> | ||||
| 			</MkA> | ||||
| 			<button v-click-anime class="item _button" @click="more"> | ||||
| 				<i class="icon fa fa-ellipsis-h fa-fw"></i><span class="text">{{ i18n.ts.more }}</span> | ||||
| 				<span v-if="otherMenuItemIndicated" class="indicator"><i class="icon fas fa-circle"></i></span> | ||||
| 			</button> | ||||
| 			<MkA v-click-anime v-tooltip.right="i18n.ts.settings" class="item" active-class="active" to="/settings"> | ||||
| 			<MkA v-click-anime v-tooltip.noDelay.right="i18n.ts.settings" class="item" active-class="active" to="/settings"> | ||||
| 				<i class="icon fas fa-cog fa-fw"></i><span class="text">{{ i18n.ts.settings }}</span> | ||||
| 			</MkA> | ||||
| 		</div> | ||||
| 		<div class="bottom"> | ||||
| 			<button v-tooltip.right="i18n.ts.note" class="item _button post" data-cy-open-post-form @click="os.post"> | ||||
| 			<button v-tooltip.noDelay.right="i18n.ts.note" class="item _button post" data-cy-open-post-form @click="os.post"> | ||||
| 				<i class="icon fas fa-pencil-alt fa-fw"></i><span class="text">{{ i18n.ts.note }}</span> | ||||
| 			</button> | ||||
| 			<button v-click-anime v-tooltip.right="i18n.ts.account" class="item _button account" @click="openAccountMenu"> | ||||
| 			<button v-click-anime v-tooltip.noDelay.right="i18n.ts.account" class="item _button account" @click="openAccountMenu"> | ||||
| 				<MkAvatar :user="$i" class="avatar"/><MkAcct class="text" :user="$i"/> | ||||
| 			</button> | ||||
| 		</div> | ||||
|  |  | |||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue