-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
236a07b
commit 81394bb
Showing
36 changed files
with
612 additions
and
50 deletions.
There are no files selected for viewing
Binary file not shown.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file not shown.
Binary file not shown.
Empty file.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Empty file.
Empty file.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,82 @@ | ||
<?php | ||
/** | ||
* @package WordPress | ||
* @subpackage Default_Theme | ||
*/ | ||
|
||
/** @ignore */ | ||
$img = 'kubrickheader.jpg'; | ||
|
||
// If we don't have image processing support, redirect. | ||
if ( ! function_exists('imagecreatefromjpeg') ) | ||
die(header("Location: kubrickheader.jpg")); | ||
|
||
// Assign and validate the color values | ||
$default = false; | ||
$vars = array('upper'=>array('r1', 'g1', 'b1'), 'lower'=>array('r2', 'g2', 'b2')); | ||
foreach ( $vars as $var => $subvars ) { | ||
if ( isset($_GET[$var]) ) { | ||
foreach ( $subvars as $index => $subvar ) { | ||
$length = strlen($_GET[$var]) / 3; | ||
$v = substr($_GET[$var], $index * $length, $length); | ||
if ( $length == 1 ) $v = '' . $v . $v; | ||
$$subvar = hexdec( $v ); | ||
if ( $$subvar < 0 || $$subvar > 255 ) | ||
$default = true; | ||
} | ||
} else { | ||
$default = true; | ||
} | ||
} | ||
|
||
if ( $default ) | ||
list ( $r1, $g1, $b1, $r2, $g2, $b2 ) = array ( 105, 174, 231, 65, 128, 182 ); | ||
|
||
// Create the image | ||
$im = imagecreatefromjpeg($img); | ||
|
||
// Get the background color, define the rectangle height | ||
$white = imagecolorat( $im, 15, 15 ); | ||
$h = 182; | ||
|
||
// Define the boundaries of the rounded edges ( y => array ( x1, x2 ) ) | ||
$corners = array( | ||
0 => array ( 25, 734 ), | ||
1 => array ( 23, 736 ), | ||
2 => array ( 22, 737 ), | ||
3 => array ( 21, 738 ), | ||
4 => array ( 21, 738 ), | ||
177 => array ( 21, 738 ), | ||
178 => array ( 21, 738 ), | ||
179 => array ( 22, 737 ), | ||
180 => array ( 23, 736 ), | ||
181 => array ( 25, 734 ), | ||
); | ||
|
||
// Blank out the blue thing | ||
for ( $i = 0; $i < $h; $i++ ) { | ||
$x1 = 19; | ||
$x2 = 740; | ||
imageline( $im, $x1, 18 + $i, $x2, 18 + $i, $white ); | ||
} | ||
|
||
// Draw a new color thing | ||
for ( $i = 0; $i < $h; $i++ ) { | ||
$x1 = 20; | ||
$x2 = 739; | ||
$r = ( $r2 - $r1 != 0 ) ? $r1 + ( $r2 - $r1 ) * ( $i / $h ) : $r1; | ||
$g = ( $g2 - $g1 != 0 ) ? $g1 + ( $g2 - $g1 ) * ( $i / $h ) : $g1; | ||
$b = ( $b2 - $b1 != 0 ) ? $b1 + ( $b2 - $b1 ) * ( $i / $h ) : $b1; | ||
$color = imagecolorallocate( $im, $r, $g, $b ); | ||
if ( array_key_exists($i, $corners) ) { | ||
imageline( $im, $x1, 18 + $i, $x2, 18 + $i, $white ); | ||
list ( $x1, $x2 ) = $corners[$i]; | ||
} | ||
imageline( $im, $x1, 18 + $i, $x2, 18 + $i, $color ); | ||
} | ||
|
||
//die; | ||
header("Content-Type: image/jpeg"); | ||
imagejpeg($im, '', 92); | ||
imagedestroy($im); | ||
?> |
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file not shown.
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,85 @@ | ||
var clockCanvColor = ["#000", "#000"]; | ||
function hoverClock(){ | ||
clockCanvColor = ["rgb(0,124,196)", "rgb(0,124,196)"]; | ||
draw(); | ||
} | ||
function unhoverClock(){ | ||
clockCanvColor = ["#000","#000"]; | ||
draw(); | ||
} | ||
|
||
function draw() { | ||
var canvas = document.getElementById('clockcanvas'); | ||
if (canvas.getContext) { | ||
var c2d=canvas.getContext('2d'); | ||
c2d.clearRect(0,0,30,30); | ||
//Define gradients for 3D / shadow effect | ||
var grad1=c2d.createLinearGradient(0,0,30,30); | ||
grad1.addColorStop(0,clockCanvColor[1]); | ||
grad1.addColorStop(1,clockCanvColor[0]); | ||
var grad2=c2d.createLinearGradient(0,0,30,30); | ||
grad2.addColorStop(0,clockCanvColor[0]); | ||
grad2.addColorStop(1,clockCanvColor[1]); | ||
c2d.font="Bold 14px Arial"; | ||
c2d.textBaseline="middle"; | ||
c2d.textAlign="center"; | ||
c2d.lineWidth=3; | ||
c2d.save(); | ||
//Outer bezel | ||
c2d.strokeStyle=grad1; | ||
c2d.lineWidth=3; | ||
c2d.beginPath(); | ||
c2d.arc(15,15,13,0,Math.PI*2,true); | ||
|
||
|
||
c2d.stroke(); | ||
//Inner bezel | ||
c2d.restore(); | ||
c2d.strokeStyle=grad2; | ||
c2d.lineWidth=3; | ||
c2d.beginPath(); | ||
c2d.arc(15,15,13,0,Math.PI*2,true); | ||
c2d.stroke(); | ||
c2d.save(); | ||
c2d.translate(15,15); | ||
|
||
var now=new Date(); | ||
var hrs=now.getHours(); | ||
var min=now.getMinutes(); | ||
var sec=now.getSeconds(); | ||
|
||
c2d.lineWidth=2; | ||
c2d.save(); | ||
//Draw clock pointers but this time rotate the canvas rather than | ||
//calculate x/y start/end positions. | ||
// | ||
//Draw hour hand | ||
c2d.rotate(Math.PI/6*(hrs+(min/60)+(sec/3600))); | ||
c2d.beginPath(); | ||
c2d.moveTo(0,4); | ||
c2d.lineTo(0,-6); | ||
c2d.stroke(); | ||
c2d.restore(); | ||
c2d.save(); | ||
//Draw minute hand | ||
c2d.rotate(Math.PI/30*(min+(sec/60))); | ||
c2d.beginPath(); | ||
c2d.moveTo(0,4); | ||
c2d.lineTo(0,-10); | ||
c2d.stroke(); | ||
c2d.restore(); | ||
c2d.save(); | ||
c2d.restore(); | ||
|
||
//Additional restore to go back to state before translate | ||
//Alternative would be to simply reverse the original translate | ||
c2d.restore(); | ||
} | ||
} | ||
|
||
window.onload = function(){ | ||
document.getElementById("clockcanvas").onmouseover = hoverClock; | ||
document.getElementById("clockcanvas").onmouseout = unhoverClock; | ||
setInterval(draw, 60000); | ||
draw(); | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,109 @@ | ||
var clockCanvColor = ["#000", "#000"]; | ||
function hoverClock(){ | ||
clockCanvColor = ["rgb(0,124,196)", "rgb(0,124,196)"]; | ||
draw(); | ||
} | ||
function unhoverClock(){ | ||
clockCanvColor = ["#000","#000"]; | ||
draw(); | ||
} | ||
|
||
function draw() { | ||
var canvas = document.getElementById('clockcanvas'); | ||
if (canvas.getContext) { | ||
var c2d=canvas.getContext('2d'); | ||
c2d.clearRect(0,0,50,50); | ||
//Define gradients for 3D / shadow effect | ||
var grad1=c2d.createLinearGradient(0,0,50,50); | ||
grad1.addColorStop(0,clockCanvColor[1]); | ||
grad1.addColorStop(1,clockCanvColor[0]); | ||
var grad2=c2d.createLinearGradient(0,0,50,50); | ||
grad2.addColorStop(0,clockCanvColor[0]); | ||
grad2.addColorStop(1,clockCanvColor[1]); | ||
c2d.font="Bold 14px Arial"; | ||
c2d.textBaseline="middle"; | ||
c2d.textAlign="center"; | ||
c2d.lineWidth=2; | ||
c2d.save(); | ||
//Outer bezel | ||
c2d.strokeStyle=grad1; | ||
c2d.lineWidth=4; | ||
c2d.beginPath(); | ||
c2d.arc(25,25,23,0,Math.PI*2,true); | ||
|
||
|
||
c2d.stroke(); | ||
//Inner bezel | ||
c2d.restore(); | ||
c2d.strokeStyle=grad2; | ||
c2d.lineWidth=2; | ||
c2d.beginPath(); | ||
c2d.arc(25,25,22,0,Math.PI*2,true); | ||
c2d.stroke(); | ||
//c2d.strokeStyle="#222"; | ||
c2d.save(); | ||
c2d.translate(25,25); | ||
//Markings/Numerals | ||
/*for (i=1;i<=12;i++) { | ||
ang=Math.PI/30*i*5; | ||
sang=Math.sin(ang); | ||
cang=Math.cos(ang); | ||
sx=sang*19; | ||
sy=cang*-19; | ||
ex=sang*24; | ||
ey=cang*-24; | ||
nx=sang*16; | ||
ny=cang*-16; | ||
c2d.fillText(i/5,nx,ny); | ||
}*/ | ||
|
||
var now=new Date(); | ||
var hrs=now.getHours(); | ||
var min=now.getMinutes(); | ||
var sec=now.getSeconds(); | ||
//c2d.strokeStyle="#000"; | ||
|
||
|
||
c2d.lineWidth=2; | ||
c2d.save(); | ||
//Draw clock pointers but this time rotate the canvas rather than | ||
//calculate x/y start/end positions. | ||
// | ||
//Draw hour hand | ||
c2d.rotate(Math.PI/6*(hrs+(min/60)+(sec/3600))); | ||
c2d.beginPath(); | ||
c2d.moveTo(0,4); | ||
c2d.lineTo(0,-10); | ||
c2d.stroke(); | ||
c2d.restore(); | ||
c2d.save(); | ||
//Draw minute hand | ||
c2d.rotate(Math.PI/30*(min+(sec/60))); | ||
c2d.beginPath(); | ||
c2d.moveTo(0,4); | ||
c2d.lineTo(0,-18); | ||
c2d.stroke(); | ||
c2d.restore(); | ||
c2d.save(); | ||
/*Draw second hand | ||
c2d.rotate(Math.PI/30*sec); | ||
c2d.strokeStyle="#E33"; | ||
c2d.lineWidth=1; | ||
c2d.beginPath(); | ||
c2d.moveTo(0,3); | ||
c2d.lineTo(0,-18); | ||
c2d.stroke();*/ | ||
c2d.restore(); | ||
|
||
//Additional restore to go back to state before translate | ||
//Alternative would be to simply reverse the original translate | ||
c2d.restore(); | ||
} | ||
} | ||
|
||
window.onload = function(){ | ||
document.getElementById("clockcanvas").onmouseover = hoverClock; | ||
document.getElementById("clockcanvas").onmouseout = unhoverClock; | ||
setInterval(draw, 60000); | ||
draw(); | ||
}; |
Oops, something went wrong.