1210 if(p.color.rgb){
1211 var color_value = 'rgba('+p.color.rgb.r+','+p.color.rgb.g+','+p.color.rgb.b+','+p.opacity+')';
1212 }else{
1213 var color_value = 'hsla('+p.color.hsl.h+','+p.color.hsl.s+'%,'+p.color.hsl.l+'%,'+p.opacity+')';1214 }
1215 return color_value;
1216 });
1081 }
1082 else{
1083 var pos_x = e.offsetX || e.clientX,
1084 pos_y = e.offsetY || e.clientY;1085 }
1086
1087 pJS.interactivity.mouse.pos_x = pos_x;
1080 pos_y = e.clientY;
1081 }
1082 else{
1083 var pos_x = e.offsetX || e.clientX,1084 pos_y = e.offsetY || e.clientY;
1085 }
1086
961
962 if(pJS.tmp.repulse_clicking){
963
964 var repulseRadius = Math.pow(pJS.interactivity.modes.repulse.distance/6, 3); 965
966 var dx = pJS.interactivity.mouse.click_pos_x - p.x,
967 dy = pJS.interactivity.mouse.click_pos_y - p.y,
885 if(!pJS.tmp.bubble_duration_end){
886 if(dist_mouse <= pJS.interactivity.modes.bubble.distance){
887 if(p_obj_bubble != undefined) var obj = p_obj_bubble;
888 else var obj = p_obj; 889 if(obj != bubble_param){
890 var value = p_obj - (time_spent * (p_obj - bubble_param) / pJS.interactivity.modes.bubble.duration);
891 if(id == 'size') p.radius_bubble = value;
The var
keyword is soft-deprecated, and should not be used to redeclare existing variables.
It is possible to re-declare the same variable using the var
keyword:
var a = 1;
var a = 10; // valid!
However, this can have unintentional side effects on the code:
var x = 10;
{
var x = 20;
}
console.log(x); // 20
var db = dbDriver.loadTables()
{
var db = db.get("usersId:1234") // bad practice!
}
// always use 'let' or 'const'
const db = dbDriver.loadTables();
{
const users = db.get("userId:1234") // avoid shadowing
}