2017 © Pedro Peláez
 

craft-plugin lettering

Like Lettering.js, but in Twig

image

mmikkel/lettering

Like Lettering.js, but in Twig

  • Saturday, December 9, 2017
  • by mmikkel
  • Repository
  • 1 Watchers
  • 3 Stars
  • 111 Installations
  • PHP
  • 1 Dependents
  • 0 Suggesters
  • 0 Forks
  • 0 Open issues
  • 3 Versions
  • 25 % Grown

The README.md

Lettering plugin for Craft CMS 3.x

Like Lettering.js, but in Twig, (*1)

Requirements

This plugin requires Craft CMS 3.0.0-beta.23 or later., (*2)

Installation

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

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

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

    composer require mmikkel/lettering
  3. In the Control Panel, go to Settings → Plugins and click the “Install” button for Lettering., (*6)

Lettering Overview

Lettering is a port of Lettering.js, for Craft CMS., (*7)

Looking for the Craft 2 version? It's right here!, (*8)

Using Lettering

Split on characters

{% set text %}


Foo bar, (*9)

{% endset %} {{ text|lettering }}

Output:, (*10)

<p aria-label="Foo bar">
    <span class="char1" aria-hidden="true">F</span>
    <span class="char2" aria-hidden="true">o</span>
    <span class="char3" aria-hidden="true">o</span>
    <span class="char4" aria-hidden="true"> </span>
    <span class="char5" aria-hidden="true">b</span>
    <span class="char6" aria-hidden="true">a</span>
    <span class="char7" aria-hidden="true">r</span>
</p>

Split on words

{% set text %}


Foo bar baz, (*11)

{% endset %} {{ text|lettering('words') }}

Output:, (*12)

<p aria-label="Foo bar">
    <span class="word1" aria-hidden="true">Foo</span>
    <span class="word2" aria-hidden="true">bar</span>
    <span class="word3" aria-hidden="true">baz</span>
</p>

Split on lines

{% set text %}


Foo bar baz, (*13)

{% endset %} {{ text|lettering('lines') }}

Output:, (*14)

<p aria-label="Foo bar baz">
    <span class="line1" aria-hidden="true">Foo bar</span>
    <span class="line2" aria-hidden="true">baz</span>
</p>

Tag pair usage

{% filter lettering('words') %}  
    <h1>{{ entry.title }}</h1>  
{% endfilter %}

Extract aria label and chars/words/lines

{% set lettering = craft.lettering.chars('Sanctimonious Variable Lettering') %}  



{{ lettering.chars }}

Disclaimer

This plugin is provided free of charge and you can do whatever you want with it. Lettering is unlikely to mess up your stuff, but just to be clear: the author is not responsible for data loss or any other problems resulting from the use of this plugin., (*15)

Please report any bugs, feature requests or other issues here. Note that this is a hobby project and no promises are made regarding response time, feature implementations or bug fixes., (*16)

Pull requests are extremely welcome, (*17)

Brought to you by Fred Carlsen + Mats Mikkel Rummelhoff, (*18)

Plugin icon: L shape by Lluisa Iborra from the Noun Project, (*19)

The Versions

09/12 2017

dev-master

9999999-dev

Like Lettering.js, but in Twig

  Sources   Download

MIT

The Requires

 

cms craftcms craft-plugin craft lettering lettering-js

09/12 2017

1.0.1

1.0.1.0

Like Lettering.js, but in Twig

  Sources   Download

MIT

The Requires

 

cms craftcms craft-plugin craft lettering lettering-js

09/12 2017

1.0.0

1.0.0.0

Like Lettering.js, but in Twig

  Sources   Download

MIT

The Requires

 

cms craftcms craft-plugin craft lettering