Code Monkey home page Code Monkey logo

tip's Introduction

Triangulated image placeholders

tip is an easy-to-use, efficent, and lightweight library for triangulated image placeholders. It uses a highly-optimized format over 10x smaller than minified SVG. (Currently not production ready)

Check out this demo.

Usage

  1. Add the library to your HTML:
<head>
  ...
  <script src="https://cdn.jsdelivr.net/gh/rh12503/tip@latest/lib/tip.min.js"></script>
</head>
  1. Change the src attribute to data-src for any image with placeholders.

The library will look for the placeholder asset in the same location as the original image. To apply a blur filter on the placeholder, use the data-blur attribute.

Generating placeholders

Placeholder assets have the same name as the original asset but with the extension .tri. For example, image.png would become image.tri.

GUI

Install the GUI from the releases page.

CLI

In the future the command will be added to npx. Install the CLI using the command:

go get -u github.com/RH12503/tip-backend/tip

Generate the placeholder files by running

tip -in /path/to/image

or to process all images in a folder

tip -in /path/to/folder

The placeholder .tri files will be created in the same location as the image files!

Browser support

Every browser that has been updated within the last few years should be supported.

26 9 12 16 12.1 10

All major mobile browsers are also supported including: Safari on iOS, Android WebView, Chrome Android & iOS, Firefox for Android, Opera Android, and Samsung Internet.

Contributors

Thanks to for @bstncartwright for advice and implementing the original concept on his blog!

tip's People

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.