Giter VIP home page Giter VIP logo

figma-preview's Introduction

figma-preview

Get rendered *.PNG from Figma node using the Figma API

This is only a PoC for local testing. It is not recommended to run in production!!!

Run local:

git clone https://github.com/michaelstingl/figma-preview.git
cd figma-preview
sed -i -e 's/XX-XXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXX/replace-with-your-personal-access-token/g'  index.php
php -S localhost:8080

Return image data:

http://localhost:8080/?file=Ui4YzD3oQcxJSbzBEr80O9eU&node-id=18:646&format=.png

Return $imageUrl as text:

http://localhost:8080/?file=Ui4YzD3oQcxJSbzBEr80O9eU&node-id=18:646&format=.debug

Demo (live embeds)

Image 1/3 Image 2/3 Image 3/3
Source: Figma URL Source: Figma URL Source: Figma URL

Notes about image handling on GitHub.com

If you upload an image to GitHub, the URL of the image will be modified so your information is not trackable.

To host your images, GitHub uses the open-source project Camo. Camo generates an anonymous URL proxy for each image that starts with https://camo.githubusercontent.com/ and hides your browser details and related information from other users.

Anyone who receives your anonymized image URL, directly or indirectly, may view your image. To keep sensitive images private, restrict them to a private network or a server that requires authentication instead of using Camo.

Source: https://help.github.com/articles/about-anonymized-image-urls/

Special thanks

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.