-
Notifications
You must be signed in to change notification settings - Fork 10
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
19 changed files
with
1,185 additions
and
58 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
2 changes: 1 addition & 1 deletion
2
apps/ba-online-toolbox/src/tools/DiffComparator/store/DiffComparatorStore.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
19 changes: 19 additions & 0 deletions
19
apps/ba-online-toolbox/src/tools/v2-MomotalkEditor/MomotalkEditorHome.vue
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
<script lang="ts" setup> | ||
import MomotalkFileLoader from "./components/MomotalkFileLoader.vue"; | ||
import { isEmpty } from "radashi"; | ||
import { ref, computed } from "vue"; | ||
import { momotalkEditorStore } from "./store/momotalkEditorStore"; | ||
import MomotalkEditorWrapper from "./components/MomotalkEditorWrapper.vue"; | ||
const useMomotalkEditorStore = momotalkEditorStore(); | ||
const isMomotalkDataEmpty = computed(() => | ||
isEmpty(useMomotalkEditorStore.getMomotalkFileData) | ||
); | ||
</script> | ||
|
||
<template> | ||
<momotalk-file-loader v-if="isMomotalkDataEmpty" /> | ||
<momotalk-editor-wrapper v-else /> | ||
</template> | ||
|
||
<style lang="scss" scoped></style> |
48 changes: 48 additions & 0 deletions
48
apps/ba-online-toolbox/src/tools/v2-MomotalkEditor/components/MmtkComponents/MmtkTitle.vue
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,48 @@ | ||
<script setup lang="ts"> | ||
import EInput from "../widgets/EInput.vue"; | ||
import type { Title, Language } from "../../types/Momotalks"; | ||
import { IconTranslate } from "@arco-design/web-vue/es/icon"; | ||
const props = defineProps<{ | ||
title: Title; | ||
from: Language; | ||
to: Language; | ||
idx: number; | ||
total: number; | ||
}>(); | ||
</script> | ||
|
||
<template> | ||
<div | ||
flex | ||
flex-col | ||
gap-2 | ||
flex-1 | ||
items-center | ||
p-5 | ||
shadow-sm | ||
sticky | ||
top-0 | ||
bg-white | ||
class="@dark:bg-slate-700" | ||
z-999 | ||
> | ||
<h3 flex items-center content-between gap-2 class="@dark:text-gray-100"> | ||
{{ props.title[`Text${props.from}`] }} | ||
<a-tag size="mini">{{ props.idx + 1 }}/{{ props.total }}</a-tag> | ||
</h3> | ||
<div w-full gap-1 flex flex-1 justify-between items-end> | ||
<EInput | ||
v-model="props.title[`Text${props.to}`]" | ||
width="100%" | ||
align="center" | ||
placeholder="输入标题翻译" | ||
> | ||
<!-- <template #suffix> | ||
<a-button type="text" size="small"><icon-translate /></a-button> | ||
</template> --> | ||
</EInput> | ||
</div> | ||
</div> | ||
</template> | ||
|
||
<style lang="scss" scoped></style> |
78 changes: 78 additions & 0 deletions
78
apps/ba-online-toolbox/src/tools/v2-MomotalkEditor/components/MmtkComponents/MmtkUnit.vue
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,78 @@ | ||
<script lang="ts" setup> | ||
import type { Content } from "../../types/Momotalks"; | ||
import { momotalkEditorStore } from "../../store/momotalkEditorStore"; | ||
import { computed } from "vue"; | ||
import EInput from "../widgets/EInput.vue"; | ||
const props = defineProps<{ msg: Content }>(); | ||
const useMomotalkEditorStore = momotalkEditorStore(); | ||
const from = computed( | ||
() => | ||
("Message" + | ||
useMomotalkEditorStore.getSelectedTranslation.toUpperCase()) as keyof Content | ||
); | ||
const to = computed( | ||
() => | ||
("Message" + | ||
useMomotalkEditorStore.getTargetTranslation.toUpperCase()) as keyof Content | ||
); | ||
const isImage = computed(() => props.msg.ImagePath) | ||
</script> | ||
|
||
<template> | ||
<div | ||
flex | ||
:class="{ | ||
'justify-end': 'Answer' === msg.MessageCondition, | ||
}" | ||
> | ||
<div | ||
px-4 | ||
py-2 | ||
z-0 | ||
class="talk-bubble max-w-80 relative" | ||
:class="{ | ||
'talk-bubble--answer': 'Answer' === msg.MessageCondition, | ||
'talk-bubble--favor': msg.FavorScheduleId != 0, | ||
}" | ||
> | ||
<div class="orininal-msg pl-[2px]"> | ||
<span v-if="!isImage">{{ props.msg[from] }}</span> | ||
<img | ||
w-40 | ||
v-else | ||
:src=" | ||
'https://yuuka.cdn.diyigemt.com/image/ba-all-data/' + | ||
props.msg.ImagePath + '.png' | ||
" | ||
/> | ||
</div> | ||
<div class="msg-translation" v-if="!isImage"> | ||
<EInput | ||
v-model="msg[to] as string" | ||
:text-white=" | ||
'Answer' === msg.MessageCondition || msg.FavorScheduleId != 0 | ||
" | ||
placeholder="输入内容翻译" | ||
width="auto" | ||
/> | ||
<!-- <a-input v-model="msg[to] as string" ></a-input> --> | ||
</div> | ||
</div> | ||
</div> | ||
</template> | ||
|
||
<style lang="scss" scoped> | ||
.talk-bubble { | ||
@apply rounded-md bg-white @dark:bg-slate-700 @dark:text-gray-2; | ||
&--answer { | ||
@apply bg-[#4a91e7] text-white @dark:bg-[#397ee1]; | ||
} | ||
&--favor { | ||
@apply bg-[#E62C8C]! text-white @dark:bg-[#eb509b]!; | ||
} | ||
} | ||
</style> |
42 changes: 42 additions & 0 deletions
42
apps/ba-online-toolbox/src/tools/v2-MomotalkEditor/components/MomotalkContainer.vue
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,42 @@ | ||
<script lang="ts" setup> | ||
import { computed } from "vue"; | ||
import type { Title } from "../types/Momotalks"; | ||
import MmtkTitle from "./MmtkComponents/MmtkTitle.vue"; | ||
import MmtkUnit from "./MmtkComponents/MmtkUnit.vue"; | ||
import { momotalkEditorStore } from "../store/momotalkEditorStore"; | ||
const useMomotalkEditorStore = momotalkEditorStore(); | ||
const props = defineProps<{ title: Title; idx: number; total: number }>(); | ||
const selectedTranslation = computed({ | ||
get: () => useMomotalkEditorStore.getSelectedTranslation, | ||
set: translation => | ||
useMomotalkEditorStore.setSelectedTranslation(translation), | ||
}); | ||
const targetTranslation = computed({ | ||
get: () => useMomotalkEditorStore.getTargetTranslation, | ||
set: translation => useMomotalkEditorStore.setTargetTranslation(translation), | ||
}); | ||
const mmtkGroup = computed(() => | ||
useMomotalkEditorStore.getMomotalkFromScheduleId(props.title.FavorScheduleId) | ||
); | ||
</script> | ||
|
||
<template> | ||
<div w-92 flex flex-col items-stretch rounded-sm> | ||
<MmtkTitle | ||
:title="title" | ||
:from="selectedTranslation" | ||
:to="targetTranslation" | ||
:idx="idx" | ||
:total="total" | ||
/> | ||
<div flex flex-col gap-4 mb-5 pt-4 class="bg-[#f2f2f2] @dark:bg-slate-900"> | ||
<MmtkUnit v-for="msg in mmtkGroup" :key="msg.Id" :msg="msg" /> | ||
</div> | ||
</div> | ||
</template> | ||
|
||
<style lang="scss" scoped></style> |
Oops, something went wrong.