{"size": 1748, "ext": "js", "max_stars_repo_path": "src/renderer/components/Carousel/helpers.js", "max_stars_repo_name": "machard/ledger-live-desktop", "max_stars_repo_stars_event_min_datetime": "2020-11-09T13:57:28.000Z", "max_stars_repo_stars_event_max_datetime": "2020-11-09T13:57:28.000Z", "max_issues_repo_path": "src/renderer/components/Carousel/helpers.js", "max_issues_repo_name": "RoboterYang/ledger-live-desktop", "max_issues_repo_issues_event_min_datetime": null, "max_issues_repo_issues_event_max_datetime": null, "max_forks_repo_path": "src/renderer/components/Carousel/helpers.js", "max_forks_repo_name": "RoboterYang/ledger-live-desktop", "max_forks_repo_forks_event_min_datetime": null, "max_forks_repo_forks_event_max_datetime": null}
{"max_stars_count": 1, "max_issues_count": null, "max_forks_count": null, "avg_line_length": 31.2142857143, "max_line_length": 91, "alphanum_fraction": 0.614416476}
// @flow
import LedgerAcademyBanner from "~/renderer/components/Carousel/banners/LedgerAcademy";
import BackupPackBanner from "~/renderer/components/Carousel/banners/BackupPack";
import StakeCosmosBanner from "~/renderer/components/Carousel/banners/StakeCosmos";
import BuyCryptoBanner from "~/renderer/components/Carousel/banners/BuyCrypto";
import StakeAlgorandBanner from "~/renderer/components/Carousel/banners/StakeAlgorand";
import SwapBanner from "~/renderer/components/Carousel/banners/Swap";

export const getTransitions = (transition: "slide" | "flip", reverse: boolean = false) => {
  const mult = reverse ? -1 : 1;
  return {
    flip: {
      from: {
        opacity: 1,
        transform: `rotateX(${180 * mult}deg)`,
      },
      enter: {
        opacity: 1,
        transform: "rotateX(0deg)",
      },
      leave: {
        opacity: 1,
        transform: `rotateX(${-180 * mult}deg)`,
      },
      config: { mass: 20, tension: 200, friction: 100 },
    },
    slide: {
      from: {
        position: "absolute",
        opacity: 1,
        transform: `translate3d(${100 * mult}%,0,0)`,
      },
      enter: {
        opacity: 1,
        transform: "translate3d(0%,0,0)",
      },
      leave: {
        opacity: 1,
        transform: `translate3d((${-100 * mult}%,0,0)`,
      },
      initial: null,
    },
  }[transition];
};

export const getDefaultSlides = () => {
  return [
    { id: "backupPackBanner", Component: BackupPackBanner },
    { id: "ledgerAcademy", Component: LedgerAcademyBanner },
    { id: "swap", Component: SwapBanner },
    { id: "stakeCosmos", Component: StakeCosmosBanner },
    { id: "buyCrypto", Component: BuyCryptoBanner },
    { id: "stakeAlgorand", Component: StakeAlgorandBanner },
  ];
};
