提交 f8471f73 编写于 作者: L LeoKu

Add new feature: regenerate

上级 c6ac2e16
...@@ -74,6 +74,7 @@ ...@@ -74,6 +74,7 @@
<BatchDownloadModal <BatchDownloadModal
:visible="avatarListVisible" :visible="avatarListVisible"
:avatar-list="avatarList" :avatar-list="avatarList"
@regenerate="generateMultiple"
@close=";(avatarListVisible = false), (avatarList = [])" @close=";(avatarListVisible = false), (avatarList = [])"
/> />
......
...@@ -6,10 +6,14 @@ ...@@ -6,10 +6,14 @@
<div class="right"> <div class="right">
<button <button
type="button" type="button"
class="regenerate-btn"
:disabled="making" :disabled="making"
class="download-btn" @click="emit('regenerate')"
@click="make"
> >
{{ t(`text.regenerate`) }}
</button>
<button type="button" class="download-btn" @click="make">
{{ {{
making making
? `${t('text.downloadingMultiple')}(${madeCount}/${ ? `${t('text.downloadingMultiple')}(${madeCount}/${
...@@ -57,6 +61,7 @@ import ModalWrapper from './ModalWrapper.vue' ...@@ -57,6 +61,7 @@ import ModalWrapper from './ModalWrapper.vue'
const props = defineProps<{ visible?: boolean; avatarList?: AvatarOption[] }>() const props = defineProps<{ visible?: boolean; avatarList?: AvatarOption[] }>()
const emit = defineEmits<{ const emit = defineEmits<{
(e: 'regenerate'): void
(e: 'close'): void (e: 'close'): void
}>() }>()
...@@ -137,6 +142,12 @@ async function make() { ...@@ -137,6 +142,12 @@ async function make() {
align-items: center; align-items: center;
margin-left: auto; margin-left: auto;
.download-btn {
color: #fff;
background-color: var.$color-accent;
}
.regenerate-btn,
.download-btn { .download-btn {
display: flex; display: flex;
align-items: center; align-items: center;
...@@ -144,15 +155,13 @@ async function make() { ...@@ -144,15 +155,13 @@ async function make() {
height: 2rem; height: 2rem;
margin-left: 1rem; margin-left: 1rem;
padding: 0 1rem; padding: 0 1rem;
color: #fff;
background-color: var.$color-accent;
border-radius: 0.4rem; border-radius: 0.4rem;
cursor: pointer; cursor: pointer;
&:disabled, &:disabled,
&[disabled] { &[disabled] {
color: rgba(#fff, 0.8); color: rgba(#fff, 0.8);
cursor: default; cursor: not-allowed;
} }
} }
} }
......
...@@ -42,6 +42,7 @@ export default { ...@@ -42,6 +42,7 @@ export default {
downloadTip: 'LONG PRESS or RIGHT CLICK to save', downloadTip: 'LONG PRESS or RIGHT CLICK to save',
downloadMultiple: 'Download', downloadMultiple: 'Download',
downloadingMultiple: 'Downloading', downloadingMultiple: 'Downloading',
downloadMultipleTip: 'Automatically generate avatar for you', downloadMultipleTip: 'Automatically generated',
regenerate: 'Regenerate',
}, },
} }
...@@ -43,5 +43,6 @@ export default { ...@@ -43,5 +43,6 @@ export default {
downloadMultiple: '开始下载', downloadMultiple: '开始下载',
downloadingMultiple: '正在下载', downloadingMultiple: '正在下载',
downloadMultipleTip: '已为你自动生成头像', downloadMultipleTip: '已为你自动生成头像',
regenerate: '换一批',
}, },
} }
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册