peachananr/flat-shadow — pull request #1 by TalAter (2013-08-14 21:58:12+00:00)
Title: Shorter clearer code (35% smaller file), and support for passing random in data-color and data-angle

Great plugin, I've learned a lot from the tricks you've used here.
Still, I couldn't help myself from refactoring the switch case statement.
The result is smaller, slightly faster, while still (I believe) not sacrificing code readability.

*Changes:*
* Refactored the switch on angle statement to remove all the repeating code that is the same for all angles, leaving only the difference between the angles inside the switch. This change lowered the filesize from 8.1 kb to 5.3 kb. The only code change here (beside moving lines and deleting the repeating ones), is the addition of the iLimit variable which holds either the width or the height.
* Refactored if blocks that define angle, and shadow color so they are shorter, clearer, and also support passing **random** as the element's *color* or *angle* data-attribute.