mirror of
https://codeberg.org/yeentown/barkey.git
synced 2025-07-08 04:54:32 +00:00
refactor(frontend): refactor components
This commit is contained in:
parent
64cf101fe7
commit
3399c786a8
6 changed files with 72 additions and 60 deletions
21
packages/frontend/src/components/MkPageWithAnimBg.vue
Normal file
21
packages/frontend/src/components/MkPageWithAnimBg.vue
Normal file
|
@ -0,0 +1,21 @@
|
||||||
|
<!--
|
||||||
|
SPDX-FileCopyrightText: syuilo and misskey-project
|
||||||
|
SPDX-License-Identifier: AGPL-3.0-only
|
||||||
|
-->
|
||||||
|
|
||||||
|
<template>
|
||||||
|
<div>
|
||||||
|
<MkAnimBg style="position: absolute;"/>
|
||||||
|
<div class="_pageScrollable" style="position: absolute; top: 0; width: 100%; height: 100%;">
|
||||||
|
<slot></slot>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</template>
|
||||||
|
|
||||||
|
<script lang="ts" setup>
|
||||||
|
import MkAnimBg from '@/components/MkAnimBg.vue';
|
||||||
|
</script>
|
||||||
|
|
||||||
|
<style lang="scss" module>
|
||||||
|
|
||||||
|
</style>
|
|
@ -4,9 +4,7 @@ SPDX-License-Identifier: AGPL-3.0-only
|
||||||
-->
|
-->
|
||||||
|
|
||||||
<template>
|
<template>
|
||||||
<div>
|
<MkPageWithAnimBg>
|
||||||
<MkAnimBg style="position: absolute;"/>
|
|
||||||
<div class="_pageScrollable" style="position: absolute; top: 0; width: 100%; height: 100%;">
|
|
||||||
<MkStickyContainer>
|
<MkStickyContainer>
|
||||||
<template #header><MkPageHeader :actions="headerActions" :tabs="headerTabs"/></template>
|
<template #header><MkPageHeader :actions="headerActions" :tabs="headerTabs"/></template>
|
||||||
<MkSpacer :contentMax="550">
|
<MkSpacer :contentMax="550">
|
||||||
|
@ -42,8 +40,7 @@ SPDX-License-Identifier: AGPL-3.0-only
|
||||||
</div>
|
</div>
|
||||||
</MkSpacer>
|
</MkSpacer>
|
||||||
</MkStickyContainer>
|
</MkStickyContainer>
|
||||||
</div>
|
</MkPageWithAnimBg>
|
||||||
</div>
|
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script lang="ts" setup>
|
<script lang="ts" setup>
|
||||||
|
@ -63,7 +60,7 @@ import { parseThemeCode, installTheme } from '@/theme.js';
|
||||||
import { unisonReload } from '@/utility/unison-reload.js';
|
import { unisonReload } from '@/utility/unison-reload.js';
|
||||||
import { i18n } from '@/i18n.js';
|
import { i18n } from '@/i18n.js';
|
||||||
import { definePage } from '@/page.js';
|
import { definePage } from '@/page.js';
|
||||||
import MkAnimBg from '@/components/MkAnimBg.vue';
|
import MkPageWithAnimBg from '@/components/MkPageWithAnimBg.vue';
|
||||||
|
|
||||||
const uiPhase = ref<'fetching' | 'confirm' | 'error'>('fetching');
|
const uiPhase = ref<'fetching' | 'confirm' | 'error'>('fetching');
|
||||||
const errorKV = ref<{
|
const errorKV = ref<{
|
||||||
|
|
|
@ -4,8 +4,7 @@ SPDX-License-Identifier: AGPL-3.0-only
|
||||||
-->
|
-->
|
||||||
|
|
||||||
<template>
|
<template>
|
||||||
<div>
|
<MkPageWithAnimBg>
|
||||||
<MkAnimBg style="position: fixed; top: 0;"/>
|
|
||||||
<div :class="$style.formContainer">
|
<div :class="$style.formContainer">
|
||||||
<div :class="$style.form">
|
<div :class="$style.form">
|
||||||
<MkAuthConfirm
|
<MkAuthConfirm
|
||||||
|
@ -25,16 +24,14 @@ SPDX-License-Identifier: AGPL-3.0-only
|
||||||
</MkAuthConfirm>
|
</MkAuthConfirm>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</MkPageWithAnimBg>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script lang="ts" setup>
|
<script lang="ts" setup>
|
||||||
import { computed, useTemplateRef } from 'vue';
|
import { computed, useTemplateRef } from 'vue';
|
||||||
import * as Misskey from 'misskey-js';
|
import * as Misskey from 'misskey-js';
|
||||||
|
import MkPageWithAnimBg from '@/components/MkPageWithAnimBg.vue';
|
||||||
import MkAnimBg from '@/components/MkAnimBg.vue';
|
|
||||||
import MkAuthConfirm from '@/components/MkAuthConfirm.vue';
|
import MkAuthConfirm from '@/components/MkAuthConfirm.vue';
|
||||||
|
|
||||||
import { i18n } from '@/i18n.js';
|
import { i18n } from '@/i18n.js';
|
||||||
import { misskeyApi } from '@/utility/misskey-api.js';
|
import { misskeyApi } from '@/utility/misskey-api.js';
|
||||||
import { definePage } from '@/page.js';
|
import { definePage } from '@/page.js';
|
||||||
|
|
|
@ -4,8 +4,7 @@ SPDX-License-Identifier: AGPL-3.0-only
|
||||||
-->
|
-->
|
||||||
|
|
||||||
<template>
|
<template>
|
||||||
<div>
|
<MkPageWithAnimBg>
|
||||||
<MkAnimBg style="position: fixed; top: 0;"/>
|
|
||||||
<div :class="$style.formContainer">
|
<div :class="$style.formContainer">
|
||||||
<div :class="$style.form">
|
<div :class="$style.form">
|
||||||
<MkAuthConfirm
|
<MkAuthConfirm
|
||||||
|
@ -19,12 +18,12 @@ SPDX-License-Identifier: AGPL-3.0-only
|
||||||
/>
|
/>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</MkPageWithAnimBg>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script lang="ts" setup>
|
<script lang="ts" setup>
|
||||||
import * as Misskey from 'misskey-js';
|
import * as Misskey from 'misskey-js';
|
||||||
import MkAnimBg from '@/components/MkAnimBg.vue';
|
import MkPageWithAnimBg from '@/components/MkPageWithAnimBg.vue';
|
||||||
import { definePage } from '@/page.js';
|
import { definePage } from '@/page.js';
|
||||||
import MkAuthConfirm from '@/components/MkAuthConfirm.vue';
|
import MkAuthConfirm from '@/components/MkAuthConfirm.vue';
|
||||||
|
|
||||||
|
|
|
@ -4,8 +4,7 @@ SPDX-License-Identifier: AGPL-3.0-only
|
||||||
-->
|
-->
|
||||||
|
|
||||||
<template>
|
<template>
|
||||||
<div>
|
<MkPageWithAnimBg>
|
||||||
<MkAnimBg style="position: fixed; top: 0;"/>
|
|
||||||
<div :class="$style.formContainer">
|
<div :class="$style.formContainer">
|
||||||
<form :class="$style.form" class="_panel" @submit.prevent="submit()">
|
<form :class="$style.form" class="_panel" @submit.prevent="submit()">
|
||||||
<div :class="$style.banner">
|
<div :class="$style.banner">
|
||||||
|
@ -21,13 +20,13 @@ SPDX-License-Identifier: AGPL-3.0-only
|
||||||
</div>
|
</div>
|
||||||
</form>
|
</form>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</MkPageWithAnimBg>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script lang="ts" setup>
|
<script lang="ts" setup>
|
||||||
import { ref } from 'vue';
|
import { ref } from 'vue';
|
||||||
import MkButton from '@/components/MkButton.vue';
|
import MkButton from '@/components/MkButton.vue';
|
||||||
import MkAnimBg from '@/components/MkAnimBg.vue';
|
import MkPageWithAnimBg from '@/components/MkPageWithAnimBg.vue';
|
||||||
import { i18n } from '@/i18n.js';
|
import { i18n } from '@/i18n.js';
|
||||||
import * as os from '@/os.js';
|
import * as os from '@/os.js';
|
||||||
import { misskeyApi } from '@/utility/misskey-api.js';
|
import { misskeyApi } from '@/utility/misskey-api.js';
|
||||||
|
|
|
@ -4,8 +4,7 @@ SPDX-License-Identifier: AGPL-3.0-only
|
||||||
-->
|
-->
|
||||||
|
|
||||||
<template>
|
<template>
|
||||||
<div>
|
<MkPageWithAnimBg>
|
||||||
<MkAnimBg style="position: fixed; top: 0;"/>
|
|
||||||
<div :class="$style.formContainer">
|
<div :class="$style.formContainer">
|
||||||
<form :class="$style.form" class="_panel" @submit.prevent="submit()">
|
<form :class="$style.form" class="_panel" @submit.prevent="submit()">
|
||||||
<div :class="$style.title">
|
<div :class="$style.title">
|
||||||
|
@ -35,7 +34,7 @@ SPDX-License-Identifier: AGPL-3.0-only
|
||||||
</div>
|
</div>
|
||||||
</form>
|
</form>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</MkPageWithAnimBg>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script lang="ts" setup>
|
<script lang="ts" setup>
|
||||||
|
@ -46,7 +45,7 @@ import MkInput from '@/components/MkInput.vue';
|
||||||
import * as os from '@/os.js';
|
import * as os from '@/os.js';
|
||||||
import { misskeyApi } from '@/utility/misskey-api.js';
|
import { misskeyApi } from '@/utility/misskey-api.js';
|
||||||
import { i18n } from '@/i18n.js';
|
import { i18n } from '@/i18n.js';
|
||||||
import MkAnimBg from '@/components/MkAnimBg.vue';
|
import MkPageWithAnimBg from '@/components/MkPageWithAnimBg.vue';
|
||||||
import { login } from '@/accounts.js';
|
import { login } from '@/accounts.js';
|
||||||
|
|
||||||
const username = ref('');
|
const username = ref('');
|
||||||
|
|
Loading…
Add table
Reference in a new issue