forked from Smudded/whatisgrooveshark
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathindex.html
52 lines (39 loc) · 1.57 KB
/
index.html
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
<!DOCTYPE html>
<head>
<title>What is Grooveshark?</title>
<style type="text/css">
html, body {margin:0; padding: 0; height: 100%; width: 100%;}
#canvas {position: absolute; top: 0; left: 0; z-index: 20;}
#logo {position: absolute; height: 100%; display: block; margin: 0 auto; z-index: 10;}
</style>
</head>
<html>
<body>
<img id="logo" src="gslogo.png" />
<canvas id="canvas"></canvas>
<script src="http://ajax.googleapis.com/ajax/libs/jquery/1.8.2/jquery.min.js"></script>
<script type="text/javascript">
$(document).ready(function() {
var $canvas = $('#canvas'),
canvas = document.getElementById('canvas'),
ctx = canvas.getContext('2d'),
img = new Image(),
modSize = 0;
var resizeCanvas = function() {
$('#logo').css('left', $(window).width()/2 - $('#logo').width()/2);
canvas.height = $(window).height();
canvas.width = $(window).width();
}
$(window).resize(resizeCanvas);
resizeCanvas();
img.onload = function() {
$('#canvas').on('mousemove', function(ev) {
ctx.drawImage(img, (ev.pageX-((img.width/2)+modSize/2)), (ev.pageY-((img.height/2)+modSize/2)), img.width+modSize, img.height+modSize);
modSize++;
});
};
img.src = 'dustin.png';
});
</script>
</body>
</html>