MCPcopy
hub / github.com/primer/react / getSlideAnimationStartingVector

Function getSlideAnimationStartingVector

packages/react/src/Overlay/Overlay.tsx:48–60  ·  view source on GitHub ↗
(anchorSide?: AnchorSide)

Source from the content-addressed store, hash-verified

46const animationDuration = 200
47
48function getSlideAnimationStartingVector(anchorSide?: AnchorSide): {x: number; y: number} {
49 if (anchorSide?.endsWith('bottom')) {
50 return {x: 0, y: -1}
51 } else if (anchorSide?.endsWith('top')) {
52 return {x: 0, y: 1}
53 } else if (anchorSide?.endsWith('right')) {
54 return {x: -1, y: 0}
55 } else if (anchorSide?.endsWith('left')) {
56 return {x: 1, y: 0}
57 }
58
59 return {x: 0, y: 0}
60}
61
62export const StyledOverlay = styled.div<StyledOverlayProps>`
63 background-color: ${get('colors.canvas.overlay')};

Callers 1

Overlay.tsxFile · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected