Fix style

This commit is contained in:
syuilo 2021-04-28 18:36:07 +09:00
parent 3e19bcb6cb
commit c7e60cfd0c

View File

@ -8,33 +8,35 @@
@closed="$emit('closed')" @closed="$emit('closed')"
> >
<template #header>{{ $ts.selectUser }}</template> <template #header>{{ $ts.selectUser }}</template>
<div class="tbhwbxda _section"> <div class="tbhwbxda _monolithic_">
<div class="inputs"> <div class="_section">
<MkInput v-model:value="username" class="input" @update:value="search" ref="username"><span>{{ $ts.username }}</span><template #prefix>@</template></MkInput> <div class="inputs">
<MkInput v-model:value="host" class="input" @update:value="search"><span>{{ $ts.host }}</span><template #prefix>@</template></MkInput> <MkInput v-model:value="username" class="input" @update:value="search" ref="username"><span>{{ $ts.username }}</span><template #prefix>@</template></MkInput>
</div> <MkInput v-model:value="host" class="input" @update:value="search"><span>{{ $ts.host }}</span><template #prefix>@</template></MkInput>
</div>
<div class="tbhwbxda _section result" v-if="username != '' || host != ''" :class="{ hit: users.length > 0 }">
<div class="users" v-if="users.length > 0">
<div class="user" v-for="user in users" :key="user.id" :class="{ selected: selected && selected.id === user.id }" @click="selected = user" @dblclick="ok()">
<MkAvatar :user="user" class="avatar" :show-indicator="true"/>
<div class="body">
<MkUserName :user="user" class="name"/>
<MkAcct :user="user" class="acct"/>
</div>
</div> </div>
</div> </div>
<div v-else class="empty"> <div class="_section result" v-if="username != '' || host != ''" :class="{ hit: users.length > 0 }">
<span>{{ $ts.noUsers }}</span> <div class="users" v-if="users.length > 0">
<div class="user" v-for="user in users" :key="user.id" :class="{ selected: selected && selected.id === user.id }" @click="selected = user" @dblclick="ok()">
<MkAvatar :user="user" class="avatar" :show-indicator="true"/>
<div class="body">
<MkUserName :user="user" class="name"/>
<MkAcct :user="user" class="acct"/>
</div>
</div>
</div>
<div v-else class="empty">
<span>{{ $ts.noUsers }}</span>
</div>
</div> </div>
</div> <div class="_section recent" v-if="username == '' && host == ''">
<div class="tbhwbxda _section recent" v-if="username == '' && host == ''"> <div class="users">
<div class="users"> <div class="user" v-for="user in recentUsers" :key="user.id" :class="{ selected: selected && selected.id === user.id }" @click="selected = user" @dblclick="ok()">
<div class="user" v-for="user in recentUsers" :key="user.id" :class="{ selected: selected && selected.id === user.id }" @click="selected = user" @dblclick="ok()"> <MkAvatar :user="user" class="avatar" :show-indicator="true"/>
<MkAvatar :user="user" class="avatar" :show-indicator="true"/> <div class="body">
<div class="body"> <MkUserName :user="user" class="name"/>
<MkUserName :user="user" class="name"/> <MkAcct :user="user" class="acct"/>
<MkAcct :user="user" class="acct"/> </div>
</div> </div>
</div> </div>
</div> </div>
@ -122,76 +124,78 @@ export default defineComponent({
<style lang="scss" scoped> <style lang="scss" scoped>
.tbhwbxda { .tbhwbxda {
display: flex; > ._section {
flex-direction: column; display: flex;
overflow: auto; flex-direction: column;
height: 100%;
&.result.hit {
padding: 0;
}
&.recent {
padding: 0;
}
> .inputs {
> .input {
display: inline-block;
width: 50%;
margin: 0;
}
}
> .users {
flex: 1;
overflow: auto; overflow: auto;
padding: 8px 0; height: 100%;
> .user { &.result.hit {
display: flex; padding: 0;
align-items: center; }
padding: 8px var(--root-margin);
font-size: 14px;
&:hover { &.recent {
background: var(--X7); padding: 0;
}
> .inputs {
> .input {
display: inline-block;
width: 50%;
margin: 0;
} }
}
&.selected { > .users {
background: var(--accent); flex: 1;
color: #fff; overflow: auto;
} padding: 8px 0;
> * { > .user {
pointer-events: none; display: flex;
user-select: none; align-items: center;
} padding: 8px var(--root-margin);
font-size: 14px;
> .avatar { &:hover {
width: 45px; background: var(--X7);
height: 45px;
}
> .body {
padding: 0 8px;
min-width: 0;
> .name {
display: block;
font-weight: bold;
} }
> .acct { &.selected {
opacity: 0.5; background: var(--accent);
color: #fff;
}
> * {
pointer-events: none;
user-select: none;
}
> .avatar {
width: 45px;
height: 45px;
}
> .body {
padding: 0 8px;
min-width: 0;
> .name {
display: block;
font-weight: bold;
}
> .acct {
opacity: 0.5;
}
} }
} }
} }
}
> .empty { > .empty {
opacity: 0.7; opacity: 0.7;
text-align: center; text-align: center;
}
} }
} }
</style> </style>