/hoverUnitConvert

Creating a small tool that will parse hovered text unit values and convert them from imperial to metric

hoverUnitConvert

A tool to detect units being hovered over and convert them from imperial to metric and vice versa. It will convert:

  • mm <--> in
  • cm <--> in
  • meters <--> feet
  • kilometers <--> miles
  • grams <--> lbs

Installation

Require the library on pages where you want the function available to convert units

Usage

This tool specifically will only convert the units. When used in collaboration with a tooltip generator, hovering over a unit of one system will show the converted units of the other. E.g. hovering over "2cm" would generate a tooltip showing ".78in" and vice versa

Contributing

  1. Fork it!
  2. Create your feature branch: git checkout -b my-new-feature
  3. Commit your changes: git commit -am 'Add some feature'
  4. Push to the branch: git push origin my-new-feature
  5. Submit a pull request :D

History

TODO: Write history

Credits

Alek Hartzog Eric Hartzog

To Dos

PHASE 1:

  1. Determine how to detect a numerical value followed by a unit symbol on hover
  2. Write script that will detect when a numerical value followed by a unit symbol being hovered over
  3. Create a set of unit conversions (inches to centimeters, feet to meters, etc and vice versa)
  4. Return the converted value

PHASE 2:

  1. Build or integrate a tooltip to show the converted value

Ideas

  • Package as a wordpress plugin
  • Add tooltip themes
  • Add ability for custom tooltip styling
  • Add different tooltip locations