fix: improve emojigen
This commit is contained in:
parent
b73d50db29
commit
542349855e
@ -834,6 +834,7 @@ emojiSizeFixed: "文字サイズを固定する"
|
|||||||
emojiStretch: "自動で伸縮しない"
|
emojiStretch: "自動で伸縮しない"
|
||||||
emojiGenerate: "生成"
|
emojiGenerate: "生成"
|
||||||
emojiColor: "カラーコード"
|
emojiColor: "カラーコード"
|
||||||
|
colorPicker: "カラーピッカー"
|
||||||
emojiApproval: "絵文字を登録"
|
emojiApproval: "絵文字を登録"
|
||||||
deckOld: "旧デッキ"
|
deckOld: "旧デッキ"
|
||||||
|
|
||||||
|
@ -1,6 +1,14 @@
|
|||||||
<template>
|
<template>
|
||||||
<MkSpacer :content-max="700" :margin-min="16" :margin-max="32">
|
<MkSpacer :content-max="700" :margin-min="16" :margin-max="32">
|
||||||
<div class="cwepdizn _formRoot">
|
<div class="cwepdizn _formRoot">
|
||||||
|
<FormSection>
|
||||||
|
<template #label>{{ $ts.preview }}</template>
|
||||||
|
<p><img :src="previewUrl" class="img" :alt="emojiName" /></p>
|
||||||
|
</FormSection>
|
||||||
|
<FormButton primary class="_formBlock" @click="uploadEmoji">{{ $ts.emojiApproval }}</FormButton>
|
||||||
|
<!-- <FormButton primary class="_formBlock" @click="preview">{{ $ts.emojiGenerate }}</FormButton> -->
|
||||||
|
<FormSection>
|
||||||
|
<template #label>{{ $ts.settings }}</template>
|
||||||
<FormInput v-model="emojiName" class="_formBlock">
|
<FormInput v-model="emojiName" class="_formBlock">
|
||||||
<template #label>{{ $ts.emojiName }}</template>
|
<template #label>{{ $ts.emojiName }}</template>
|
||||||
</FormInput>
|
</FormInput>
|
||||||
@ -16,8 +24,9 @@
|
|||||||
<option value="right"><i class="fas fa-align-right"/></option>
|
<option value="right"><i class="fas fa-align-right"/></option>
|
||||||
</FormRadios>
|
</FormRadios>
|
||||||
|
|
||||||
<FormSection>
|
<FormFolder :default-open="false" class="_formBlock">
|
||||||
<template #label>{{ $ts.emojiSizeSetting }}</template>
|
<template #label>{{ $ts.emojiSizeSetting }}</template>
|
||||||
|
<FormSection>
|
||||||
<FormSwitch v-model="emojiSizeFixed" class="_formBlock">
|
<FormSwitch v-model="emojiSizeFixed" class="_formBlock">
|
||||||
<template #label>{{ $ts.emojiSizeFixed }}</template>
|
<template #label>{{ $ts.emojiSizeFixed }}</template>
|
||||||
</FormSwitch>
|
</FormSwitch>
|
||||||
@ -26,9 +35,11 @@
|
|||||||
<template #label>{{ $ts.emojiStretch }}</template>
|
<template #label>{{ $ts.emojiStretch }}</template>
|
||||||
</FormSwitch>
|
</FormSwitch>
|
||||||
</FormSection>
|
</FormSection>
|
||||||
|
</FormFolder>
|
||||||
|
|
||||||
|
<FormFolder :default-open="false" class="_formBlock">
|
||||||
|
<template #label>{{ $ts._pages.font }}</template>
|
||||||
<FormRadios v-model="font" class="_formBlock">
|
<FormRadios v-model="font" class="_formBlock">
|
||||||
<template #label>{{ $ts.font }}</template>
|
|
||||||
<option value="notosans-mono-bold">Noto Sans Mono CJK JP Bold</option>
|
<option value="notosans-mono-bold">Noto Sans Mono CJK JP Bold</option>
|
||||||
<option value="mplus-1p-black">M+ 1p black</option>
|
<option value="mplus-1p-black">M+ 1p black</option>
|
||||||
<option value="rounded-x-mplus-1p-black">Rounded M+ 1p black</option>
|
<option value="rounded-x-mplus-1p-black">Rounded M+ 1p black</option>
|
||||||
@ -36,9 +47,12 @@
|
|||||||
<option value="aoyagireisyoshimo">青柳隷書しも</option>
|
<option value="aoyagireisyoshimo">青柳隷書しも</option>
|
||||||
<option value="LinLibertine_RBah">LinLibertine Bold</option>
|
<option value="LinLibertine_RBah">LinLibertine Bold</option>
|
||||||
</FormRadios>
|
</FormRadios>
|
||||||
|
</FormFolder>
|
||||||
|
|
||||||
<FormSection>
|
|
||||||
|
<FormFolder :default-open="false" class="_formBlock">
|
||||||
<template #label>{{ $ts.emojiColor }}</template>
|
<template #label>{{ $ts.emojiColor }}</template>
|
||||||
|
<FormSection>
|
||||||
<div class="cwepdizn-colors">
|
<div class="cwepdizn-colors">
|
||||||
<div class="row">
|
<div class="row">
|
||||||
<button v-for="color in accentColors" :key="color" class="color rounded _button" @click="setAccentColor(color)">
|
<button v-for="color in accentColors" :key="color" class="color rounded _button" @click="setAccentColor(color)">
|
||||||
@ -49,25 +63,20 @@
|
|||||||
|
|
||||||
<FormInput v-model="emojiColor" class="_formBlock" :style="{ color: '#' + emojiColor }">
|
<FormInput v-model="emojiColor" class="_formBlock" :style="{ color: '#' + emojiColor }">
|
||||||
<template #prefix><i class="fas fa-palette"></i></template>
|
<template #prefix><i class="fas fa-palette"></i></template>
|
||||||
<template #label>{{ $ts.emojiColor }}</template>
|
<template #label @click="colorPick()">{{ $ts.emojiColor }}</template>
|
||||||
<template #caption>#RRGGBB</template>
|
<template #caption>#RRGGBB</template>
|
||||||
</FormInput>
|
</FormInput>
|
||||||
|
<FormButton @click="colorPick()">{{ $ts.colorPicker }}</FormButton>
|
||||||
</FormSection>
|
</FormSection>
|
||||||
|
</FormFolder>
|
||||||
<FormButton primary class="_formBlock" @click="preview">{{ $ts.emojiGenerate }}</FormButton>
|
|
||||||
|
|
||||||
<FormSection>
|
|
||||||
<template #label>{{ $ts.preview }}</template>
|
|
||||||
<p><img :src="previewUrl" class="img" :alt="emojiName"/></p>
|
|
||||||
</FormSection>
|
</FormSection>
|
||||||
<FormButton primary class="_formBlock" @click="uploadEmoji">{{ $ts.emojiApproval }}</FormButton>
|
|
||||||
</div>
|
</div>
|
||||||
</MkSpacer>
|
</MkSpacer>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script lang="ts" setup>
|
<script lang="ts" setup>
|
||||||
import { v4 as uuid } from 'uuid';
|
import { v4 as uuid } from 'uuid';
|
||||||
import { computed, defineAsyncComponent, ref } from 'vue';
|
import { computed, defineAsyncComponent, ref, watch } from 'vue';
|
||||||
import * as os from '@/os';
|
import * as os from '@/os';
|
||||||
import { i18n } from '@/i18n';
|
import { i18n } from '@/i18n';
|
||||||
import { defaultStore } from '@/store';
|
import { defaultStore } from '@/store';
|
||||||
@ -78,6 +87,7 @@ import FormSwitch from '@/components/form/switch.vue';
|
|||||||
import FormButton from '@/components/MkButton.vue';
|
import FormButton from '@/components/MkButton.vue';
|
||||||
import FormRadios from '@/components/form/radios.vue';
|
import FormRadios from '@/components/form/radios.vue';
|
||||||
import FormTextarea from '@/components/form/textarea.vue';
|
import FormTextarea from '@/components/form/textarea.vue';
|
||||||
|
import FormFolder from '@/components/form/folder.vue';
|
||||||
import { definePageMetadata } from '@/scripts/page-metadata';
|
import { definePageMetadata } from '@/scripts/page-metadata';
|
||||||
|
|
||||||
const font = ref('rounded-x-mplus-1p-black');
|
const font = ref('rounded-x-mplus-1p-black');
|
||||||
@ -85,7 +95,7 @@ const text = ref('');
|
|||||||
const emojiName = ref('');
|
const emojiName = ref('');
|
||||||
const emojiAlign = ref('center');
|
const emojiAlign = ref('center');
|
||||||
const emojiSizeFixed = ref(false);
|
const emojiSizeFixed = ref(false);
|
||||||
const emojiStretch = ref(true);
|
const emojiStretch = ref(false);
|
||||||
const emojiColor = ref('90ee90');
|
const emojiColor = ref('90ee90');
|
||||||
const previewUrl = ref('');
|
const previewUrl = ref('');
|
||||||
const accentColors = [
|
const accentColors = [
|
||||||
@ -102,6 +112,21 @@ const accentColors = [
|
|||||||
'#8080ff',
|
'#8080ff',
|
||||||
];
|
];
|
||||||
|
|
||||||
|
watch([font, text, emojiAlign, emojiSizeFixed, emojiStretch, emojiColor], () => {
|
||||||
|
preview();
|
||||||
|
});
|
||||||
|
|
||||||
|
const colorPick = (): void => {
|
||||||
|
const input = document.createElement('input') as HTMLInputElement;
|
||||||
|
input.type = 'color';
|
||||||
|
input.value = `#${emojiColor.value}`;
|
||||||
|
input.addEventListener('input', () => {
|
||||||
|
emojiColor.value = input.value.replace('#', '');
|
||||||
|
});
|
||||||
|
(window as any).__misskey_input_ref__ = input;
|
||||||
|
input.click();
|
||||||
|
};
|
||||||
|
|
||||||
const makeUrl = (): string => {
|
const makeUrl = (): string => {
|
||||||
const API_URL = 'https://emoji-gen.ninja/emoji';
|
const API_URL = 'https://emoji-gen.ninja/emoji';
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user