-
Notifications
You must be signed in to change notification settings - Fork 2
/
index.html
66 lines (60 loc) · 2.15 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
53
54
55
56
57
58
59
60
61
62
63
64
65
66
<!doctype html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>Assignment: Contact Card</title>
<meta name="description" content="Contact Card">
<link rel="stylesheet" href="style.css">
<script type="text/javascript" src="https://ajax.googleapis.com/ajax/libs/jquery/3.1.0/jquery.min.js"></script>
<script type="text/javascript">
function random_color()
{
var rgb = ['a','b','c','d','e','f','0','1','2','3','4','5','6','7','8','9'];
color = '#' //this is what we'll return!
for(var i = 0; i < 6; i++)
{
x = Math.floor((Math.random()*16))
color += rgb[x];
}
return color;
}
function changeBackground() {
$("body").css("background", random_color());
}
$(document).ready(function(){
$('#tunes').trigger('load')
$('#tunes').prop("currentTime", 10)
$("#form").submit(function(){
$("#right_side").append("<div class='contact_card'>" +
"<h1 class='name'>" + $("#first_name").val() + " " + $("#last_name").val() + "</h1>" + "<h3 class='toggle'>" + "Click for Description" + "</h3>" + "<h2 class='description'>" + $("#description").val() + "</h2>" + "</div>");
$('#tunes').trigger('play');
setTimeout(function() {setInterval(changeBackground, 100)}, 28500);
return false;
});
$(document).on("click", ".contact_card", function(){
$(this).children().toggle();
$(this).css('background-color', (random_color()));
});
//setInterval(changeBackground, 100); background-color change original
});
</script>
</head>
<body>
<div id="wrapper">
<div id="left_side">
<form id="form" action="process.php" method="post">
<h1>Add User</h1>
First Name: <input id="first_name" type="text"><br>
Last Name: <input id="last_name" type="text"><br>
Description: <input id="description" type="text"><br>
<input id="button" type="submit" name="submit" value="Add User">
</form>
</div>
<audio id ="tunes" preload="none">
<source src="sandstorm.mp3" type="audio/mpeg">
</audio>
<div id="right_side">
</div>
</div>
</body>
</html>