pavelk2 / social-feed

JavaScript plugin that shows a user feed from the most popular social networks
http://pavelk2.github.io/social-feed-example/
MIT License
962 stars 304 forks source link

Do you think to add a fancy animation instead of refreshing? #Enhacement #172

Open Matias-Carazzo opened 8 years ago

Matias-Carazzo commented 8 years ago

Im trying to add a fancy animation to add new post on the container. Do you have any idea on how to implement it?

tmlangley commented 8 years ago

How about just using a css animation?

Example:

.social-feed-container {
  overflow: hidden;
}

.social-feed-element {
  transform: translateY(800%);
  opacity: 0;
  transition: 1s top;

  animation: 1s ease-in-out slideup;
  animation-fill-mode: forwards;
}

@keyframes slideup {
  from {
    transform: translateY(800%);
    opacity: 0;
  }

  to {
    transform: translateY(0);
    opacity: 1;
  }
}
tmlangley commented 8 years ago

I should mention, this will slide them in as they come which could be a bit weird. If you want them to all slide in at once, you could use the js callback to add a class to each element with an X second delay.