Skip to content

niklasvh/WebGL-CSS-Shaders

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

5 Commits
 
 
 
 
 
 
 
 

Repository files navigation

CSS Shaders through WebGL

For more information and demos, please read the introduction here.

Usage

To have the script parse all the CSS automatically (very experimental), just call:

CSSshaders.init();

To manually add a shader:

CSSshaders.add( element, shaderParameters ); - returns shader element

Example:

CSSshaders.add( "#content","url(shaders/flag.vs) url(shaders/grayscale.fs), 20 20, phase 50.0, amplitude 100.0, txf rotateX(45deg), amount 1")

Shader element methods:

  • transition( duration, function); - adds transition with specified duration and function, returns Shader element
  • state( shaderParameters ); - creates CSS state with specified parameters, returns Shader state

Shader state methods:

  • enable() - enable state
  • disable() - disable state
  • toggle() - toggle state

About

CSS Shaders through WebGL

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published