Difference between revisions of "Template:Pitt"

Line 158: Line 158:
 
var padding = parseInt($(this).parent().css("padding-left")) + parseInt($(this).parent().css("padding-right"));
 
var padding = parseInt($(this).parent().css("padding-left")) + parseInt($(this).parent().css("padding-right"));
 
var newWidth = parseInt($(this).parent().css("width")) + padding;
 
var newWidth = parseInt($(this).parent().css("width")) + padding;
if (newWidth > parseInt($(this).css("width"))){
+
$(this).css("width", newWidth + 'px');
$(this).css("width", newWidth + 'px');
+
} else {
+
$(this).parent().css("width", (parseInt($(this).css("width")) - padding) +'px');
+
}
+
 
});
 
});
  
Line 261: Line 257:
  
 
var c = document.getElementById("bannerCanvas");
 
var c = document.getElementById("bannerCanvas");
 +
c.height = $(window).height();
 +
c.width = $(window).width();
 
var ctx = c.getContext("2d");
 
var ctx = c.getContext("2d");
  
Line 266: Line 264:
 
var radius = 50;
 
var radius = 50;
 
radius = radius * 0.90;
 
radius = radius * 0.90;
var grd = ctx.createRadialGradient(radius,radius,1,radius,radius,radius);
+
var grd = ctx.createRadialGradient(event.clientX - document.body.scrollLeft,event.clientY - document.body.scrollTop,0,event.clientX - document.body.scrollLeft,event.clientY - document.body.scrollTop,radius);
grd.addColorStop(0,"red");
+
grd.addColorStop(0,"yellow");
grd.addColorStop(1,"white");
+
grd.addColorStop(1,"black");
  
 
// Fill with gradient
 
// Fill with gradient
 
ctx.fillStyle = grd;
 
ctx.fillStyle = grd;
  
ctx.arc(radius, radius, radius, 0 , 2*Math.PI);
+
ctx.arc(event.clientX - document.body.scrollLeft,event.clientY - document.body.scrollTop, radius, 0 , 2*Math.PI);
 
ctx.fill();
 
ctx.fill();
  
Line 392: Line 390:
 
font-weight: bold;
 
font-weight: bold;
 
font-family: "Trebuchet MS", Helvetica, sans-serif;
 
font-family: "Trebuchet MS", Helvetica, sans-serif;
}
 
 
#bannerContainer canvas {
 
height:100%;
 
width:100%;
 
 
}
 
}
  
Line 448: Line 441:
  
 
#bannerCanvas {
 
#bannerCanvas {
   position: absolute;
+
   position: fixed;
 
   width: 100%;
 
   width: 100%;
 
z-index:-1;
 
z-index:-1;
 +
height: 100%;
 +
left: 0;
 +
top: 0;
 
}
 
}
  

Revision as of 15:50, 29 May 2015