/
visitadog.html
104 lines (90 loc) · 2.98 KB
/
visitadog.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
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<link rel="stylesheet" type="text/css" href="visitadog.css">
<!--<script> src="index.js" </script>-->
<!-- Font: Baloo 2 -->
<link rel="preconnect" href="https://fonts.gstatic.com">
<link href="https://fonts.googleapis.com/css2?family=Baloo+2:wght@600&display=swap" rel="stylesheet">
<title>PawsTogether</title>
</head>
<body>
<!-- Top Right Buttons -->
<a class="topright" href="createanaccount.html"><u>Create Account</u></a>
<span class="topright"> or </span>
<a class="topright" href="signin.html"><u>Sign In</u></a>
<div align="left">
<a href="index.html">
<img src = "images/logo_pawstogether.png" width = "700">
</a>
</div>
<!-- Navigation Bar -->
<div align = "center">
<ul class = "topnav">
<!-- Home and Adopt a Dog -->
<li><a href="index.html">Home</a></li>
<li><a href="adoptpage.html">Adopt a Dog</a></li>
<li><a class="active" href="visitadog.html">Visit a Dog</a></li>
<!-- Visit a Dog uses Javascript -->
<!--
<script>
var currentDate = new Date();
var value = currentDate.getSeconds();
if ((value%2)==0){
document.write("<li><a href=\"hungry.html\">Visit a Dog</a></li>");
}
else{
document.write("<li><a href=\"happy.html\">Visit a Dog</a></li>");
}
</script>
-->
<!-- About -->
<li><a href="aboutpage.html">About</a></li>
</ul>
</div>
<!-- Page Title -->
<div class = "visit1"> <h1 align="center"><b>Visit a Dog</b></h1></div>
<!-- Content -->
<div align = "center" class ="visit">
<h3>
<a href="adoptpage.html">Adopt a dog</a>
or <br>
enter a Paw Code to visit a friend.
</h3>
<!-- Buttons -->
<input type="text" id="link" name="link"
placeholder="Enter a Paw Code...">
<input type="submit" class="pinkbutton" value="Enter"
onClick="redirectFromCode()">
<p>
<input class = "pinkbutton" type = "button"
onclick = "redirectFromTime()"
value = "Click here">
to visit a stray dog.
</p>
</div>
<script>
function redirectFromCode(){
var code = document.getElementById("link").value;
var key = code.charAt(5);
if((key%2==0)){
location.href = "happy.html";
}
else{
location.href = "hungry.html";
}
}
function redirectFromTime(){
var currentDate = new Date();
var value = currentDate.getSeconds();
if ((value%2)==0){
location.href = "happy.html";
}
else{
location.href = "hungry.html";
}
}
</script>
</body>
</html>