diff --git a/package.json b/package.json index c1db9538..0ac77f63 100644 --- a/package.json +++ b/package.json @@ -75,6 +75,7 @@ "markup-it": "git+https://github.com/cassiozen/markup-it.git", "pluralize": "^3.0.0", "prismjs": "^1.5.1", + "react-addons-css-transition-group": "^15.3.1", "react-portal": "^2.2.1", "selection-position": "^1.0.0", "semaphore": "^1.0.5", diff --git a/src/backends/backend.js b/src/backends/backend.js index 0104866d..23584799 100644 --- a/src/backends/backend.js +++ b/src/backends/backend.js @@ -49,7 +49,6 @@ class Backend { entries(collection, page, perPage) { return this.implementation.entries(collection, page, perPage).then((response) => { - console.log("Got %s entries", response.entries.length); return { pagination: response.pagination, entries: response.entries.map(this.entryWithFormat(collection)) diff --git a/src/components/UI/loader/Loader.css b/src/components/UI/loader/Loader.css index c46da16c..69d3b9ad 100644 --- a/src/components/UI/loader/Loader.css +++ b/src/components/UI/loader/Loader.css @@ -33,9 +33,7 @@ left: 50%; width: 100%; height: 100%; - -webkit-animation: loader 0.6s linear; animation: loader 0.6s linear; - -webkit-animation-iteration-count: infinite; animation-iteration-count: infinite; border-radius: 500rem; border-color: #767676 transparent transparent; @@ -93,3 +91,25 @@ .disabled { display: none; } + +/*Animations*/ +.animateItem{ + position: absolute; + white-space: nowrap; + transform: translateX(-50%); +} + +.enter { + opacity: 0.01; +} +.enter.enterActive { + opacity: 1; + transition: opacity 500ms ease-in; +} +.leave { + opacity: 1; +} +.leave.leaveActive { + opacity: 0.01; + transition: opacity 300ms ease-in; +} diff --git a/src/components/UI/loader/Loader.js b/src/components/UI/loader/Loader.js index 6b7ecb42..b5e4e442 100644 --- a/src/components/UI/loader/Loader.js +++ b/src/components/UI/loader/Loader.js @@ -1,21 +1,68 @@ import React from 'react'; +import ReactCSSTransitionGroup from 'react-addons-css-transition-group'; import styles from './Loader.css'; -export default function Loader({ active, style, className = '', children }) { - // Class names - let classNames = styles.loader; - if (active) { - classNames += ` ${styles.active}`; - } - if (className.length > 0) { - classNames += ` ${className}`; +export default class Loader extends React.Component { + constructor(props) { + super(props); + this.state = { + currentItem: 0, + }; + this.setAnimation = this.setAnimation.bind(this); + this.renderChild = this.renderChild.bind(this); } - // Render child text - let child; - if (children) { - child =