2017 © Pedro Peláez
 

craft-plugin placeholder-pixel

Create a base64-encoded transparent pixel of the given width and height

image

tibemolde/placeholder-pixel

Create a base64-encoded transparent pixel of the given width and height

  • Thursday, February 15, 2018
  • by tibemolde
  • Repository
  • 1 Watchers
  • 1 Stars
  • 12 Installations
  • PHP
  • 0 Dependents
  • 0 Suggesters
  • 0 Forks
  • 0 Open issues
  • 4 Versions
  • 0 % Grown

The README.md

Placeholder Pixel plugin for Craft CMS 3.x

Create a base64-encoded transparent pixel of the given width and height, (*1)

Pixels once generated are cached on a width * height basis to reduce load, (*2)

Requirements

This plugin requires Craft CMS 3.0.0-RC1 or later., (*3)

Installation

To install the plugin, follow these instructions., (*4)

  1. Open your terminal and go to your Craft project:, (*5)

    cd /path/to/project
  2. Then tell Composer to load the plugin:, (*6)

    composer require tibemolde/placeholder-pixel
  3. In the Control Panel, go to Settings → Plugins and click the “Install” button for Placeholder Pixel., (*7)

Placeholder Pixel Overview

Create a base64-encoded transparent pixel of the given width and height, (*8)

Configuring Placeholder Pixel

No configuration is needed outside of runtime-options, (*9)

Using Placeholder Pixel

Base usage:, (*10)

craft.placeholderPixel.get(options)

Default options:, (*11)

{
    width       : 1,
    height      : 1,
    aspectRatio : {
        w: 16,
        h: 10
    }
}    

Examples:, (*12)

  1. 1 x 1 pixel:, (*13)

    <img src="{{ craft.placeholderPixel.get }}" alt="">
  2. Pixel with two specific dimensions:, (*14)

    <img src="{{ craft.placeholderPixel.get({width: 64, height: 64}) }}" alt="">
  3. Pixel with one specific dimension and default aspect-ratio:, (*15)

    <img src="{{ craft.placeholderPixel.get({width: 1024}) }}" alt="">
  4. Pixel with one specific dimension and specific aspect-ratio:, (*16)

    <img src="{{ craft.placeholderPixel.get({width: 1024, aspectRatio: {w: 5, h: 4}}) }}" alt="">

Placeholder Pixel Roadmap

Some things to do, and ideas for potential features:, (*17)

  • Make it better, somehow? :o

Brought to you by TIBE Molde, (*18)

The Versions

15/02 2018

dev-master

9999999-dev

Create a base64-encoded transparent pixel of the given width and height

  Sources   Download

MIT

The Requires

 

cms craftcms craft-plugin craft placeholder pixel

15/02 2018

v1.1.2

1.1.2.0

Create a base64-encoded transparent pixel of the given width and height

  Sources   Download

MIT

The Requires

 

cms craftcms craft-plugin craft placeholder pixel

15/02 2018

v1.1.1

1.1.1.0

Create a base64-encoded transparent pixel of the given width and height

  Sources   Download

MIT

The Requires

 

cms craftcms craft-plugin craft placeholder pixel

15/02 2018

v1.1.0

1.1.0.0

Create a base64-encoded transparent pixel of the given width and height

  Sources   Download

MIT

The Requires

 

cms craftcms craft-plugin craft placeholder pixel