Giter VIP home page Giter VIP logo

front_screenshot's Introduction

Front Screenshot

Build Status

This library bundles

Into an library with no dependencies, that can transform SVG elements into images or Canvas elements, and take screenshots of your page or sections of it, even if they are hidden due to CSS properties such as overlay scroll, hidden or auto.

Why?

Basically, because chart libraries such as C3.js can style SVG elements with rotation and other transformations that HTML2Canvas cannot parse. So I combined its features with the ones on Canvg to preprocess a given container, transforming each SVG element into an image, then capturing the screenshot, then restoring the original SVG.

Some additions and removal of properties, attributes and classnames where cumbersome to add using native document.querySelectorAll methods, so I also bundled Cash.js, a minimal jQuery alternative that provides just what's needed to manipulate DOM nodes.

Example

See the online example at: https://huasofoundries.github.io/front_screenshot/

Or, you can also clone this repo, run make install, then make run from its root and navigate to http://localhost:5000.

git clone https://github.com/HuasoFoundries/front_screenshot.git
cd front_screenshot
make install
make run

API

See USAGE.md

Install

Install it with

npm install front_screenshot

or, if you're using JSPM:

jspm install front_screenshot=npm:front_screenshot
jspm install front_screenshot=github:HuasoFroundries/front_screenshot

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.