Advertisement
Guest User

Untitled

a guest
Nov 28th, 2015
81
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. // JavaScript Document
  2. window.onload= function(){
  3.    
  4.     var paper = new Raphael(0,0, 1250, 450);
  5.     var background = paper.image("space.jpg", 0, 0, 1600, 450);
  6.    
  7.     function sun_enter(){
  8.         var sun = paper.ellipse(0, 227.883, 100, 100);
  9.         sun.attr({fill: "yellow"});
  10.         sun.animate({cx: 140},50, mercury_enter);
  11.     }
  12.    
  13.     sun_enter(); //call to the sun enter function
  14.  
  15.    
  16.     function mercury_enter(){
  17.         var mercury = paper.ellipse(-100, 235.971, 20, 20);
  18.         mercury.attr({fill: "grey"});
  19.         mercury.animate({cx: 290.588},50);
  20.         venus_enter();
  21.     }
  22.    
  23.     function venus_enter(){
  24.         var venus = paper.ellipse(-100, 244.795, 30, 30);
  25.         venus.attr({fill: "#D1B279"});
  26.         var venus_anim = Raphael.animation({transform: ['t', 493.118,0 ]},50);
  27.         venus.animate(venus_anim.delay(300));
  28.         earth_enter();
  29.     }
  30.    
  31.     function earth_enter(){
  32.         var earth = paper.ellipse(-100, 256.588, 35, 35);
  33.         earth.attr({fill: "45-green-blue"});
  34.         var earth_anim = Raphael.animation({transform: ['t', 590.882,0 ]},50);
  35.         earth.animate(earth_anim.delay(300));
  36.         mars_enter();
  37.     }
  38.    
  39.     function mars_enter(){
  40.         var mars = paper.ellipse(-100, 251.412, 25, 25);
  41.         mars.attr({fill: "75-brown-orange"});
  42.         var mars_anim = Raphael.animation({transform: ['t', 670.471,0 ]},50);
  43.         mars.animate(mars_anim.delay(600));
  44.         saturn_enter();
  45.     }
  46.    
  47.     function saturn_enter(){
  48.         var saturn = paper.ellipse(-100, 291.485, 45, 45);
  49.         saturn.attr({fill: "#CFC192"});
  50.         var saturn_anim = Raphael.animation({transform: ['t', 766.647,0 ]},50);
  51.         saturn.animate(saturn_anim.delay(600));
  52.         jupiter_enter();
  53.     }
  54.    
  55.     function jupiter_enter(){
  56.         var jupiter = paper.ellipse(-100, 259.529, 29, 29);
  57.         jupiter.attr({fill: "blue"});
  58.         var jupiter_anim = Raphael.animation({transform: ['t', 890.882,0 ]},50);
  59.         jupiter.animate(jupiter_anim.delay(1000));
  60.         uranus_enter();
  61.     }
  62.    
  63.     function uranus_enter(){
  64.         var uranus = paper.ellipse(-100, 279.735, 23, 23);
  65.         uranus.attr({fill: "#CFC192"});
  66.         var uranus_anim = Raphael.animation({transform: ['t', 953.412,0 ]},50);
  67.         uranus.animate(uranus_anim.delay(1000));
  68.         neptune_enter();
  69.     }
  70.    
  71.     function neptune_enter(){
  72.         var neptune = paper.ellipse(-100, 291.485, 35, 35);
  73.         neptune.attr({fill: "blue"});
  74.         var neptune_anim = Raphael.animation({transform: ['t', 1089.441,0 ]},50);
  75.         neptune.animate(neptune_anim.delay(1350));
  76.         pluto_enter();
  77.     }
  78.        
  79.     function pluto_enter(){
  80.    
  81.         var pluto = paper.ellipse(-100, 273.117, 13, 13);
  82.         pluto.attr({fill: "grey"});
  83.         var pluto_anim = Raphael.animation({transform: ['t', 1170.441,0 ]},50);
  84.         pluto.animate(pluto_anim.delay(1350));
  85.         sun_enter();
  86.     }
  87.        
  88.     function sun_random(){
  89.     var sun_anim = Raphael.animation({cx: 400},600);
  90.     sun.animate(sun_anim.delay(1800));
  91.     var sun_anim2 = Raphael.animation({cy: 250},500);
  92.     sun.animate(sun_anim2.delay(2400));
  93.     }
  94.    
  95.     function mercury_move(){
  96.     mercury.animate({cx: 400, cy: 50 },600);
  97.    
  98.     }
  99.    
  100.     function planets_random(){
  101.         sun_random();
  102.         mercury_random();
  103.        
  104.     }
  105.  
  106.  
  107.    
  108.        
  109.        
  110.    
  111.        
  112.    
  113.    
  114.    
  115. };
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement