Skip to content

Instantly share code, notes, and snippets.

@lintonye
Created August 21, 2018 21:37
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save lintonye/73bd99ff6ff704ce9b773a151f4381b3 to your computer and use it in GitHub Desktop.
Save lintonye/73bd99ff6ff704ce9b773a151f4381b3 to your computer and use it in GitHub Desktop.
import { Data, Override } from "framer";
const data = Data({ cardFocus: "number" }); // => App state
export const Flip: Override = () => {
return {
onTap() {
// toggle card focus which determines the visible side of the card
data.cardFocus = data.cardFocus === "number" ? "cvc" : "number";
}
};
};
export const ChangeFocus: Override = () => {
return {
// This goes to set the "focused" prop of the card component
focused: data.cardFocus
};
};
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment