Skip to content

JQuery plugin to change the colors of text using words as colorstops when constructing a gradient.

Notifications You must be signed in to change notification settings

eighteyes/Text-Prism

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

2 Commits
 
 
 
 
 
 

Repository files navigation

Text Prism
By: Sean Canton <[email protected]>
Date: 6/22/11

Version 1

Overview: Changes colors in words using a word index based approach and RGB CSS generation.

Usage: 
1) Load JQuery, Load Plugin.

2) Setup word index as array of word positions. ( 'cat' is at index 2 in "The lazy cat snoozed upon the grey sofa" )
EX: var wordIndex = [0, 4, 14];

3) Setup color index as a nested array of RGB values
EX: var colorIndex = [ [0,0,0], [120,120,120], [255,0,0] ];

4) Call the plugin and pass in the settings.

$('#target').textPrism(wordIndex, colorIndex)

This will replace the HTML in #target with psuedo-spans around every word. This is what controls the color through a CSS3 :nth-of-type selector.

About

JQuery plugin to change the colors of text using words as colorstops when constructing a gradient.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published