完善部分ui

This commit is contained in:
AncTe committed 2022-12-29 13:39:40 +08:00
1 parent db5ff1b183
commit 190201b386
15 files changed
+70 -49

No files matched your search

+1 -3
View File
@@ -202,9 +202,8 @@ function keydown(e: KeyboardEvent) {
onMounted(async () => {
const div = document.getElementById('book') as HTMLDivElement;
div.style.opacity = '1';
if (core.plugin.transition.value) await sleep(600);
else await sleep(100);
else await sleep(50);
document.addEventListener('keyup', keyup);
document.addEventListener('keydown', keydown);
});
@@ -217,7 +216,6 @@ onUnmounted(async () => {
<style lang="less" scoped>
#book {
opacity: 0;
user-select: none;
width: 80%;
height: 100%;
+14 -2
View File
@@ -183,9 +183,10 @@ import { computed, onMounted, onUnmounted, reactive, ref, watch } from 'vue';
import Scroll from '../components/scroll.vue';
import { getAddStatus, getEquips, getNowStatus } from '../plugin/ui/equipbox';
import BoxAnimate from '../components/boxAnimate.vue';
import { has, tip, type } from '../plugin/utils';
import { has, keycode, tip, type } from '../plugin/utils';
import { cancelGlobalDrag, isMobile, useDrag } from '../plugin/use';
import { hyper, sleep } from 'mutate-animate';
import { KeyCode } from '../plugin/keyCodes';
const equips = ref(getEquips());
const col = ref('all');
@@ -425,16 +426,27 @@ async function toTool() {
core.plugin.transition.value = before;
}
function keyup(e: KeyboardEvent) {
const c = keycode(e.keyCode);
if (c === KeyCode.KeyQ || c === KeyCode.KeyX || c === KeyCode.Escape) {
exit();
}
}
watch(toShow, n => {
bind();
});
onMounted(() => {
onMounted(async () => {
bind();
if (core.plugin.transition.value) await sleep(600);
else await sleep(50);
document.addEventListener('keyup', keyup);
});
onUnmounted(() => {
cancelGlobalDrag(dragEquip);
document.removeEventListener('keyup', keyup);
});
</script>
+4 -2
View File
@@ -75,10 +75,10 @@
keys[2]?.toString().padStart(2, '0')
}}</span>
</div>
<div class="status-item">
<div v-if="skillOpened" class="status-item">
<span id="skill-tree" class="button-text">技能树</span>
</div>
<div class="status-item">
<div v-if="skillOpened" class="status-item">
<span id="status-skill" class="button-text"
>查看技能</span
>
@@ -112,6 +112,7 @@ const lvName = ref<string>();
const skill = ref<string>('无');
const up = ref(0);
const spring = ref<number>();
const skillOpened = ref(core.getFlag('chapter', 0) > 0);
/**
* 要展示的勇士属性
*/
@@ -148,6 +149,7 @@ function update() {
if (core.hasFlag('spring')) {
spring.value = 50 - flags.springCount;
}
skillOpened.value = core.getFlag('chapter', 0) > 0;
}
</script>
+3 -2
View File
@@ -197,7 +197,7 @@ async function toEquip() {
function keyup(e: KeyboardEvent) {
const c = keycode(e.keyCode);
if (c === KeyCode.Escape || c === KeyCode.KeyX) {
if (c === KeyCode.Escape || c === KeyCode.KeyX || c === KeyCode.KeyT) {
exit();
}
if (c === KeyCode.Enter || c === KeyCode.KeyC) {
@@ -239,7 +239,8 @@ function keydown(e: KeyboardEvent) {
}
onMounted(async () => {
await sleep(600);
if (core.plugin.transition.value) await sleep(600);
else await sleep(50);
document.addEventListener('keyup', keyup);
document.addEventListener('keydown', keydown);
});