Created
February 24, 2009 20:51
-
-
Save subtleGradient/69777 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Shape.Circle = new Shape({ | |
| Extends:Shape, | |
| outline:{ | |
| // rules for drawing a circle | |
| } | |
| }); | |
| Shape.Rectangle = new Shape({ | |
| Extends:Shape, | |
| outline:{ | |
| // rules for drawing a box | |
| } | |
| }); | |
| Shape.EmailIcon = new Shape({ | |
| Extends:Shape, | |
| height:'100%', | |
| width:'100%', | |
| outline:{ | |
| // rules for drawing a vector graphic | |
| }, | |
| color:green, // the fill color for the shape | |
| box_shadow:[1, 1, black, 'inside'] | |
| }); | |
| JSS({ | |
| 'Toolbar':{ | |
| Extends:Rectangle, | |
| Implements:KeyboardAccessibleWidget, | |
| background:gradient(blue,green) | |
| }, | |
| 'Toolbar_Button':{ | |
| Extends:Circle, | |
| height:'100%', | |
| width:'100%', | |
| padding:10, | |
| margin:10, | |
| background:gradient(blue,green), | |
| background_fill:stretch, | |
| background_position:[center,center], | |
| box_shadow:[1, 1, black], | |
| hover:{ | |
| background_image_opacity:0.5, | |
| background_color:blue | |
| }, | |
| active:{ | |
| background_image_opacity:1, | |
| background_color:green | |
| } | |
| } | |
| }); | |
| var toolbar = new Toolbar(); | |
| var submitButton = new Toolbar_Button() | |
| .adopt(new Shape.EmailIcon()) | |
| .inject(toolbar) | |
| .addEvents({ | |
| 'click': function(event){ | |
| Email.send(); | |
| event.stop(); | |
| } | |
| }); | |
| toolbar.inject($(document.body)); // injecting a shape into an HTML element creates the canvas and actually does the drawing. |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment