Permalink
Browse files

adding new example cdj deck

  • Loading branch information...
1 parent 40091b0 commit 80f912535c0feea2f0aebb8d0190448be5eda869 @dnewcome committed Nov 21, 2011
Showing with 49 additions and 0 deletions.
  1. +49 −0 samples/cdj.html
View
@@ -0,0 +1,49 @@
+<!doctype html>
+<html>
+<head>
+ <script src="../donatello.js" type="text/javascript"></script>
+ <script src="../circle.js" type="text/javascript"></script>
+ <script src="../ellipse.js" type="text/javascript"></script>
+ <script>
+ function main() {
+ var colors = [
+ '#717171', '#A71717', '#8AA717', '#34A717', '#17A751', '#17A7A7', '#1751A7', '#3417A7'
+ ];
+ var paper = Donatello.paper('paper-div', 20, 20, 500, 500 );
+ paper.attr( {fill:'black'} );
+ paper.circle( 250, 250, 125, {
+ stroke:'gray',
+ 'stroke-width': 1,
+ // 'fill': '#c1c1c1',
+ 'backgroundImage': Donatello.createLinearGradient( 90, '#000000', '#FFFFFF' ),
+ } );
+
+ paper.circle( 250, 250, 120, { stroke:'#9f9f9f', 'stroke-width': 1, 'fill': '#c1c1c1' } );
+ paper.circle( 250, 250, 100, { stroke:'white', 'stroke-width': 1, 'fill': 'grey' } );
+ var r = 110;
+ for( var i=0; i < 16; i ++ ) {
+ var x = Math.cos( i*Math.PI/8 )*r;
+ var y = Math.sin( i*Math.PI/8 )*r;
+ var circle = paper.ellipse( 250 + x, 250 + y, 9, 7, {
+ 'stroke-width': 0,
+ 'stroke': 'grey',
+ 'stroke-style': 'solid',
+ 'backgroundImage': Donatello.createLinearGradient( i*Math.PI/8*180/Math.PI, '#000000', '#FFFFFF' ),
+ });
+ // circle.rotate( (i*Math.PI/4)*180/Math.PI );
+ circle.rotate( (i*Math.PI/8)*180/Math.PI+90 );
+ }
+ }
+ </script>
+ <style>
+ #paper-div {
+ border: 1px solid black
+ }
+ </style>
+
+</head>
+<body onload='main();'>
+ <div id="paper-div">
+ </div>
+</body>
+</html>

0 comments on commit 80f9125

Please sign in to comment.