Skip to content

Commit

Permalink
给评论框添加了渐显效果 (#712)
Browse files Browse the repository at this point in the history
* 添加代码插件

* 修改代码语法错误

* 修改代码逻辑错误

* Update src/client/view/components/TkComments.vue

Co-authored-by: iMaeGoo <[email protected]>

* Update src/client/view/components/TkComments.vue

Co-authored-by: iMaeGoo <[email protected]>

* Update src/client/view/components/TkComments.vue

Co-authored-by: iMaeGoo <[email protected]>

* Update src/client/view/components/TkComments.vue

Co-authored-by: iMaeGoo <[email protected]>

* Update src/client/view/components/TkComments.vue

Co-authored-by: iMaeGoo <[email protected]>

* Update src/client/view/components/TkComments.vue

Co-authored-by: iMaeGoo <[email protected]>

* 评论框渐显

---------

Co-authored-by: iMaeGoo <[email protected]>
  • Loading branch information
HcGys and imaegoo authored Jun 5, 2024
1 parent 288eec4 commit d6ff763
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 4 deletions.
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>

0 comments on commit d6ff763

Please sign in to comment.