hippofish/packages/client/src/pages/mfm-cheat-sheet.vue

388 lines
13 KiB
Vue
Raw Normal View History

2020-11-08 07:24:46 +01:00
<template>
<MkStickyContainer>
<template #header><MkPageHeader/></template>
2022-07-19 10:13:24 +02:00
<MkSpacer :content-max="800">
<div class="mwysmxbg">
2022-07-20 15:24:26 +02:00
<div>{{ i18n.ts._mfm.intro }}</div>
2022-07-19 10:13:24 +02:00
<div class="section _block">
2022-07-20 15:24:26 +02:00
<div class="title">{{ i18n.ts._mfm.mention }}</div>
2022-07-19 10:13:24 +02:00
<div class="content">
2022-07-20 15:24:26 +02:00
<p>{{ i18n.ts._mfm.mentionDescription }}</p>
2022-07-19 10:13:24 +02:00
<div class="preview">
<Mfm :text="preview_mention"/>
<MkTextarea v-model="preview_mention"><template #label>MFM</template></MkTextarea>
</div>
</div>
2020-11-08 07:24:46 +01:00
</div>
2022-07-19 10:13:24 +02:00
<div class="section _block">
2022-07-20 15:24:26 +02:00
<div class="title">{{ i18n.ts._mfm.hashtag }}</div>
2022-07-19 10:13:24 +02:00
<div class="content">
2022-07-20 15:24:26 +02:00
<p>{{ i18n.ts._mfm.hashtagDescription }}</p>
2022-07-19 10:13:24 +02:00
<div class="preview">
<Mfm :text="preview_hashtag"/>
<MkTextarea v-model="preview_hashtag"><template #label>MFM</template></MkTextarea>
</div>
</div>
2020-11-08 07:24:46 +01:00
</div>
2022-07-19 10:13:24 +02:00
<div class="section _block">
2022-07-20 15:24:26 +02:00
<div class="title">{{ i18n.ts._mfm.url }}</div>
2022-07-19 10:13:24 +02:00
<div class="content">
2022-07-20 15:24:26 +02:00
<p>{{ i18n.ts._mfm.urlDescription }}</p>
2022-07-19 10:13:24 +02:00
<div class="preview">
<Mfm :text="preview_url"/>
<MkTextarea v-model="preview_url"><template #label>MFM</template></MkTextarea>
</div>
</div>
2020-11-08 07:24:46 +01:00
</div>
2022-07-19 10:13:24 +02:00
<div class="section _block">
2022-07-20 15:24:26 +02:00
<div class="title">{{ i18n.ts._mfm.link }}</div>
2022-07-19 10:13:24 +02:00
<div class="content">
2022-07-20 15:24:26 +02:00
<p>{{ i18n.ts._mfm.linkDescription }}</p>
2022-07-19 10:13:24 +02:00
<div class="preview">
<Mfm :text="preview_link"/>
<MkTextarea v-model="preview_link"><template #label>MFM</template></MkTextarea>
</div>
</div>
2020-11-08 07:24:46 +01:00
</div>
2022-07-19 10:13:24 +02:00
<div class="section _block">
2022-07-20 15:24:26 +02:00
<div class="title">{{ i18n.ts._mfm.emoji }}</div>
2022-07-19 10:13:24 +02:00
<div class="content">
2022-07-20 15:24:26 +02:00
<p>{{ i18n.ts._mfm.emojiDescription }}</p>
2022-07-19 10:13:24 +02:00
<div class="preview">
<Mfm :text="preview_emoji"/>
<MkTextarea v-model="preview_emoji"><template #label>MFM</template></MkTextarea>
</div>
</div>
2020-11-08 07:24:46 +01:00
</div>
2022-07-19 10:13:24 +02:00
<div class="section _block">
2022-07-20 15:24:26 +02:00
<div class="title">{{ i18n.ts._mfm.bold }}</div>
2022-07-19 10:13:24 +02:00
<div class="content">
2022-07-20 15:24:26 +02:00
<p>{{ i18n.ts._mfm.boldDescription }}</p>
2022-07-19 10:13:24 +02:00
<div class="preview">
<Mfm :text="preview_bold"/>
<MkTextarea v-model="preview_bold"><template #label>MFM</template></MkTextarea>
</div>
</div>
2020-11-08 07:24:46 +01:00
</div>
2022-07-19 10:13:24 +02:00
<div class="section _block">
2022-07-20 15:24:26 +02:00
<div class="title">{{ i18n.ts._mfm.small }}</div>
2022-07-19 10:13:24 +02:00
<div class="content">
2022-07-20 15:24:26 +02:00
<p>{{ i18n.ts._mfm.smallDescription }}</p>
2022-07-19 10:13:24 +02:00
<div class="preview">
<Mfm :text="preview_small"/>
<MkTextarea v-model="preview_small"><template #label>MFM</template></MkTextarea>
</div>
</div>
2020-11-08 07:24:46 +01:00
</div>
2022-07-19 10:13:24 +02:00
<div class="section _block">
2022-07-20 15:24:26 +02:00
<div class="title">{{ i18n.ts._mfm.quote }}</div>
2022-07-19 10:13:24 +02:00
<div class="content">
2022-07-20 15:24:26 +02:00
<p>{{ i18n.ts._mfm.quoteDescription }}</p>
2022-07-19 10:13:24 +02:00
<div class="preview">
<Mfm :text="preview_quote"/>
<MkTextarea v-model="preview_quote"><template #label>MFM</template></MkTextarea>
</div>
</div>
2020-11-08 08:14:49 +01:00
</div>
2022-07-19 10:13:24 +02:00
<div class="section _block">
2022-07-20 15:24:26 +02:00
<div class="title">{{ i18n.ts._mfm.center }}</div>
2022-07-19 10:13:24 +02:00
<div class="content">
2022-07-20 15:24:26 +02:00
<p>{{ i18n.ts._mfm.centerDescription }}</p>
2022-07-19 10:13:24 +02:00
<div class="preview">
<Mfm :text="preview_center"/>
<MkTextarea v-model="preview_center"><template #label>MFM</template></MkTextarea>
</div>
</div>
2020-11-08 07:24:46 +01:00
</div>
2022-07-19 10:13:24 +02:00
<div class="section _block">
2022-07-20 15:24:26 +02:00
<div class="title">{{ i18n.ts._mfm.inlineCode }}</div>
2022-07-19 10:13:24 +02:00
<div class="content">
2022-07-20 15:24:26 +02:00
<p>{{ i18n.ts._mfm.inlineCodeDescription }}</p>
2022-07-19 10:13:24 +02:00
<div class="preview">
<Mfm :text="preview_inlineCode"/>
<MkTextarea v-model="preview_inlineCode"><template #label>MFM</template></MkTextarea>
</div>
</div>
2020-11-08 07:24:46 +01:00
</div>
2022-07-19 10:13:24 +02:00
<div class="section _block">
2022-07-20 15:24:26 +02:00
<div class="title">{{ i18n.ts._mfm.blockCode }}</div>
2022-07-19 10:13:24 +02:00
<div class="content">
2022-07-20 15:24:26 +02:00
<p>{{ i18n.ts._mfm.blockCodeDescription }}</p>
2022-07-19 10:13:24 +02:00
<div class="preview">
<Mfm :text="preview_blockCode"/>
<MkTextarea v-model="preview_blockCode"><template #label>MFM</template></MkTextarea>
</div>
</div>
2020-11-08 07:24:46 +01:00
</div>
2022-07-19 10:13:24 +02:00
<div class="section _block">
2022-07-20 15:24:26 +02:00
<div class="title">{{ i18n.ts._mfm.inlineMath }}</div>
2022-07-19 10:13:24 +02:00
<div class="content">
2022-07-20 15:24:26 +02:00
<p>{{ i18n.ts._mfm.inlineMathDescription }}</p>
2022-07-19 10:13:24 +02:00
<div class="preview">
<Mfm :text="preview_inlineMath"/>
<MkTextarea v-model="preview_inlineMath"><template #label>MFM</template></MkTextarea>
</div>
</div>
</div>
<!-- deprecated
<div class="section _block">
2022-07-20 15:24:26 +02:00
<div class="title">{{ i18n.ts._mfm.search }}</div>
<div class="content">
2022-07-20 15:24:26 +02:00
<p>{{ i18n.ts._mfm.searchDescription }}</p>
<div class="preview">
2022-07-19 10:13:24 +02:00
<Mfm :text="preview_search"/>
<MkTextarea v-model="preview_search"><template #label>MFM</template></MkTextarea>
</div>
2020-11-08 07:24:46 +01:00
</div>
</div>
2022-07-19 10:13:24 +02:00
-->
<div class="section _block">
2022-07-20 15:24:26 +02:00
<div class="title">{{ i18n.ts._mfm.flip }}</div>
2022-07-19 10:13:24 +02:00
<div class="content">
2022-07-20 15:24:26 +02:00
<p>{{ i18n.ts._mfm.flipDescription }}</p>
2022-07-19 10:13:24 +02:00
<div class="preview">
<Mfm :text="preview_flip"/>
<MkTextarea v-model="preview_flip"><template #label>MFM</template></MkTextarea>
</div>
</div>
2020-11-08 07:24:46 +01:00
</div>
2022-07-19 10:13:24 +02:00
<div class="section _block">
2022-07-20 15:24:26 +02:00
<div class="title">{{ i18n.ts._mfm.font }}</div>
2022-07-19 10:13:24 +02:00
<div class="content">
2022-07-20 15:24:26 +02:00
<p>{{ i18n.ts._mfm.fontDescription }}</p>
2022-07-19 10:13:24 +02:00
<div class="preview">
<Mfm :text="preview_font"/>
<MkTextarea v-model="preview_font"><template #label>MFM</template></MkTextarea>
</div>
</div>
2020-11-08 07:24:46 +01:00
</div>
2022-07-19 10:13:24 +02:00
<div class="section _block">
2022-07-20 15:24:26 +02:00
<div class="title">{{ i18n.ts._mfm.x2 }}</div>
2022-07-19 10:13:24 +02:00
<div class="content">
2022-07-20 15:24:26 +02:00
<p>{{ i18n.ts._mfm.x2Description }}</p>
2022-07-19 10:13:24 +02:00
<div class="preview">
<Mfm :text="preview_x2"/>
<MkTextarea v-model="preview_x2"><template #label>MFM</template></MkTextarea>
</div>
</div>
2020-12-31 11:42:23 +01:00
</div>
2022-07-19 10:13:24 +02:00
<div class="section _block">
2022-07-20 15:24:26 +02:00
<div class="title">{{ i18n.ts._mfm.x3 }}</div>
2022-07-19 10:13:24 +02:00
<div class="content">
2022-07-20 15:24:26 +02:00
<p>{{ i18n.ts._mfm.x3Description }}</p>
2022-07-19 10:13:24 +02:00
<div class="preview">
<Mfm :text="preview_x3"/>
<MkTextarea v-model="preview_x3"><template #label>MFM</template></MkTextarea>
</div>
</div>
2020-12-30 18:51:51 +01:00
</div>
2022-07-19 10:13:24 +02:00
<div class="section _block">
2022-07-20 15:24:26 +02:00
<div class="title">{{ i18n.ts._mfm.x4 }}</div>
2022-07-19 10:13:24 +02:00
<div class="content">
2022-07-20 15:24:26 +02:00
<p>{{ i18n.ts._mfm.x4Description }}</p>
2022-07-19 10:13:24 +02:00
<div class="preview">
<Mfm :text="preview_x4"/>
<MkTextarea v-model="preview_x4"><template #label>MFM</template></MkTextarea>
</div>
</div>
2020-12-30 18:51:51 +01:00
</div>
2022-07-19 10:13:24 +02:00
<div class="section _block">
2022-07-20 15:24:26 +02:00
<div class="title">{{ i18n.ts._mfm.blur }}</div>
2022-07-19 10:13:24 +02:00
<div class="content">
2022-07-20 15:24:26 +02:00
<p>{{ i18n.ts._mfm.blurDescription }}</p>
2022-07-19 10:13:24 +02:00
<div class="preview">
<Mfm :text="preview_blur"/>
<MkTextarea v-model="preview_blur"><template #label>MFM</template></MkTextarea>
</div>
</div>
2020-12-30 18:51:51 +01:00
</div>
2022-07-19 10:13:24 +02:00
<div class="section _block">
2022-07-20 15:24:26 +02:00
<div class="title">{{ i18n.ts._mfm.jelly }}</div>
2022-07-19 10:13:24 +02:00
<div class="content">
2022-07-20 15:24:26 +02:00
<p>{{ i18n.ts._mfm.jellyDescription }}</p>
2022-07-19 10:13:24 +02:00
<div class="preview">
<Mfm :text="preview_jelly"/>
<MkTextarea v-model="preview_jelly"><template #label>MFM</template></MkTextarea>
</div>
</div>
2020-12-30 19:02:09 +01:00
</div>
2022-07-19 10:13:24 +02:00
<div class="section _block">
2022-07-20 15:24:26 +02:00
<div class="title">{{ i18n.ts._mfm.tada }}</div>
2022-07-19 10:13:24 +02:00
<div class="content">
2022-07-20 15:24:26 +02:00
<p>{{ i18n.ts._mfm.tadaDescription }}</p>
2022-07-19 10:13:24 +02:00
<div class="preview">
<Mfm :text="preview_tada"/>
<MkTextarea v-model="preview_tada"><template #label>MFM</template></MkTextarea>
</div>
</div>
2020-11-08 07:24:46 +01:00
</div>
2022-07-19 10:13:24 +02:00
<div class="section _block">
2022-07-20 15:24:26 +02:00
<div class="title">{{ i18n.ts._mfm.jump }}</div>
2022-07-19 10:13:24 +02:00
<div class="content">
2022-07-20 15:24:26 +02:00
<p>{{ i18n.ts._mfm.jumpDescription }}</p>
2022-07-19 10:13:24 +02:00
<div class="preview">
<Mfm :text="preview_jump"/>
<MkTextarea v-model="preview_jump"><template #label>MFM</template></MkTextarea>
</div>
</div>
2020-11-08 07:24:46 +01:00
</div>
2022-07-19 10:13:24 +02:00
<div class="section _block">
2022-07-20 15:24:26 +02:00
<div class="title">{{ i18n.ts._mfm.bounce }}</div>
2022-07-19 10:13:24 +02:00
<div class="content">
2022-07-20 15:24:26 +02:00
<p>{{ i18n.ts._mfm.bounceDescription }}</p>
2022-07-19 10:13:24 +02:00
<div class="preview">
<Mfm :text="preview_bounce"/>
<MkTextarea v-model="preview_bounce"><template #label>MFM</template></MkTextarea>
</div>
</div>
2020-11-08 07:24:46 +01:00
</div>
2022-07-19 10:13:24 +02:00
<div class="section _block">
2022-07-20 15:24:26 +02:00
<div class="title">{{ i18n.ts._mfm.spin }}</div>
2022-07-19 10:13:24 +02:00
<div class="content">
2022-07-20 15:24:26 +02:00
<p>{{ i18n.ts._mfm.spinDescription }}</p>
2022-07-19 10:13:24 +02:00
<div class="preview">
<Mfm :text="preview_spin"/>
<MkTextarea v-model="preview_spin"><template #label>MFM</template></MkTextarea>
</div>
</div>
2020-11-08 09:08:51 +01:00
</div>
2022-07-19 10:13:24 +02:00
<div class="section _block">
2022-07-20 15:24:26 +02:00
<div class="title">{{ i18n.ts._mfm.shake }}</div>
2022-07-19 10:13:24 +02:00
<div class="content">
2022-07-20 15:24:26 +02:00
<p>{{ i18n.ts._mfm.shakeDescription }}</p>
2022-07-19 10:13:24 +02:00
<div class="preview">
<Mfm :text="preview_shake"/>
<MkTextarea v-model="preview_shake"><template #label>MFM</template></MkTextarea>
</div>
</div>
2020-11-08 07:24:46 +01:00
</div>
2022-07-19 10:13:24 +02:00
<div class="section _block">
2022-07-20 15:24:26 +02:00
<div class="title">{{ i18n.ts._mfm.twitch }}</div>
2022-07-19 10:13:24 +02:00
<div class="content">
2022-07-20 15:24:26 +02:00
<p>{{ i18n.ts._mfm.twitchDescription }}</p>
2022-07-19 10:13:24 +02:00
<div class="preview">
<Mfm :text="preview_twitch"/>
<MkTextarea v-model="preview_twitch"><template #label>MFM</template></MkTextarea>
</div>
</div>
2020-11-08 07:24:46 +01:00
</div>
2022-07-19 10:13:24 +02:00
<div class="section _block">
2022-07-20 15:24:26 +02:00
<div class="title">{{ i18n.ts._mfm.rainbow }}</div>
2022-07-19 10:13:24 +02:00
<div class="content">
2022-07-20 15:24:26 +02:00
<p>{{ i18n.ts._mfm.rainbowDescription }}</p>
2022-07-19 10:13:24 +02:00
<div class="preview">
<Mfm :text="preview_rainbow"/>
<MkTextarea v-model="preview_rainbow"><template #label>MFM</template></MkTextarea>
</div>
</div>
2020-11-08 07:24:46 +01:00
</div>
2022-07-19 10:13:24 +02:00
<div class="section _block">
2022-07-20 15:24:26 +02:00
<div class="title">{{ i18n.ts._mfm.sparkle }}</div>
2022-07-19 10:13:24 +02:00
<div class="content">
2022-07-20 15:24:26 +02:00
<p>{{ i18n.ts._mfm.sparkleDescription }}</p>
2022-07-19 10:13:24 +02:00
<div class="preview">
<Mfm :text="preview_sparkle"/>
<MkTextarea v-model="preview_sparkle"><span>MFM</span></MkTextarea>
</div>
</div>
2021-08-05 14:55:41 +02:00
</div>
2022-07-19 10:13:24 +02:00
<div class="section _block">
2022-07-20 15:24:26 +02:00
<div class="title">{{ i18n.ts._mfm.rotate }}</div>
2022-07-19 10:13:24 +02:00
<div class="content">
2022-07-20 15:24:26 +02:00
<p>{{ i18n.ts._mfm.rotateDescription }}</p>
2022-07-19 10:13:24 +02:00
<div class="preview">
<Mfm :text="preview_rotate"/>
<MkTextarea v-model="preview_rotate"><span>MFM</span></MkTextarea>
</div>
</div>
</div>
2022-07-19 10:13:24 +02:00
<div class="section _block">
2022-07-20 15:24:26 +02:00
<div class="title">{{ i18n.ts._mfm.plain }}</div>
2022-07-19 10:13:24 +02:00
<div class="content">
2022-07-20 15:24:26 +02:00
<p>{{ i18n.ts._mfm.plainDescription }}</p>
2022-07-19 10:13:24 +02:00
<div class="preview">
<Mfm :text="preview_plain"/>
<MkTextarea v-model="preview_plain"><span>MFM</span></MkTextarea>
</div>
</div>
</div>
</div>
2022-07-19 10:13:24 +02:00
</MkSpacer>
</MkStickyContainer>
2020-11-08 07:24:46 +01:00
</template>
<script lang="ts" setup>
2020-11-08 07:24:46 +01:00
import { defineComponent } from 'vue';
2021-11-11 18:02:25 +01:00
import MkTextarea from '@/components/form/textarea.vue';
import { definePageMetadata } from '@/scripts/page-metadata';
import { i18n } from '@/i18n';
import { instance } from '@/instance';
2020-11-08 07:24:46 +01:00
2022-07-19 10:13:24 +02:00
let preview_mention = $ref('@example');
let preview_hashtag = $ref('#test');
let preview_url = $ref('https://example.com');
let preview_link = $ref(`[${i18n.ts._mfm.dummy}](https://example.com)`);
let preview_emoji = $ref(instance.emojis.length ? `:${instance.emojis[0].name}:` : ':emojiname:');
let preview_bold = $ref(`**${i18n.ts._mfm.dummy}**`);
let preview_small = $ref(`<small>${i18n.ts._mfm.dummy}</small>`);
let preview_center = $ref(`<center>${i18n.ts._mfm.dummy}</center>`);
let preview_inlineCode = $ref('`<: "Hello, world!"`');
let preview_blockCode = $ref('```\n~ (#i, 100) {\n\t<: ? ((i % 15) = 0) "FizzBuzz"\n\t\t.? ((i % 3) = 0) "Fizz"\n\t\t.? ((i % 5) = 0) "Buzz"\n\t\t. i\n}\n```');
let preview_inlineMath = $ref('\\(x= \\frac{-b\' \\pm \\sqrt{(b\')^2-ac}}{a}\\)');
let preview_quote = $ref(`> ${i18n.ts._mfm.dummy}`);
let preview_search = $ref(`${i18n.ts._mfm.dummy} 検索`);
let preview_jelly = $ref('$[jelly 🍮] $[jelly.speed=5s 🍮]');
let preview_tada = $ref('$[tada 🍮] $[tada.speed=5s 🍮]');
let preview_jump = $ref('$[jump 🍮] $[jump.speed=5s 🍮]');
let preview_bounce = $ref('$[bounce 🍮] $[bounce.speed=5s 🍮]');
let preview_shake = $ref('$[shake 🍮] $[shake.speed=5s 🍮]');
let preview_twitch = $ref('$[twitch 🍮] $[twitch.speed=5s 🍮]');
let preview_spin = $ref('$[spin 🍮] $[spin.left 🍮] $[spin.alternate 🍮]\n$[spin.x 🍮] $[spin.x,left 🍮] $[spin.x,alternate 🍮]\n$[spin.y 🍮] $[spin.y,left 🍮] $[spin.y,alternate 🍮]\n\n$[spin.speed=5s 🍮]');
let preview_flip = $ref(`$[flip ${i18n.ts._mfm.dummy}]\n$[flip.v ${i18n.ts._mfm.dummy}]\n$[flip.h,v ${i18n.ts._mfm.dummy}]`);
let preview_font = $ref(`$[font.serif ${i18n.ts._mfm.dummy}]\n$[font.monospace ${i18n.ts._mfm.dummy}]\n$[font.cursive ${i18n.ts._mfm.dummy}]\n$[font.fantasy ${i18n.ts._mfm.dummy}]`);
let preview_x2 = $ref('$[x2 🍮]');
let preview_x3 = $ref('$[x3 🍮]');
let preview_x4 = $ref('$[x4 🍮]');
let preview_blur = $ref(`$[blur ${i18n.ts._mfm.dummy}]`);
let preview_rainbow = $ref('$[rainbow 🍮] $[rainbow.speed=5s 🍮]');
let preview_sparkle = $ref('$[sparkle 🍮]');
let preview_rotate = $ref('$[rotate 🍮]');
let preview_plain = $ref('<plain>**bold** @mention #hashtag `code` $[x2 🍮]</plain>');
2020-11-08 07:24:46 +01:00
definePageMetadata({
title: i18n.ts._mfm.cheatSheet,
icon: 'ti ti-question-circle',
2020-11-08 07:24:46 +01:00
});
</script>
<style lang="scss" scoped>
.mwysmxbg {
2021-08-05 14:55:41 +02:00
background: var(--bg);
2021-04-15 11:02:55 +02:00
> .section {
> .title {
position: sticky;
z-index: 1;
top: var(--stickyTop, 0px);
padding: 16px;
font-weight: bold;
2021-08-11 15:34:45 +02:00
-webkit-backdrop-filter: var(--blur, blur(10px));
backdrop-filter: var(--blur, blur(10px));
2021-04-15 11:02:55 +02:00
background-color: var(--X16);
}
> .content {
> p {
margin: 0;
padding: 16px;
}
> .preview {
border-top: solid 0.5px var(--divider);
padding: 16px;
}
}
2020-11-08 07:24:46 +01:00
}
}
</style>