2022-11-09 08:48:03 +01:00
|
|
|
<template>
|
2023-04-08 02:01:42 +02:00
|
|
|
<XModalWindow
|
|
|
|
ref="dialog"
|
|
|
|
:width="800"
|
|
|
|
@close="dialog?.close()"
|
|
|
|
@closed="$emit('closed')"
|
|
|
|
>
|
|
|
|
<template #header>{{ i18n.ts._tutorial.title }}</template>
|
|
|
|
|
|
|
|
<div class="_monolithic_">
|
|
|
|
<div class="_section">
|
|
|
|
<div class="tbkwesmv">
|
|
|
|
<div class="_footer navigation">
|
|
|
|
<div class="step">
|
|
|
|
<button
|
|
|
|
class="arrow _button"
|
|
|
|
:disabled="tutorial === 0"
|
|
|
|
@click="tutorial--"
|
|
|
|
>
|
|
|
|
<i class="ph-caret-left ph-bold ph-lg"></i>
|
|
|
|
</button>
|
|
|
|
<span>{{ tutorial + 1 }} / 6</span>
|
|
|
|
<button
|
|
|
|
class="arrow _button"
|
|
|
|
:disabled="tutorial === 5"
|
|
|
|
@click="tutorial++"
|
|
|
|
>
|
|
|
|
<i class="ph-caret-right ph-bold ph-lg"></i>
|
|
|
|
</button>
|
|
|
|
</div>
|
|
|
|
<MkButton
|
|
|
|
v-if="tutorial === 5"
|
|
|
|
class="ok"
|
|
|
|
primary
|
|
|
|
@click="close"
|
|
|
|
><i class="ph-check ph-bold ph-lg"></i>
|
|
|
|
{{ i18n.ts.gotIt }}</MkButton
|
|
|
|
>
|
|
|
|
<MkButton v-else class="ok" primary @click="tutorial++"
|
|
|
|
><i class="ph-check ph-bold ph-lg"></i>
|
|
|
|
{{ i18n.ts.next }}</MkButton
|
|
|
|
>
|
2022-11-09 09:43:27 +01:00
|
|
|
</div>
|
2023-04-08 02:01:42 +02:00
|
|
|
<Transition name="fade">
|
2023-05-13 03:19:56 +02:00
|
|
|
<section v-if="tutorial === 0" key="1" class="_content">
|
|
|
|
<h2 class="_title title">
|
|
|
|
<i class="ph-info ph-bold ph-lg"></i>
|
|
|
|
{{ i18n.ts._tutorial.title }}
|
|
|
|
</h2>
|
2023-04-08 02:01:42 +02:00
|
|
|
<h3>{{ i18n.ts._tutorial.step1_1 }}</h3>
|
|
|
|
<div>{{ i18n.ts._tutorial.step1_2 }}</div>
|
2023-05-13 05:11:41 +02:00
|
|
|
<!-- TODO: move to own slide -->
|
2023-05-13 05:05:25 +02:00
|
|
|
<!-- <FormSwitch v-model="autoplayMfm" class="_formBlock">
|
2023-05-13 03:19:56 +02:00
|
|
|
{{ i18n.ts._mfm.alwaysPlay }}
|
|
|
|
<template #caption>
|
|
|
|
<i class="ph-warning ph-bold ph-lg" style="color: var(--warn)"></i>
|
|
|
|
{{ i18n.ts._mfm.warn }}
|
|
|
|
</template>
|
2023-05-13 05:05:25 +02:00
|
|
|
</FormSwitch> -->
|
2023-05-15 00:20:26 +02:00
|
|
|
<FormSwitch
|
|
|
|
v-model="reduceAnimation"
|
|
|
|
class="_formBlock"
|
|
|
|
>
|
2023-05-13 03:19:56 +02:00
|
|
|
{{ i18n.ts.reduceUiAnimation }}
|
|
|
|
</FormSwitch>
|
|
|
|
</section>
|
|
|
|
<section
|
2023-04-08 02:01:42 +02:00
|
|
|
v-else-if="tutorial === 1"
|
|
|
|
key="2"
|
|
|
|
class="_content"
|
|
|
|
>
|
|
|
|
<h3>{{ i18n.ts._tutorial.step2_1 }}</h3>
|
|
|
|
<div>{{ i18n.ts._tutorial.step2_2 }}</div>
|
|
|
|
<br />
|
|
|
|
<XSettings :save-button="true" />
|
|
|
|
<br />
|
2023-05-13 03:19:56 +02:00
|
|
|
</section>
|
|
|
|
<section
|
2023-04-08 02:01:42 +02:00
|
|
|
v-else-if="tutorial === 2"
|
|
|
|
key="3"
|
|
|
|
class="_content"
|
|
|
|
>
|
|
|
|
<h3>{{ i18n.ts._tutorial.step3_1 }}</h3>
|
|
|
|
<div>{{ i18n.ts._tutorial.step3_2 }}</div>
|
|
|
|
<XFeaturedUsers />
|
|
|
|
<br />
|
|
|
|
<MkButton class="ok" primary @click="tutorial++"
|
|
|
|
><i class="ph-check ph-bold ph-lg"></i>
|
|
|
|
{{ i18n.ts.next }}</MkButton
|
|
|
|
>
|
2023-05-13 03:19:56 +02:00
|
|
|
</section>
|
|
|
|
<section
|
2023-04-08 02:01:42 +02:00
|
|
|
v-else-if="tutorial === 3"
|
|
|
|
key="4"
|
|
|
|
class="_content"
|
|
|
|
>
|
|
|
|
<h3>{{ i18n.ts._tutorial.step4_1 }}</h3>
|
|
|
|
<I18n :src="i18n.ts._tutorial.step4_2" tag="div">
|
|
|
|
<template #introduction>
|
|
|
|
<MkA class="_link" to="/tags/introduction"
|
|
|
|
>#introduction</MkA
|
|
|
|
>
|
|
|
|
</template>
|
|
|
|
</I18n>
|
|
|
|
<br />
|
2023-05-20 00:41:59 +02:00
|
|
|
<XPostForm
|
|
|
|
class="post-form _block"
|
|
|
|
:show-mfm-cheat-sheet="false"
|
|
|
|
/>
|
2023-05-13 03:19:56 +02:00
|
|
|
</section>
|
|
|
|
<section
|
2023-04-08 02:01:42 +02:00
|
|
|
v-else-if="tutorial === 4"
|
|
|
|
key="5"
|
|
|
|
class="_content"
|
|
|
|
>
|
|
|
|
<h3>{{ i18n.ts._tutorial.step5_1 }}</h3>
|
|
|
|
<I18n :src="i18n.ts._tutorial.step5_2" tag="div">
|
|
|
|
<template #timelines>
|
|
|
|
<span>{{ timelines.length }}</span>
|
|
|
|
</template>
|
|
|
|
</I18n>
|
|
|
|
<ul>
|
|
|
|
<li>
|
|
|
|
<I18n
|
|
|
|
:src="i18n.ts._tutorial.step5_3"
|
|
|
|
tag="div"
|
|
|
|
>
|
|
|
|
<template #icon>
|
|
|
|
<i class="ph-house ph-bold ph-lg" />
|
|
|
|
</template>
|
|
|
|
</I18n>
|
|
|
|
</li>
|
|
|
|
<li v-if="timelines.includes('local')">
|
|
|
|
<I18n
|
|
|
|
:src="i18n.ts._tutorial.step5_4"
|
|
|
|
tag="div"
|
|
|
|
>
|
|
|
|
<template #icon>
|
|
|
|
<i class="ph-users ph-bold ph-lg" />
|
|
|
|
</template>
|
|
|
|
</I18n>
|
|
|
|
</li>
|
2023-06-03 08:24:16 +02:00
|
|
|
<li v-if="timelines.includes('social')">
|
2023-04-08 02:01:42 +02:00
|
|
|
<I18n
|
|
|
|
:src="i18n.ts._tutorial.step5_5"
|
|
|
|
tag="div"
|
|
|
|
>
|
|
|
|
<template #icon>
|
|
|
|
<i
|
2023-06-03 08:24:16 +02:00
|
|
|
class="ph-handshake ph-bold ph-lg"
|
2023-04-08 02:01:42 +02:00
|
|
|
/>
|
|
|
|
</template>
|
|
|
|
</I18n>
|
|
|
|
</li>
|
2023-06-03 08:24:16 +02:00
|
|
|
<li v-if="timelines.includes('recommended')">
|
2023-04-08 02:01:42 +02:00
|
|
|
<I18n
|
|
|
|
:src="i18n.ts._tutorial.step5_6"
|
|
|
|
tag="div"
|
|
|
|
>
|
|
|
|
<template #icon>
|
|
|
|
<i
|
2023-06-03 08:24:16 +02:00
|
|
|
class="ph-thumbs-up ph-bold ph-lg"
|
2023-04-08 02:01:42 +02:00
|
|
|
/>
|
|
|
|
</template>
|
|
|
|
</I18n>
|
|
|
|
</li>
|
|
|
|
<li v-if="timelines.includes('global')">
|
|
|
|
<I18n
|
|
|
|
:src="i18n.ts._tutorial.step5_7"
|
|
|
|
tag="div"
|
|
|
|
>
|
|
|
|
<template #icon>
|
|
|
|
<i
|
|
|
|
class="ph-planet ph-bold ph-lg"
|
|
|
|
/>
|
|
|
|
</template>
|
|
|
|
</I18n>
|
|
|
|
</li>
|
|
|
|
</ul>
|
2023-05-13 03:19:56 +02:00
|
|
|
</section>
|
|
|
|
<section
|
2023-04-08 02:01:42 +02:00
|
|
|
v-else-if="tutorial === 5"
|
|
|
|
key="6"
|
|
|
|
class="_content"
|
|
|
|
>
|
|
|
|
<h3>{{ i18n.ts._tutorial.step6_1 }}</h3>
|
|
|
|
<div>{{ i18n.ts._tutorial.step6_2 }}</div>
|
|
|
|
<div>{{ i18n.ts._tutorial.step6_3 }}</div>
|
|
|
|
<br />
|
|
|
|
<MkSparkle>
|
|
|
|
<h3>
|
|
|
|
{{ i18n.ts._tutorial.step6_4 }}
|
|
|
|
<Mfm text="$[shake 🚀]"></Mfm>
|
|
|
|
</h3>
|
|
|
|
</MkSparkle>
|
|
|
|
<MkPushNotificationAllowButton
|
|
|
|
primary
|
|
|
|
show-only-to-register
|
|
|
|
/>
|
2023-05-13 05:11:41 +02:00
|
|
|
</section>
|
2023-04-08 02:01:42 +02:00
|
|
|
</Transition>
|
2022-11-09 09:43:27 +01:00
|
|
|
</div>
|
2022-11-09 08:55:37 +01:00
|
|
|
</div>
|
2022-11-09 08:48:03 +01:00
|
|
|
</div>
|
2023-04-08 02:01:42 +02:00
|
|
|
</XModalWindow>
|
2022-11-09 08:48:03 +01:00
|
|
|
</template>
|
|
|
|
|
|
|
|
<script lang="ts" setup>
|
2023-08-12 02:44:46 +02:00
|
|
|
import { computed, ref } from "vue";
|
2023-04-08 02:01:42 +02:00
|
|
|
import XSettings from "@/pages/settings/profile.vue";
|
|
|
|
import XModalWindow from "@/components/MkModalWindow.vue";
|
|
|
|
import MkButton from "@/components/MkButton.vue";
|
|
|
|
import XFeaturedUsers from "@/pages/explore.users.vue";
|
|
|
|
import XPostForm from "@/components/MkPostForm.vue";
|
|
|
|
import MkSparkle from "@/components/MkSparkle.vue";
|
|
|
|
import MkPushNotificationAllowButton from "@/components/MkPushNotificationAllowButton.vue";
|
2023-05-13 03:19:56 +02:00
|
|
|
import FormSwitch from "@/components/form/switch.vue";
|
2023-04-08 02:01:42 +02:00
|
|
|
import { defaultStore } from "@/store";
|
|
|
|
import { i18n } from "@/i18n";
|
|
|
|
import { $i } from "@/account";
|
|
|
|
import { instance } from "@/instance";
|
2022-11-09 09:38:05 +01:00
|
|
|
|
|
|
|
const isLocalTimelineAvailable =
|
|
|
|
!instance.disableLocalTimeline ||
|
|
|
|
($i != null && ($i.isModerator || $i.isAdmin));
|
|
|
|
const isRecommendedTimelineAvailable =
|
|
|
|
!instance.disableRecommendedTimeline ||
|
|
|
|
($i != null && ($i.isModerator || $i.isAdmin));
|
|
|
|
const isGlobalTimelineAvailable =
|
|
|
|
!instance.disableGlobalTimeline ||
|
|
|
|
($i != null && ($i.isModerator || $i.isAdmin));
|
|
|
|
|
2023-09-02 01:27:33 +02:00
|
|
|
const timelines = ["home"];
|
2022-11-09 09:38:05 +01:00
|
|
|
|
|
|
|
if (isLocalTimelineAvailable) {
|
2023-04-08 02:01:42 +02:00
|
|
|
timelines.push("local");
|
2022-11-09 09:38:05 +01:00
|
|
|
}
|
|
|
|
if (isLocalTimelineAvailable) {
|
2023-04-08 02:01:42 +02:00
|
|
|
timelines.push("social");
|
2022-11-09 09:38:05 +01:00
|
|
|
}
|
2023-06-03 08:24:16 +02:00
|
|
|
if (isRecommendedTimelineAvailable) {
|
|
|
|
timelines.push("recommended");
|
|
|
|
}
|
2022-11-09 09:38:05 +01:00
|
|
|
if (isGlobalTimelineAvailable) {
|
2023-04-08 02:01:42 +02:00
|
|
|
timelines.push("global");
|
2022-11-09 09:38:05 +01:00
|
|
|
}
|
2022-11-09 08:48:03 +01:00
|
|
|
|
|
|
|
const emit = defineEmits<{
|
2023-04-08 02:01:42 +02:00
|
|
|
(ev: "done"): void;
|
|
|
|
(ev: "closed"): void;
|
2022-11-09 08:48:03 +01:00
|
|
|
}>();
|
|
|
|
|
2023-08-12 02:44:46 +02:00
|
|
|
const dialog = ref<InstanceType<typeof XModalWindow>>();
|
2022-11-09 08:48:03 +01:00
|
|
|
|
|
|
|
const tutorial = computed({
|
2023-04-08 02:01:42 +02:00
|
|
|
get() {
|
|
|
|
return defaultStore.reactiveState.tutorial.value || 0;
|
|
|
|
},
|
|
|
|
set(value) {
|
|
|
|
defaultStore.set("tutorial", value);
|
|
|
|
},
|
2022-11-09 08:48:03 +01:00
|
|
|
});
|
|
|
|
|
2023-05-13 03:19:56 +02:00
|
|
|
const autoplayMfm = computed(
|
|
|
|
defaultStore.makeGetterSetter(
|
|
|
|
"animatedMfm",
|
|
|
|
(v) => !v,
|
2023-07-06 03:28:27 +02:00
|
|
|
(v) => !v,
|
|
|
|
),
|
2023-05-13 03:19:56 +02:00
|
|
|
);
|
|
|
|
const reduceAnimation = computed(
|
|
|
|
defaultStore.makeGetterSetter(
|
|
|
|
"animation",
|
|
|
|
(v) => !v,
|
2023-07-06 03:28:27 +02:00
|
|
|
(v) => !v,
|
|
|
|
),
|
2023-05-13 03:19:56 +02:00
|
|
|
);
|
|
|
|
|
2022-11-09 08:48:03 +01:00
|
|
|
function close(res) {
|
|
|
|
tutorial.value = -1;
|
2023-08-12 02:44:46 +02:00
|
|
|
dialog.value.close();
|
2022-11-09 08:48:03 +01:00
|
|
|
}
|
|
|
|
</script>
|
|
|
|
|
|
|
|
<style lang="scss" scoped>
|
2022-11-09 19:38:18 +01:00
|
|
|
.fade-enter-active,
|
|
|
|
.fade-leave-active {
|
2022-11-09 20:09:15 +01:00
|
|
|
transition: opacity 0.2s ease-in-out;
|
2022-11-09 19:38:18 +01:00
|
|
|
}
|
|
|
|
.fade-enter-from,
|
|
|
|
.fade-leave-to {
|
|
|
|
opacity: 0;
|
|
|
|
}
|
|
|
|
|
2022-11-09 08:48:03 +01:00
|
|
|
.tbkwesmv {
|
|
|
|
> ._content {
|
|
|
|
> small {
|
|
|
|
opacity: 0.7;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
> .navigation {
|
|
|
|
display: flex;
|
|
|
|
flex-direction: row;
|
|
|
|
align-items: baseline;
|
|
|
|
|
|
|
|
> .step {
|
|
|
|
> .arrow {
|
|
|
|
padding: 4px;
|
|
|
|
|
|
|
|
&:disabled {
|
|
|
|
opacity: 0.5;
|
|
|
|
}
|
|
|
|
|
|
|
|
&:first-child {
|
|
|
|
padding-right: 8px;
|
|
|
|
}
|
|
|
|
|
|
|
|
&:last-child {
|
|
|
|
padding-left: 8px;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
> span {
|
|
|
|
margin: 0 4px;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
> .ok {
|
|
|
|
margin-left: auto;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
</style>
|