Dima Mironov 10 ani în urmă
părinte
comite
7b9aafe16c
2 a modificat fișierele cu 25 adăugiri și 3 ștergeri
  1. 24 0
      js/models/particles.json
  2. 1 3
      js/views/particle.js

+ 24 - 0
js/models/particles.json

@@ -0,0 +1,24 @@
+{particles:
+	 {
+	 	type: "Higgs",
+		mass: 125,
+		charge: 0,
+		points: 125,
+		appearence_probabilty: .03,
+		half_life: 5,
+		decays: [{particles: ["W", "W"], probability: 1.}],
+		draw_properties: {
+			colors: ["hsl(0, 100%, 50%)", "hsl(0, 40%, 50%)"],
+			ratios: [0, 1],
+			inner_radius: .03,
+			outer_radius: .13,
+			inner_center: {x: .07, y: .07},
+			outer_center: {x: 0, y: 0}
+		},
+		animation_function: function(pv){
+		 	createjs.Tween.get(pv, {loop: true})
+            	.to({ scaleX: 0.9, scaleY: 1.1 }, 200)
+            	.to({ scaleX: 1.1, scaleY: 0.9 }, 200);
+		   }
+	}	
+}

+ 1 - 3
js/views/particle.js

@@ -11,9 +11,7 @@
 				dp.outer_center.x * cs, dp.outer_center.y * cs, dp.outer_radius * cs)
 			.drawCircle(0, 0, cs * dp.outer_radius);
         // this.graphics.beginFill("red").drawCircle(0, 0, window.cell_size * 0.2 / 2);
-        createjs.Tween.get(this, {loop: true})
-            .to({ scaleX: 0.9, scaleY: 1.1 }, 200)
-            .to({ scaleX: 1.1, scaleY: 0.9 }, 200);
+      	this.model.animation_function(this); 
     }
 
     ParticleView.prototype = new createjs.Shape();