This commit is contained in:
zyronon
2023-08-30 10:46:43 +08:00
parent 0f8b867f01
commit ba729f0c0f
4 changed files with 30 additions and 14 deletions

View File

@@ -40,33 +40,47 @@ onMounted(() => {
})
})
function getActiveIndex(type: DictType) {
if (store.current.dictType !== type) return -1
else {
return store[type].chapterWordIndex
}
}
const newWordDictActiveIndex = computed(() => {
if (store.current.dictType !== DictType.newWordDict) return -1
else return store.current.index
else {
if (store.current.repeatNumber) {
return store.chapter.findIndex(v => v.name === store.word.name)
}
return store.current.index
}
})
const dictActiveIndex = computed(() => {
if (store.current.dictType !== DictType.inner) return -1
else return store.current.index
else {
if (store.current.repeatNumber) {
return store.chapter.findIndex(v => v.name === store.word.name)
}
return store.current.index
}
})
const wrongWordDictActiveIndex = computed(() => {
if (store.current.dictType !== DictType.wrongWordDict) return -1
else return store.current.index
else {
if (store.current.repeatNumber) {
return store.chapter.findIndex(v => v.name === store.word.name)
}
return store.current.index
}
})
const skipWordDictActiveIndex = computed(() => {
if (store.current.dictType !== DictType.skipWordDict) return -1
else return store.current.index
else {
if (store.current.repeatNumber) {
return store.chapter.findIndex(v => v.name === store.word.name)
}
return store.current.index
}
})
</script>

View File

@@ -161,7 +161,7 @@ header {
cursor: pointer;
transition: all .5s;
transform: translate3d(-50%, 100%, 0) rotate(180deg);
padding: 10rem;
padding: 5rem;
&.down {
transform: translate3d(-50%, 100%, 0) rotate(0);

View File

@@ -30,15 +30,17 @@ export default {
this.show = true
nextTick(() => {
let tip = this.$refs?.tip?.getBoundingClientRect()
console.log('re', rect)
if (!tip) return
if (rect.top < 50) {
this.$refs.tip.style.top = rect.top + tip.height - 10 + 'px'
this.$refs.tip.style.top = rect.top + rect.height + 10 + 'px'
} else {
this.$refs.tip.style.top = rect.top - tip.height - 10 + 'px'
}
let tipWidth = tip.width
let rectWidth = rect.width
this.$refs.tip.style.left = rect.left - (tipWidth - rectWidth) / 2 + 'px'
// onmouseleave={() => this.show = false}
})
},
},

View File

@@ -347,7 +347,7 @@ onUnmounted(() => {
cursor: pointer;
transition: all .3s;
transform: translate3d(-50%, -100%, 0) rotate(0);
padding: 10rem;
padding: 5rem;
}
.stat {
@@ -374,7 +374,7 @@ onUnmounted(() => {
transform: translateY(calc(100% + 30rem));
.arrow {
transform: translate3d(-50%, -180%, 0) rotate(180deg);
transform: translate3d(-50%, -220%, 0) rotate(180deg);
}
}
}