This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// The node with the mouseOver event has the background image we are moving | |
const calcParallax = e => { | |
const speed = -0.009 | |
const distX = e.clientX / 2 | |
const distY = e.clientY | |
e.currentTarget.style.backgroundPositionX = `calc(50% + ${(distX * speed)}px)` | |
e.currentTarget.style.backgroundPositionY = `calc(50% + ${(distY * speed)}px)` | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
//Obviously before we need graphql | |
yarn add graphql | |
// Installation | |
yarn add -D @graphql-codegen/cli @graphql-codegen/typescript @graphql-codegen/typescript-operations @graphql-codegen/introspection @graphql-codegen/typescript-react-apollo | |
// Initiate | |
yarn graphql-codegen init | |
// script |