Add new feature: regenerate

This commit is contained in:
LeoKu 2022-06-28 15:06:41 +08:00
parent c6ac2e169d
commit f8471f73ca
4 changed files with 18 additions and 6 deletions

View File

@ -74,6 +74,7 @@
<BatchDownloadModal
:visible="avatarListVisible"
:avatar-list="avatarList"
@regenerate="generateMultiple"
@close=";(avatarListVisible = false), (avatarList = [])"
/>

View File

@ -6,10 +6,14 @@
<div class="right">
<button
type="button"
class="regenerate-btn"
:disabled="making"
class="download-btn"
@click="make"
@click="emit('regenerate')"
>
{{ t(`text.regenerate`) }}
</button>
<button type="button" class="download-btn" @click="make">
{{
making
? `${t('text.downloadingMultiple')}(${madeCount}/${
@ -57,6 +61,7 @@ import ModalWrapper from './ModalWrapper.vue'
const props = defineProps<{ visible?: boolean; avatarList?: AvatarOption[] }>()
const emit = defineEmits<{
(e: 'regenerate'): void
(e: 'close'): void
}>()
@ -137,6 +142,12 @@ async function make() {
align-items: center;
margin-left: auto;
.download-btn {
color: #fff;
background-color: var.$color-accent;
}
.regenerate-btn,
.download-btn {
display: flex;
align-items: center;
@ -144,15 +155,13 @@ async function make() {
height: 2rem;
margin-left: 1rem;
padding: 0 1rem;
color: #fff;
background-color: var.$color-accent;
border-radius: 0.4rem;
cursor: pointer;
&:disabled,
&[disabled] {
color: rgba(#fff, 0.8);
cursor: default;
cursor: not-allowed;
}
}
}

View File

@ -42,6 +42,7 @@ export default {
downloadTip: 'LONG PRESS or RIGHT CLICK to save',
downloadMultiple: 'Download',
downloadingMultiple: 'Downloading',
downloadMultipleTip: 'Automatically generate avatar for you',
downloadMultipleTip: 'Automatically generated',
regenerate: 'Regenerate',
},
}

View File

@ -43,5 +43,6 @@ export default {
downloadMultiple: '开始下载',
downloadingMultiple: '正在下载',
downloadMultipleTip: '已为你自动生成头像',
regenerate: '换一批',
},
}