From 90707a4d287166db0439da396acd2e67e260cb81 Mon Sep 17 00:00:00 2001 From: Franz Liedke Date: Fri, 14 Aug 2020 22:41:31 +0200 Subject: [PATCH] Fade in posts in post stream using CSS This also avoids a double-fade from the JavaScript code, which was probably introduced in #2160. --- js/src/forum/components/PostStream.js | 6 ------ less/forum/PostStream.less | 11 +++++++++++ 2 files changed, 11 insertions(+), 6 deletions(-) diff --git a/js/src/forum/components/PostStream.js b/js/src/forum/components/PostStream.js index ec8c61fd4c..cc589c5fa4 100644 --- a/js/src/forum/components/PostStream.js +++ b/js/src/forum/components/PostStream.js @@ -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(); @@ -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(); diff --git a/less/forum/PostStream.less b/less/forum/PostStream.less index 98374e59e2..49f9299634 100644 --- a/less/forum/PostStream.less +++ b/less/forum/PostStream.less @@ -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;