-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathindex.ejs
52 lines (51 loc) · 1.55 KB
/
index.ejs
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>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Random FRC Team</title>
<style>
body {
font-family: Arial, sans-serif;
text-align: center;
}
h1 {
margin-bottom: 20px;
}
.team-info {
border: 1px solid #ccc;
border-radius: 5px;
padding: 20px;
margin: 0 auto;
width: 300px;
}
</style>
</head>
<body>
<h1>Random FRC Team</h1>
<div class="team-info">
<h2>Team Information</h2>
<p><strong>Team Number:</strong> <%= team_number %></p>
<p><strong>Name:</strong> <%= name %></p>
<p><strong>Location:</strong> <%= location %></p>
</div>
<br>
<button onclick="generateRandomTeam()">Generate Random Team</button>
<script>
async function generateRandomTeam() {
try {
const response = await fetch('/');
const data = await response.json();
document.querySelector('.team-info').innerHTML = `
<h2>Team Information</h2>
<p><strong>Team Number:</strong> ${data.team_number}</p>
<p><strong>Name:</strong> ${data.name}</p>
<p><strong>Location:</strong> ${data.location}</p>
`;
} catch (error) {
console.error('Error fetching random team:', error);
}
}
</script>
</body>
</html>