Git Product home page Git Product logo

halfstyle's Introduction

#HalfStyle


##style each half of a character, independently and individually.
An easy to use plugin.

HalfStyle is a set of advanced CSS rules that allow styling each half of a character, independently and individually.

Works on any dynamic text, or a single character, and is all automated. All you need to do is add a class on the target text and the rest is taken care of.


#[**See a Demo**][1]
#[**Download**][2]
###For a single character:

Pure CSS. All you need to do is add the class .halfStyle class to the element containing the character you want to be half-styled.

For each element containing the character, a data attribute holds the character, for example data-content="X", and the pseudo element uses content:attr(data-content); so the .halfStyle:before class will be dynamic and you won't need to hard code it for every instance.

###For Any text:

Simply add .textToHalfStyle class to the element containing the text. The included jQuery snippet will do the rest of the job.


##License - HalfStyle is licensed under the MIT License located at: - https://github.com/arbelh/HalfStyle/blob/master/license.md

##Changelog

  • v1.2.0
  • Moving DOM write to outside of loop (better performance)
  • v1.1.0
  • Replaced DOM ready function with the short version with failsafe $ alias
  • Initializing vars only once in each scope
  • Removed unnecessary searches in the DOM ( multiple $('') statements for the same item )
  • Shortened some code
  • Now supports more than one element with HalfStyle full text replacement (multiple .textToHalfStyle elements)
  • v1.0.1
  • Added support for accessibility, like audio screen readers or brail readers for the blind or visually impaired.
  • Now the base char is selectable by mouse.
  • v1.0.0 - First Version

##Author


[1]: http://jsfiddle.net/pd9yB/400/ [2]: https://github.com/arbelh/HalfStyle/archive/master.zip

halfstyle's People

Contributors

arbelh avatar mstrutt avatar

Watchers

 avatar James Cloos avatar

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.