How to use the @emotion/core.keyframes function in @emotion/core

To help you get started, we’ve selected a few @emotion/core examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github contiamo / operational-ui / src / utils / mixins.ts View on Github external
width: "100%",
  borderBottomLeftRadius: theme.borderRadius,
  borderBottomRightRadius: theme.borderRadius,
  border: `1px solid ${theme.color.error}`,
  borderTop: 0,
  transform: "translate3d(0, 100%, 0)",
  position: "absolute",
  backgroundColor: lighten(theme.color.error, 60),
  boxShadow: `0px 3px 5px #d3d1d3`,
  // Nudge up just a little bit to look blended into the form
  bottom: 2,
  left: 0,
  zIndex: theme.zIndex.formFieldError,
}))

export const floatIn = keyframes({
  from: {
    opacity: 0,
    transform: "translate3d(0, -6px, 0)",
  },
  to: {
    opacity: 1,
    transform: "translate3d(0, 0, 0)",
  },
})

export const resetTransform = keyframes({
  to: {
    transform: "none",
  },
})
github emotion-js / emotion / packages / core / __tests__ / warnings.js View on Github external
test('keyframes interpolated into plain string', () => {
  const animateColor = keyframes({
    'from,to': { color: 'green' },
    '50%': { color: 'hotpink' }
  })
  const rotate360 = keyframes({
    from: {
      transform: 'rotate(0deg)'
    },
    to: {
      transform: 'rotate(360deg)'
    }
  })

  renderer.create(
    <div>
  )
  expect((console.error: any).mock.calls).toMatchInlineSnapshot(`
            Array [
              Array [
                "\`keyframes\` output got interpolated into plain string, please wrap it with \`css\`.
</div>
github emotion-js / emotion / packages / core / __tests__ / server.js View on Github external
render: () =&gt; {
      const animation = keyframes(
        css`
          from {
            color: green;
          }
          to {
            color: blue;
          }
        `
      )
      return (
        
          <div>
        
      )
    }
  },</div>
github gremlin / chaoskit / src / components / Skeleton.js View on Github external
import PropTypes from 'prop-types';
import cx from 'classnames';
import { useTheme } from 'emotion-theming';
import { keyframes } from '@emotion/core';
import { rgba } from 'polished';

const skeletonKeyframes = keyframes({
  from: {
    backgroundPosition: '100% 0',
  },

  to: {
    backgroundPosition: '-100% 0',
  },
});

const Skeleton = ({ as: Component, className, ...props }) =&gt; {
  const theme = useTheme();

  return (
github codeforthailand / election-live / src / components / Loading.js View on Github external
/&gt;
    
  )
}

const t = n =&gt; `${(n / 10.5) * 100}%`
const a1 = keyframes({
  [t(0)]: { transform: "scaleY(0)" },
  [t(1)]: { transform: "scaleY(1)" },
})
const a2 = keyframes({
  [t(0)]: { transform: "scaleY(0)" },
  [t(2)]: { transform: "scaleY(0)" },
  [t(3)]: { transform: "scaleY(1)" },
})
const a3 = keyframes({
  [t(0)]: { transform: "scaleY(0)" },
  [t(4)]: { transform: "scaleY(0)" },
  [t(5)]: { transform: "scaleY(1)" },
})
const a4 = keyframes({
  [t(0)]: { transform: "scaleY(0)" },
  [t(6)]: { transform: "scaleY(0)" },
  [t(7)]: { transform: "scaleY(1)" },
})
const a5 = keyframes({
  [t(0)]: { transform: "rotate(45deg) scaleY(0)" },
  [t(8)]: { transform: "rotate(45deg) scaleY(0)" },
  [t(9)]: { transform: "rotate(45deg) scaleY(1)" },
  to: { transform: "rotate(45deg) scaleY(1)" },
})
github contiamo / operational-ui / src / utils / mixins.ts View on Github external
opacity: 0,
    transform: "translate3d(0, -6px, 0)",
  },
  to: {
    opacity: 1,
    transform: "translate3d(0, 0, 0)",
  },
})

export const resetTransform = keyframes({
  to: {
    transform: "none",
  },
})

export const spin = keyframes({
  from: {
    transform: "rotate(0deg)",
  },
  to: {
    transform: "rotate(359deg)",
  },
})
github codeforthailand / election-live / src / components / ZoneMasterView.js View on Github external
left: 0,
        zIndex: 20,
        background: "#eee",
        animation: `${popup} 0.7s`,
        [media(DESKTOP_MIN_WIDTH)]: {
          position: "absolute",
          animation: "none",
        },
      }}
    &gt;
      {children}
    
  )
}

const popup = keyframes({
  from: {
    transform: "translateY(100%) scale(0.5)",
  },
  "50%": {
    transform: "scale(0.5)",
  },
  to: {
    transform: "translateY(0%)",
  },
})
github Workday / canvas-kit / modules / skeleton / react / lib / skeleton.tsx View on Github external
({diagonal, topPosition, width}) => {
    const backgroundPositionAnimation = keyframes({
      from: {
        left: `-${diagonal}px`,
      },
      to: {
        left: `${diagonal + width}px`,
      },
    });

    return {
      animation: `${backgroundPositionAnimation} ${DURATION}s ease-in-out infinite`,
      background: `linear-gradient(130deg, rgba(255,255,255,0) ${TRANSPARENCY_POSITION}%, ${
        canvas.colors.frenchVanilla100
      }, rgba(255,255,255,0)  ${TRANSPARENCY_POSITION + WHITE_SHEEN_WIDTH}%)`,
      backgroundRepeat: 'no-repeat',
      backgroundSize: `${diagonal}px ${diagonal}px`,
      width: diagonal,
github contiamo / operational-ui / src / Spinner / Spinner.tsx View on Github external
* @default 18px
   */
  size?: number
  /** Renders a bouncing animation as opposed to a regular spinning one. */
  bounce?: boolean
  /**
   * Indicates that this component is left of other content, and adds an appropriate right margin.
   */
  left?: boolean
  /**
   * Indicates that this component is right of other content, and adds an appropriate left margin.
   */
  right?: boolean
}

const spinKeyframes = keyframes({
  "0%": {
    transform: "rotate(0deg)",
  },
  "100%": {
    transform: "rotate(360deg)",
  },
})

const bounceKeyframes = keyframes({
  "0%": {
    transform: "translate3d(0, 0, 0)",
  },
  "30%": {
    transform: "translate3d(0, -4px, 0)",
  },
  "60%": {
github collector-bank / collector-portal-framework / src / common / components / Spinner / index.tsx View on Github external
},
});

const AnimatedCircle = styled.circle({
    animation: `${animation} 2s linear infinite`,
    fill: 'none',
});

export const SpinnerSvg: React.FC&lt;{ color: string; size: string | number }&gt; = ({ color, size }) =&gt; (
    <svg viewBox="0 0 100 100" height="{size}" width="{size}">
        
        
    </svg>
);

const fadeIn = keyframes({
    '0%': { opacity: 0 },
    '100%': { opacity: 1 },
});

const Container = styled.div(({ size, centered }) =&gt; {
    const styles: CSSObject = {
        display: 'inline-block',
        animation: `${fadeIn} 250ms ease-in-out`,
        width: size,
        height: size,
    };

    if (centered) {
        styles.position = 'absolute';
        styles.top = `calc(50% - ${size! / 2}px)`;
        styles.left = `calc(50% - ${size! / 2}px)`;