Skip to content

Commit

Permalink
update
Browse files Browse the repository at this point in the history
  • Loading branch information
tinygeeker committed Jun 12, 2023
1 parent 7b98407 commit b8da30f
Show file tree
Hide file tree
Showing 4 changed files with 173 additions and 30 deletions.
116 changes: 116 additions & 0 deletions src/components/Mecha.vue
Original file line number Diff line number Diff line change
@@ -0,0 +1,116 @@
<template>
<div class="app-container" style="height: 600px;overflow-y: auto;">
<span v-for="prompt in prompts">
<span v-if="prompt.visible">
<el-divider content-position="left">{{ prompt.name }}</el-divider>
<span v-for="item in prompt.items" class="prompt">
<el-button type="danger" v-if="setting.down" @click="downWeight(item)" plain>
<el-icon>
<Remove />
</el-icon>
</el-button>
<el-button type="success" v-if="setting.up" @click="upWeight(item)" plain>
<el-icon>
<CirclePlus />
</el-icon>
</el-button>
<el-button :type="item.checked ? 'primary' : ''" @click="selectPrompt(item);" plain>
<span v-if="setting.en">{{ item.en }}</span>
<span v-if="setting.zh">「{{ item.zh }}」</span>
</el-button>
</span>
</span>
</span>
</div>
</template>

<script>
import prompts from '../data/mecha'
export default {
name: 'Mecha',
props: {
setting: Object,
vprompts: Array
},
data() {
return {}
},
created() {
prompts.forEach(prompt => {
prompt.items.forEach(item => {
// 查找是否存在匹配的对象
const match = this.vprompts.find(i => i.en === item.en);
// 设置 checked 字段
item.checked = match ? true : false;
});
});
},
watch: {
'vprompts': function (newValue) {
const normalArray = Array.from(newValue);
prompts.forEach(prompt => {
prompt.items.forEach(item => {
// 查找是否存在匹配的对象
const match = normalArray.find(i => i.en === item.en);
// 设置 checked 字段
item.checked = match ? true : false;
});
});
}
},
methods: {
downWeight(item) {
if (item.en.startsWith('(') && item.en.endsWith(')')) {
item.en = item.en.substring(1, item.en.length - 1)
} else {
item.en = `[${item.en}]`
}
this.$forceUpdate()
},
upWeight(item) {
if (item.en.startsWith('[') && item.en.endsWith(']')) {
item.en = item.en.substring(1, item.en.length - 1)
} else {
item.en = `(${item.en})`
}
this.$forceUpdate()
},
selectPrompt(item) {
item.checked = !item.checked
this.$forceUpdate()
this.$emit('selectPrompt', item)
}
},
computed: {
prompts: function () {
return prompts.map((item) => {
if (this.setting.adult) {
if (item.range == 'adult') {
item.visible = true
}
} else {
if (item.range == 'adult') {
item.visible = false
}
}
return item
});
}
}
}
</script>

<!-- Add "scoped" attribute to limit CSS to this component only -->
<style scoped>
.el-button {
margin-left: .2rem;
margin-bottom: .5rem;
}

.prompt {
margin: 2px;
}
</style>
23 changes: 23 additions & 0 deletions src/data/mecha.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
const prompts = [
{
name: '机甲人物风格',
visible: true,
range: 'all',
items: [
{ en: 'mecha', zh: '机甲' },
{ en: 'intricate mechanical bodysuit', zh: '复杂的机械紧身衣' },
{ en: 'mecha corset', zh: '机甲紧身胸衣' },
{ en: 'mechanical parts', zh: '机械零件' },
{ en: 'robotic arms and legs', zh: '机械手和机械腿' },
{ en: 'headgear', zh: '头饰' },
{ en: 'caustics', zh: '腐蚀性' },
{ en: 'ray tracing', zh: '光线追踪' },
{ en: 'demontheme', zh: '恶魔主题' },
{ en: 'cyber effect', zh: '网络效应' },
{ en: 'cyberpunk', zh: '赛博朋克' },
{ en: 'science fiction', zh: '科幻小说' },
]
}
];

