This commit is contained in:
syuilo 2020-10-31 09:39:22 +09:00
parent 0baed1a275
commit cb16cb0610
3 changed files with 64 additions and 45 deletions

View File

@ -7,9 +7,7 @@
> >
<template #header>{{ $t('login') }}</template> <template #header>{{ $t('login') }}</template>
<div class="_section">
<MkSignin :auto-set="autoSet" @login="onLogin"/> <MkSignin :auto-set="autoSet" @login="onLogin"/>
</div>
</XModalWindow> </XModalWindow>
</template> </template>

View File

@ -1,5 +1,6 @@
<template> <template>
<form class="eppvobhk" :class="{ signing, totpLogin }" @submit.prevent="onSubmit"> <form class="eppvobhk" :class="{ signing, totpLogin }" @submit.prevent="onSubmit">
<div class="auth _section">
<div class="avatar" :style="{ backgroundImage: user ? `url('${ user.avatarUrl }')` : null }" v-show="withAvatar"></div> <div class="avatar" :style="{ backgroundImage: user ? `url('${ user.avatarUrl }')` : null }" v-show="withAvatar"></div>
<div class="normal-signin" v-if="!totpLogin"> <div class="normal-signin" v-if="!totpLogin">
<MkInput v-model:value="username" type="text" pattern="^[a-zA-Z0-9_]+$" spellcheck="false" autofocus required @update:value="onUsernameChange"> <MkInput v-model:value="username" type="text" pattern="^[a-zA-Z0-9_]+$" spellcheck="false" autofocus required @update:value="onUsernameChange">
@ -12,9 +13,6 @@
<template #prefix><Fa :icon="faLock"/></template> <template #prefix><Fa :icon="faLock"/></template>
</MkInput> </MkInput>
<MkButton type="submit" primary :disabled="signing" style="margin: 0 auto;">{{ signing ? $t('loggingIn') : $t('login') }}</MkButton> <MkButton type="submit" primary :disabled="signing" style="margin: 0 auto;">{{ signing ? $t('loggingIn') : $t('login') }}</MkButton>
<a class="_panelButton" style="margin: 8px auto;" v-if="meta && meta.enableTwitterIntegration" :href="`${apiUrl}/signin/twitter`"><Fa :icon="faTwitter" style="margin-right: 4px;"/>{{ $t('signinWith', { x: 'Twitter' }) }}</a>
<a class="_panelButton" style="margin: 8px auto;" v-if="meta && meta.enableGithubIntegration" :href="`${apiUrl}/signin/github`"><Fa :icon="faGithub" style="margin-right: 4px;"/>{{ $t('signinWith', { x: 'GitHub' }) }}</a>
<a class="_panelButton" style="margin: 8px auto;" v-if="meta && meta.enableDiscordIntegration" :href="`${apiUrl}/signin/discord`"><Fa :icon="faDiscord" style="margin-right: 4px;"/>{{ $t('signinWith', { x: 'Discord' }) }}</a>
</div> </div>
<div class="2fa-signin" v-if="totpLogin" :class="{ securityKeys: user && user.securityKeys }"> <div class="2fa-signin" v-if="totpLogin" :class="{ securityKeys: user && user.securityKeys }">
<div v-if="user && user.securityKeys" class="twofa-group tap-group"> <div v-if="user && user.securityKeys" class="twofa-group tap-group">
@ -39,6 +37,12 @@
<MkButton type="submit" :disabled="signing" primary style="margin: 0 auto;">{{ signing ? $t('loggingIn') : $t('login') }}</MkButton> <MkButton type="submit" :disabled="signing" primary style="margin: 0 auto;">{{ signing ? $t('loggingIn') : $t('login') }}</MkButton>
</div> </div>
</div> </div>
</div>
<div class="social _section">
<a class="_borderButton _vMargin" v-if="meta && meta.enableTwitterIntegration" :href="`${apiUrl}/signin/twitter`"><Fa :icon="faTwitter" style="margin-right: 4px;"/>{{ $t('signinWith', { x: 'Twitter' }) }}</a>
<a class="_borderButton _vMargin" v-if="meta && meta.enableGithubIntegration" :href="`${apiUrl}/signin/github`"><Fa :icon="faGithub" style="margin-right: 4px;"/>{{ $t('signinWith', { x: 'GitHub' }) }}</a>
<a class="_borderButton _vMargin" v-if="meta && meta.enableDiscordIntegration" :href="`${apiUrl}/signin/discord`"><Fa :icon="faDiscord" style="margin-right: 4px;"/>{{ $t('signinWith', { x: 'Discord' }) }}</a>
</div>
</form> </form>
</template> </template>
@ -203,6 +207,7 @@ export default defineComponent({
<style lang="scss" scoped> <style lang="scss" scoped>
.eppvobhk { .eppvobhk {
> .auth {
> .avatar { > .avatar {
margin: 0 auto 0 auto; margin: 0 auto 0 auto;
width: 64px; width: 64px;
@ -212,5 +217,6 @@ export default defineComponent({
background-size: cover; background-size: cover;
border-radius: 100%; border-radius: 100%;
} }
}
} }
</style> </style>

View File

@ -297,6 +297,21 @@ hr {
padding: 12px 0; padding: 12px 0;
} }
._borderButton {
@extend ._button;
display: block;
width: 100%;
padding: 10px;
box-sizing: border-box;
text-align: center;
border: solid 1px var(--divider);
border-radius: var(--radius);
&:active {
border-color: var(--accent);
}
}
._popup { ._popup {
background: var(--panel); background: var(--panel);
border-radius: var(--radius); border-radius: var(--radius);