GithubHelp home page GithubHelp logo

davo / figmaapi-framer Goto Github PK

View Code? Open in Web Editor NEW
11.0 4.0 1.0 1021 KB

Framer examples to show how to query the Figma API

CoffeeScript 57.41% JavaScript 23.05% CSS 8.74% HTML 10.80%
figma-api framerjs

figmaapi-framer's Introduction

Figma API Wrapper for Framer - Work in progress

Importing Figma artwork in Framer. Images on this prototype were requested using the new Figma API.

Documentation

Purpose: This demo aims to show how to fetch content from a Figma File.

API Methods (Demo WIP)

  • requestFigmaFile this will fetch all the Canvas objects from the file url & loop to get the IDs for each Canvas.

  • requestFigmaImage this function will fetch an image from a canvas ID.

  • addToFigmaImageObject (WIP) this function will append the response from requestFigmaImage() and it will create a new Figma Image Layer.

  • loadImageFromFigmaCDN (WIP) this function will create a new Figma Image Layer and it will preload the image into the session cache.

  • setImageInFigmaImageLayer (WIP) this function include the image into the already created Figma Image Layer and it will push the Image Layer into the Page Component.

Configuration

  1. Open the secret.coffee in /modules and add your own Figma Personal Token
exports.token = 'ai3-57wg5gbhe9-cspl-gclno-deheq-1qfrpxq6ax7x'
exports.fileurl = 'https://www.figma.com/file/FileKey/YourFile'

For more documentation

Todo

  • Create API Wrapper Module.
  • Fetch GET single file from URL.
  • Parse canvas from a given figma JSON file.
  • Parse props from a FRAME node type.
  • Parse props from a VECTOR node.
  • Parse props from a LINE vector.
  • Parse props from a ELLIPSE vector.
  • Parse props from a RECTANGLE vector.
  • Parse props from a TEXT object.
  • Parse props from a TypeStyle node.
  • Fetch GET images from node.
  • Fetch GET projects.
  • Fetch GET comments.
  • Fetch POST comments.

Notes

  • Scale: The /v1/images/:key ENDPOINT provides a set of path parameters to have in mind. For instance scale will need to be exposed to the current screen density on the prototype.

figmaapi-framer's People

Contributors

davo avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar

Forkers

uiforks

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.