-
Notifications
You must be signed in to change notification settings - Fork 0
/
home.html
64 lines (51 loc) · 1.54 KB
/
home.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
53
54
55
56
57
58
59
60
61
62
63
64
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<title>RANDOM KARAOKE</title>
<link rel="stylesheet" href="static/css/bootstrap.min.css">
<style>
canvas {
z-index = -1;
}
#wrap {
position: absolute;
top: 0;
z-index = 20;
}
</style>
<script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.6.2/jquery.min.js"></script>
<script>
var canvas;
var ctx;
function Main() {
var y = $(window).height()/3;
var x = $(window).width()/10;
$('#wrap').css({top: y, left: x});
canvas = document.createElement('canvas');
ctx = canvas.getContext('2d');
canvas.width = $(window).width();
canvas.height = $(window).height();
var img = new Image();
function drawBackground() {
ctx.drawImage(img, 0, 0, $(window).width(), $(window).height());
}
img.onload = drawBackground;
img.src = "http://images4.fanpop.com/image/photos/20500000/AWESOME-3-singing-20512817-693-693.jpg";
$('body').append(canvas);
};
$(document).ready(Main);
</script>
</head>
<body>
<center><div id="wrap">
<h1 align="center">RANDOM KARAOKE</h1>
<div align="center">
<form action="/sing?choice={{choice}}">
<input align="center" type="text" name="choice">
<input id = "submit" align="center" class="btn" type="submit" value="Enter song!">
</form>
</div>
</div></center>
</body>
</html>