Skip to content

Commit

Permalink
Fade in posts in post stream using CSS
Browse files Browse the repository at this point in the history
This also avoids a double-fade from the JavaScript code, which was
probably introduced in #2160.
  • Loading branch information
franzliedke committed Aug 14, 2020
1 parent b5357ba commit 90707a4
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 6 deletions.
6 changes: 0 additions & 6 deletions js/src/forum/components/PostStream.js
Original file line number Diff line number Diff line change
Expand Up @@ -24,11 +24,6 @@ export default class PostStream extends Component {
}

view() {
function fadeIn(element, isInitialized, context) {
if (!context.fadedIn) $(element).hide().fadeIn();
context.fadedIn = true;
}

let lastTime;

const viewingEnd = this.stream.viewingEnd();
Expand All @@ -45,7 +40,6 @@ export default class PostStream extends Component {
content = PostComponent ? PostComponent.component({ post }) : '';

attrs.key = 'post' + post.id();
attrs.config = fadeIn;
attrs['data-time'] = time.toISOString();
attrs['data-number'] = post.number();
attrs['data-id'] = post.id();
Expand Down
11 changes: 11 additions & 0 deletions less/forum/PostStream.less
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,18 @@
margin-top: 10px;
}
}

@-webkit-keyframes fadeIn {
0% {opacity: 0}
100% {opacity: 1}
}
@keyframes fadeIn {
0% {opacity: 0}
100% {opacity: 1}
}
.PostStream-item {
.animation(pulsate 1s ease-in-out);

&:not(:last-child) {
border-bottom: 1px solid @control-bg;

Expand Down

0 comments on commit 90707a4

Please sign in to comment.