Skip to content

Commit 1bc39a1

Browse files
author
Emily
authored
Merge pull request #692 from primer/PrimerCSSAnimation
Primer CSS Animation
2 parents 05b66d8 + 76816e5 commit 1bc39a1

File tree

6 files changed

+49
-33
lines changed

6 files changed

+49
-33
lines changed

docs/landing/PrimerCSSAnimation.js

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
import React from 'react'
2+
import dynamic from 'next/dynamic'
3+
import animation from './PrimerCSSAnimation.json'
4+
5+
const ReactBodymovin = dynamic(() => import('react-bodymovin'), {
6+
ssr: false
7+
})
8+
9+
const bodymovinOptions = {
10+
loop: true,
11+
autoplay: true,
12+
prerender: true,
13+
animationData: animation
14+
}
15+
16+
const PrimerCSSAnimation = props => <ReactBodymovin options={bodymovinOptions} {...props} />
17+
18+
export default PrimerCSSAnimation

docs/landing/PrimerCSSAnimation.json

Lines changed: 1 addition & 0 deletions
Large diffs are not rendered by default.

docs/landing/index.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ import ComponentsImage from './ComponentsImage.svg'
88
import SpacingImage from './SpacingImage.svg'
99
import ColorImage from './ColorImage.svg'
1010

11-
export {default as HeaderImage} from './HeaderImage.svg'
11+
export {default as PrimerCSSAnimation} from './PrimerCSSAnimation.js'
1212

1313
const OverviewTitle = props => <Heading fontSize={3} fontWeight="normal" is="div" {...props} />
1414
const OverviewText = props => <Text fontSize={1} {...props} />

package-lock.json

Lines changed: 24 additions & 30 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -136,5 +136,8 @@
136136
"unist-util-stringify-position": "^2.0.0",
137137
"unist-util-visit": "^1.4.0",
138138
"webpack": "4.20.2"
139+
},
140+
"dependencies": {
141+
"react-bodymovin": "2.0.0"
139142
}
140143
}

pages/css/index.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
import {Box, Flex, Heading, Link, Text} from '@primer/components'
22
import {
3-
HeaderImage,
3+
PrimerCSSAnimation,
44
MetaPackageBox,
55
PrimerPackageBox,
66
PrimitivesOverview,
@@ -20,7 +20,7 @@ export const Hero = () => (
2020
<Text is="div" color="blue.2" fontSize={2} mb={4}>
2121
v{version}
2222
</Text>
23-
<Box is={HeaderImage} mb={6} />
23+
<Box is={PrimerCSSAnimation} mb={6} />
2424
</Box>
2525
</Box>
2626
</Box>

0 commit comments

Comments
 (0)