export default prompts;
46 changes: 23 additions & 23 deletions src/data/style.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,29 +4,29 @@ const prompts = [
visible: true,
range: 'all',
items: [
{ en: 'artbook', zh: '原画', checked: false },
{ en: 'comic', zh: '漫画', checked: false },
{ en: 'silhouette', zh: '剪影', checked: false },
{ en: 'cover', zh: '封面', checked: false },
{ en: 'album', zh: '专辑', checked: false },
{ en: 'original', zh: '原创', checked: false },
{ en: 'crossover', zh: '穿越', checked: false },
{ en: 'guro', zh: '猎奇', checked: false },
{ en: 'landscape/scenery', zh: '风景', checked: false },
{ en: 'science fiction', zh: '科技幻想', checked: false },
{ en: 'game cg', zh: '游戏CG', checked: false },
{ en: 'fine art parody', zh: '名画模仿', checked: false },
{ en: 'traditional media', zh: '传统媒体(手绘)', checked: false },
{ en: 'watercolor (medium)', zh: '透明水彩绘', checked: false },
{ en: 'sample', zh: 'sample图', checked: false },
{ en: 'back', zh: '背影像', checked: false },
{ en: 'bust', zh: '半身像', checked: false },
{ en: 'profile', zh: '侧面绘', checked: false },
{ en: 'personification', zh: '拟人', checked: false },
{ en: '4koma', zh: '四格', checked: false },
{ en: 'pixel art', zh: '点阵图', checked: false },
{ en: 'monochrome', zh: '单色图', checked: false },
{ en: 'optical illusion', zh: '视错觉', checked: false }
{ en: 'artbook', zh: '原画' },
{ en: 'comic', zh: '漫画' },
{ en: 'silhouette', zh: '剪影' },
{ en: 'cover', zh: '封面' },
{ en: 'album', zh: '专辑' },
{ en: 'original', zh: '原创' },
{ en: 'crossover', zh: '穿越' },
{ en: 'guro', zh: '猎奇' },
{ en: 'landscape/scenery', zh: '风景' },
{ en: 'science fiction', zh: '科技幻想' },
{ en: 'game cg', zh: '游戏CG' },
{ en: 'fine art parody', zh: '名画模仿' },
{ en: 'traditional media', zh: '传统媒体(手绘)' },
{ en: 'watercolor (medium)', zh: '透明水彩绘' },
{ en: 'sample', zh: 'sample图' },
{ en: 'back', zh: '背影像' },
{ en: 'bust', zh: '半身像' },
{ en: 'profile', zh: '侧面绘' },
{ en: 'personification', zh: '拟人' },
{ en: '4koma', zh: '四格' },
{ en: 'pixel art', zh: '点阵图' },
{ en: 'monochrome', zh: '单色图' },
{ en: 'optical illusion', zh: '视错觉' }
]
}
];
Expand Down
18 changes: 11 additions & 7 deletions src/views/Home.vue
Original file line number Diff line number Diff line change
Expand Up @@ -108,6 +108,9 @@
<el-tab-pane label="动作" name="action">
<Action :setting="this.setting" :vprompts="this.form.vprompts" @selectPrompt="selectPrompt" />
</el-tab-pane>
<el-tab-pane label="机甲" name="mecha">
<Mecha :setting="this.setting" :vprompts="this.form.vprompts" @selectPrompt="selectPrompt" />
</el-tab-pane>
</el-tabs>
</el-col>
</el-row>
Expand All @@ -129,6 +132,7 @@ import Chest from '../components/Chest.vue'
import Foot from '../components/Foot.vue'
import Dress from '../components/Dress.vue'
import Action from '../components/Action.vue'
import Mecha from '../components/Mecha.vue'
export default {
name: 'Home',
Expand All @@ -143,7 +147,8 @@ export default {
Chest,
Foot,
Dress,
Action
Action,
Mecha
},
data() {
return {
Expand Down Expand Up @@ -250,17 +255,16 @@ export default {
{ en: 'sexy', zh: '性感的' },
{ en: 'lewd', zh: 'yin乱' },
{ en: 'thighhighs', zh: '大腿' },
{ en: 'erotic', zh: '😍情' },
{ en: 'partially unbuttoned', zh: '解开部分扣子' },
{ en: '{{breasts out}}', zh: '露胸' },
{ en: '{{large breasts}}', zh: '大胸' },
{ en: 'erotic', zh: '涩情' },
{ en: 'no bra', zh: '不穿胸罩' },
{ en: 'breasts out', zh: '露胸' },
{ en: 'middle breasts', zh: '大小合适的胸' },
{ en: 'middle nipples', zh: '大小合适的乳头' },
{ en: 'partially unbuttoned', zh: '解开部分扣子' },
{ en: 'no panties', zh: '不穿短裤' },
{ en: 'undressing', zh: '脱裙子' },
{ en: 'skirt lift', zh: '提起裙子' },
{ en: 'shirt lift', zh: '提起衬衫' },
{ en: 'middle nipples', zh: '不大不小的乳头' },
{ en: 'leash', zh: '拴狗链' },
],
setting: {
en: true,
Expand Down

0 comments on commit b8da30f

Please sign in to comment.