Git Product home page Git Product logo

cadigan's Introduction

Cadigan

Cadigan is a web API that serves placeholder .PNG images for designing and prototyping web applications.

Features

  • Fast placeholder PNG images
  • Custom size, colour and placeholder text

Upcoming Features

  • Custom font size and family
  • New background shapes, such as ellipses and rounded rectangles
  • A choice of image formats (JPEG, GIF, SVG)

Getting Started

If you are using a public instance of Cadigan, jump straight to step 3, Using Cadigan.

1. Prerequisites

  • Node.js - Version 10.x or higher
  • Git

2. Installation

  • Clone this repository using Git
  • Start the server with npm start
  • Verify that the server is running with the message Listening on <port>.

3. Using Cadigan

Wherever you need an image, and can include one by URL (such as an HTML img tag or CSS url(...)), you can point to Cadigan to use a custom placeholder image.

The image URI consists of the domain name, followed by any of the following parameters. Any parameter may be omitted, but each must be specified in the correct order.

  • size - If a square image is required, a single integer should be passed between, 30 and 512, specifying the side length, in pixels, of the square. For a rectangular image, two integers within the same range should be provided, separated by the letter 'x', e.g. 128x256, indicating the width and height of the image in pixels. Defaults to 128x128.
  • text - An arbitrary string of text to render in the image. If the text is too long to fit in the image, it will wrap on to a new line. Defults to placeholder.
  • background colour - A solid colour to fill the background of the image. A hexidecimal RGB colour code, either 3 or 6 hex digits. Defaults to #969696.
  • text colour - The colour of the text of the image. A hexidecimal RGB colour code, either 3 or 6 hex digits. Defaults to 30% opacity black, darkening the background colour.

Examples

  • /

/

  • /64

/64

  • /128x64/Example/

/128x64/Example/

  • /64/Hello,%20World!/f000

/64/Hello,%20World!/f00

  • /FB/5af2db/286

/FB/5af2db/286

Technologies

Contributors

License

Cadigan is licensed under the GNU Lesser General Purpose License 3.0. See LICENSE for more information.

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.