Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

给评论框添加了渐显效果 #712

Merged
merged 12 commits into from
Jun 5, 2024
4 changes: 2 additions & 2 deletions src/client/view/components/TkComment.vue
Original file line number Diff line number Diff line change
Expand Up @@ -208,7 +208,7 @@ export default {
scrollToComment () {
if (window.location.hash.indexOf(this.comment.id) !== -1) {
this.$refs['tk-comment'].scrollIntoView({
behavier: 'smooth'
behavior: 'smooth'
})
this.$emit('expand')
}
Expand Down Expand Up @@ -247,7 +247,7 @@ export default {
onLoad () {
if (this.comment.replies.length > 0) {
this.$refs['tk-replies'].lastElementChild.scrollIntoView({
behavier: 'smooth',
behavior: 'smooth',
block: 'center'
})
}
Expand Down
16 changes: 14 additions & 2 deletions src/client/view/components/TkSubmit.vue
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<template>
<div class="tk-submit" ref="tk-submit">
<div class="tk-submit tk-fade-in" ref="tk-submit">
<div class="tk-row">
<tk-avatar :config="config" :mail="mail" :nick="nick" />
<div class="tk-col">
Expand Down Expand Up @@ -374,7 +374,7 @@ export default {
mounted () {
if (this.pid) {
this.$refs['tk-submit'].scrollIntoView({
behavier: 'smooth',
behavior: 'instant',
block: 'center'
})
}
Expand Down Expand Up @@ -477,4 +477,16 @@ export default {
border-radius: 4px;
word-break: break-word;
}
.tk-fade-in {
animation: tkFadeIn .3s;
}
@keyframes tkFadeIn {
0% {
opacity: 0
}

to {
opacity: 1
}
}
</style>
Loading