forked from mirrors/misskey
* wip * wip * wip * test * wip rollup pluginでsearchIndexの情報生成 * wip * SPDX * wip: markerIdを自動付与 * rollupでビルド時・devモード時に毎回uuidを生成するように * 開発サーバーでだけ必要な挙動は開発サーバーのみで * 条件が逆 * wip: childrenの生成 * update comment * update comment * rename auto generated file * hashをパスと行数から決定 * Update privacy.vue * Update privacy.vue * wip * Update general.vue * Update general.vue * wip * wip * Update SearchMarker.vue * wip * Update profile.vue * Update mute-block.vue * Update mute-block.vue * Update general.vue * Update general.vue * childrenがduplicate key errorを吐く問題をいったん解決 * マーカーの形を成形 * loggerを置きかえ * とりあえず省略記法に対応 * Refactor and Format codes * wip * Update settings-search-index.ts * wip * wip * とりあえず不確定要因の仮置きidを削除 * hashの生成を正規化(絶対パスになっていたのを緩和) * pathの入力を省略可能に * adminでもパス生成できるように * Update settings-search-index.ts * Update privacy.vue * wip * build searchIndex * wip * build * Update general.vue * build * Update sounds.vue * build * build * Update sounds.vue * 🎨 * 🎨 * Update privacy.vue * Update privacy.vue * Update security.vue * create-search-indexを多少改善 * build * Update 2fa.vue * wip * 必ずtransformCodeCacheを利用するように, キャッシュの明確な受け渡しを定義 * キャッシュはdevServerでなくても更新 * Revert "wip" This reverts commit 41bffd3a13f55618bf939dc1c9acb2a77ead4054. * inlining * wip * Update theme.vue * 🎨 * wip normalize * Update theme.vue * キャッシュのパス変換 * build * wip * wip * Update SearchMarker.vue * i18n.ts['key'] の形式が取り出せない問題のFix * build * 仮でpath入れ * 必ず絶対パスが使われるように * wip * 🎨 * storybookビルド時はcreateSearchIndexをしない * inliningの構造化 * format code * Update index.vue * wip * wip * 🎨 * wip * wip * wip * wip * wip * wip * wip * wip * clean up * wip * wip * wip * Update rollup-plugin-unwind-css-module-class-name.test.ts * Update navbar.vue * clean up * wip * wip * wip * wip * wip * Update preferences-backups.vue * Update common.ts * Update preferences.ts * wip * wip * wip * wip * Update MkPreferenceContainer.vue * Update MkPreferenceContainer.vue * Update MkPreferenceContainer.vue * enhance: 検索で上下矢印を使用することで検索結果を移動できるように * Update main-boot.ts * refactor * wip * Update sounds.vue * fix(frontend): PageWindowでSearchMarkerが動作するように * enhance(frontend): SearchMarkerの点滅を一定時間で止める * wip * lint fix * fix: 子要素監視が抜けていたのを修正 * アニメーションの回数はCSSで制御するように * refactor * enhance(frontend): 検索インデックス作成時のログを削減 * revert * fix * fix * Update preferences.ts * Update preferences.ts * wip * Update preferences.ts * wip * 🎨 * wip * Update MkPreferenceContainer.vue * wip * Update preferences.ts * wip * Update preferences.ts * Update preferences.ts * wip * wip * Update preferences.ts * wip * wip * Update preferences.ts * Update CHANGELOG.md * Update preferences.ts * Update deck-store.ts * deckStoreをdefaultStoreに統合 * wip * defaultStore -> store * Update profile.ts * wip * refactor * wip: plugin * plugin * plugin * plugin * Update plugin.ts * wip * Update plugin.vue * Update preferences.ts * Update main-boot.ts * wip * fix test * Update plugin.vue * Update plugin.vue * Update utility.ts * wip * wip * Update utility.ts * wip * wip * clean up * Update utility.ts --------- Co-authored-by: tai-cha <dev@taichan.site> Co-authored-by: taichan <40626578+tai-cha@users.noreply.github.com> Co-authored-by: kakkokari-gtyih <67428053+kakkokari-gtyih@users.noreply.github.com>
260 lines
9.2 KiB
Vue
260 lines
9.2 KiB
Vue
<!--
|
|
SPDX-FileCopyrightText: syuilo and misskey-project
|
|
SPDX-License-Identifier: AGPL-3.0-only
|
|
-->
|
|
|
|
<template>
|
|
<MkModalWindow
|
|
ref="dialog"
|
|
:width="500"
|
|
:height="550"
|
|
data-cy-user-setup
|
|
@close="close(true)"
|
|
@closed="emit('closed')"
|
|
>
|
|
<template v-if="page === 1" #header><i class="ti ti-user-edit"></i> {{ i18n.ts._initialAccountSetting.profileSetting }}</template>
|
|
<template v-else-if="page === 2" #header><i class="ti ti-lock"></i> {{ i18n.ts._initialAccountSetting.privacySetting }}</template>
|
|
<template v-else-if="page === 3" #header><i class="ti ti-user-plus"></i> {{ i18n.ts.follow }}</template>
|
|
<template v-else-if="page === 4" #header><i class="ti ti-bell-plus"></i> {{ i18n.ts.pushNotification }}</template>
|
|
<template v-else-if="page === 5" #header>{{ i18n.ts.done }}</template>
|
|
<template v-else #header>{{ i18n.ts.initialAccountSetting }}</template>
|
|
|
|
<div style="overflow-x: clip;">
|
|
<div :class="$style.progressBar">
|
|
<div :class="$style.progressBarValue" :style="{ width: `${(page / 5) * 100}%` }"></div>
|
|
</div>
|
|
<Transition
|
|
mode="out-in"
|
|
:enterActiveClass="$style.transition_x_enterActive"
|
|
:leaveActiveClass="$style.transition_x_leaveActive"
|
|
:enterFromClass="$style.transition_x_enterFrom"
|
|
:leaveToClass="$style.transition_x_leaveTo"
|
|
>
|
|
<template v-if="page === 0">
|
|
<div :class="$style.centerPage">
|
|
<MkAnimBg style="position: absolute; top: 0;" :scale="1.5"/>
|
|
<MkSpacer :marginMin="20" :marginMax="28">
|
|
<div class="_gaps" style="text-align: center;">
|
|
<i class="ti ti-confetti" style="display: block; margin: auto; font-size: 3em; color: var(--MI_THEME-accent);"></i>
|
|
<div style="font-size: 120%;">{{ i18n.ts._initialAccountSetting.accountCreated }}</div>
|
|
<div>{{ i18n.ts._initialAccountSetting.letsStartAccountSetup }}</div>
|
|
<MkButton primary rounded gradate style="margin: 16px auto 0 auto;" data-cy-user-setup-continue @click="page++">{{ i18n.ts._initialAccountSetting.profileSetting }} <i class="ti ti-arrow-right"></i></MkButton>
|
|
<MkButton style="margin: 0 auto;" transparent rounded @click="later(true)">{{ i18n.ts.later }}</MkButton>
|
|
</div>
|
|
</MkSpacer>
|
|
</div>
|
|
</template>
|
|
<template v-else-if="page === 1">
|
|
<div style="height: 100cqh; overflow: auto;">
|
|
<div :class="$style.pageRoot">
|
|
<MkSpacer :marginMin="20" :marginMax="28" :class="$style.pageMain">
|
|
<XProfile/>
|
|
</MkSpacer>
|
|
<div :class="$style.pageFooter">
|
|
<div class="_buttonsCenter">
|
|
<MkButton rounded data-cy-user-setup-back @click="page--"><i class="ti ti-arrow-left"></i> {{ i18n.ts.goBack }}</MkButton>
|
|
<MkButton primary rounded gradate data-cy-user-setup-continue @click="page++">{{ i18n.ts.continue }} <i class="ti ti-arrow-right"></i></MkButton>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</template>
|
|
<template v-else-if="page === 2">
|
|
<div style="height: 100cqh; overflow: auto;">
|
|
<div :class="$style.pageRoot">
|
|
<MkSpacer :marginMin="20" :marginMax="28" :class="$style.pageMain">
|
|
<XPrivacy/>
|
|
</MkSpacer>
|
|
<div :class="$style.pageFooter">
|
|
<div class="_buttonsCenter">
|
|
<MkButton rounded data-cy-user-setup-back @click="page--"><i class="ti ti-arrow-left"></i> {{ i18n.ts.goBack }}</MkButton>
|
|
<MkButton primary rounded gradate data-cy-user-setup-continue @click="page++">{{ i18n.ts.continue }} <i class="ti ti-arrow-right"></i></MkButton>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</template>
|
|
<template v-else-if="page === 3">
|
|
<div style="height: 100cqh; overflow: auto;">
|
|
<MkSpacer :marginMin="20" :marginMax="28">
|
|
<XFollow/>
|
|
</MkSpacer>
|
|
<div :class="$style.pageFooter">
|
|
<div class="_buttonsCenter">
|
|
<MkButton rounded data-cy-user-setup-back @click="page--"><i class="ti ti-arrow-left"></i> {{ i18n.ts.goBack }}</MkButton>
|
|
<MkButton primary rounded gradate style="" data-cy-user-setup-continue @click="page++">{{ i18n.ts.continue }} <i class="ti ti-arrow-right"></i></MkButton>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</template>
|
|
<template v-else-if="page === 4">
|
|
<div :class="$style.centerPage">
|
|
<MkSpacer :marginMin="20" :marginMax="28">
|
|
<div class="_gaps" style="text-align: center;">
|
|
<i class="ti ti-bell-ringing-2" style="display: block; margin: auto; font-size: 3em; color: var(--MI_THEME-accent);"></i>
|
|
<div style="font-size: 120%;">{{ i18n.ts.pushNotification }}</div>
|
|
<div style="padding: 0 16px;">{{ i18n.tsx._initialAccountSetting.pushNotificationDescription({ name: instance.name ?? host }) }}</div>
|
|
<MkPushNotificationAllowButton primary showOnlyToRegister style="margin: 0 auto;"/>
|
|
<div class="_buttonsCenter" style="margin-top: 16px;">
|
|
<MkButton rounded data-cy-user-setup-back @click="page--"><i class="ti ti-arrow-left"></i> {{ i18n.ts.goBack }}</MkButton>
|
|
<MkButton primary rounded gradate data-cy-user-setup-continue @click="page++">{{ i18n.ts.continue }} <i class="ti ti-arrow-right"></i></MkButton>
|
|
</div>
|
|
</div>
|
|
</MkSpacer>
|
|
</div>
|
|
</template>
|
|
<template v-else-if="page === 5">
|
|
<div :class="$style.centerPage">
|
|
<MkAnimBg style="position: absolute; top: 0;" :scale="1.5"/>
|
|
<MkSpacer :marginMin="20" :marginMax="28">
|
|
<div class="_gaps" style="text-align: center;">
|
|
<i class="ti ti-check" style="display: block; margin: auto; font-size: 3em; color: var(--MI_THEME-accent);"></i>
|
|
<div style="font-size: 120%;">{{ i18n.ts._initialAccountSetting.initialAccountSettingCompleted }}</div>
|
|
<div>{{ i18n.tsx._initialAccountSetting.youCanContinueTutorial({ name: instance.name ?? host }) }}</div>
|
|
<div class="_buttonsCenter" style="margin-top: 16px;">
|
|
<MkButton rounded primary gradate data-cy-user-setup-continue @click="launchTutorial()">{{ i18n.ts._initialAccountSetting.startTutorial }} <i class="ti ti-arrow-right"></i></MkButton>
|
|
</div>
|
|
<div class="_buttonsCenter">
|
|
<MkButton rounded data-cy-user-setup-back @click="page--"><i class="ti ti-arrow-left"></i> {{ i18n.ts.goBack }}</MkButton>
|
|
<MkButton rounded primary data-cy-user-setup-continue @click="setupComplete()">{{ i18n.ts.close }}</MkButton>
|
|
</div>
|
|
</div>
|
|
</MkSpacer>
|
|
</div>
|
|
</template>
|
|
</Transition>
|
|
</div>
|
|
</MkModalWindow>
|
|
</template>
|
|
|
|
<script lang="ts" setup>
|
|
import { ref, shallowRef, watch, nextTick, defineAsyncComponent } from 'vue';
|
|
import MkModalWindow from '@/components/MkModalWindow.vue';
|
|
import MkButton from '@/components/MkButton.vue';
|
|
import XProfile from '@/components/MkUserSetupDialog.Profile.vue';
|
|
import XFollow from '@/components/MkUserSetupDialog.Follow.vue';
|
|
import XPrivacy from '@/components/MkUserSetupDialog.Privacy.vue';
|
|
import MkAnimBg from '@/components/MkAnimBg.vue';
|
|
import { i18n } from '@/i18n.js';
|
|
import { instance } from '@/instance.js';
|
|
import { host } from '@@/js/config.js';
|
|
import MkPushNotificationAllowButton from '@/components/MkPushNotificationAllowButton.vue';
|
|
import { store } from '@/store.js';
|
|
import * as os from '@/os.js';
|
|
|
|
const emit = defineEmits<{
|
|
(ev: 'closed'): void;
|
|
}>();
|
|
|
|
const dialog = shallowRef<InstanceType<typeof MkModalWindow>>();
|
|
|
|
// eslint-disable-next-line vue/no-setup-props-reactivity-loss
|
|
const page = ref(store.state.accountSetupWizard);
|
|
|
|
watch(page, () => {
|
|
store.set('accountSetupWizard', page.value);
|
|
});
|
|
|
|
async function close(skip: boolean) {
|
|
if (skip) {
|
|
const { canceled } = await os.confirm({
|
|
type: 'warning',
|
|
text: i18n.ts._initialAccountSetting.skipAreYouSure,
|
|
});
|
|
if (canceled) return;
|
|
}
|
|
|
|
dialog.value?.close();
|
|
store.set('accountSetupWizard', -1);
|
|
}
|
|
|
|
function setupComplete() {
|
|
store.set('accountSetupWizard', -1);
|
|
dialog.value?.close();
|
|
}
|
|
|
|
function launchTutorial() {
|
|
setupComplete();
|
|
nextTick(() => {
|
|
const { dispose } = os.popup(defineAsyncComponent(() => import('@/components/MkTutorialDialog.vue')), {
|
|
initialPage: 1,
|
|
}, {
|
|
closed: () => dispose(),
|
|
});
|
|
});
|
|
}
|
|
|
|
async function later(later: boolean) {
|
|
if (later) {
|
|
const { canceled } = await os.confirm({
|
|
type: 'warning',
|
|
text: i18n.ts._initialAccountSetting.laterAreYouSure,
|
|
});
|
|
if (canceled) return;
|
|
}
|
|
|
|
dialog.value?.close();
|
|
store.set('accountSetupWizard', 0);
|
|
}
|
|
</script>
|
|
|
|
<style lang="scss" module>
|
|
.transition_x_enterActive,
|
|
.transition_x_leaveActive {
|
|
transition: opacity 0.3s cubic-bezier(0,0,.35,1), transform 0.3s cubic-bezier(0,0,.35,1);
|
|
}
|
|
.transition_x_enterFrom {
|
|
opacity: 0;
|
|
transform: translateX(50px);
|
|
}
|
|
.transition_x_leaveTo {
|
|
opacity: 0;
|
|
transform: translateX(-50px);
|
|
}
|
|
|
|
.progressBar {
|
|
position: absolute;
|
|
top: 0;
|
|
left: 0;
|
|
z-index: 10;
|
|
width: 100%;
|
|
height: 4px;
|
|
}
|
|
|
|
.progressBarValue {
|
|
height: 100%;
|
|
background: linear-gradient(90deg, var(--MI_THEME-buttonGradateA), var(--MI_THEME-buttonGradateB));
|
|
transition: all 0.5s cubic-bezier(0,.5,.5,1);
|
|
}
|
|
|
|
.centerPage {
|
|
display: flex;
|
|
justify-content: center;
|
|
align-items: center;
|
|
height: 100cqh;
|
|
padding-bottom: 30px;
|
|
box-sizing: border-box;
|
|
}
|
|
|
|
.pageRoot {
|
|
display: flex;
|
|
flex-direction: column;
|
|
min-height: 100%;
|
|
}
|
|
|
|
.pageMain {
|
|
flex-grow: 1;
|
|
}
|
|
|
|
.pageFooter {
|
|
position: sticky;
|
|
bottom: 0;
|
|
left: 0;
|
|
flex-shrink: 0;
|
|
padding: 12px;
|
|
border-top: solid 0.5px var(--MI_THEME-divider);
|
|
-webkit-backdrop-filter: blur(15px);
|
|
backdrop-filter: blur(15px);
|
|
}
|
|
</style>
|