-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathdashboard.ejs
134 lines (118 loc) · 3.17 KB
/
dashboard.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
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
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Dashboard</title>
<style>
/* Basic styling */
body {
font-family: Arial, sans-serif;
background-color: #f0f0f0;
margin: 0;
padding: 0;
}
/* Header styling */
h1 {
text-align: center;
background-color: #333;
color: #fff;
padding: 10px;
margin: 0;
}
/* Container styling */
.container {
max-width: 800px;
margin: 20px auto;
background-color: #fff;
border-radius: 5px;
box-shadow: 0 2px 4px rgba(14, 216, 115, 0.1);
padding: 20px;
}
/* Section titles */
h2 {
font-size: 24px;
margin-top: 20px;
}
/* List styling */
ul {
list-style-type: none;
padding: 0;
}
li {
border: 1px solid #ccc;
border-radius: 5px;
margin-bottom: 10px;
padding: 10px;
}
/* Weather data container */
.weather-data {
background-color: #f0e5e5;
padding: 15px;
border-radius: 5px;
margin-top: 20px;
}
/* Form styling */
form {
margin-top: 20px;
}
label {
font-weight: bold;
display: block;
margin-bottom: 5px;
}
input[type="text"] {
width: 100%;
padding: 10px;
margin-bottom: 10px;
border: 1px solid #ccc;
border-radius: 5px;
}
button[type="submit"] {
background-color: #6cce22;
color: #a71d1d;
padding: 10px 20px;
border: none;
border-radius: 5px;
cursor: pointer;
}
button[type="submit"]:hover {
background-color: #555;
}
</style>
</head>
<body>
<h1>Dashboard</h1>
<!-- Display the search results (if any) -->
<h2>Search Results:</h2>
<ul>
<% searchResults.forEach(function(result) { %>
<li>
<strong>Name:</strong> <%= result.name %><br>
<strong>Country:</strong> <%= result.country %><br>
<strong>Region:</strong> <%= result.region %><br>
<strong>Population:</strong> <%= result.population %><br>
<hr>
</li>
<% }); %>
</ul>
<!-- Display the weather data (if available) -->
<% if (weatherData) { %>
<h2>Weather Data:</h2>
<p><strong>Location:</strong> <%= weatherData.location.name %>, <%= weatherData.location.country %></p>
<p><strong>Temperature:</strong> <%= weatherData.current.temp_c %>°C</p>
<p><strong>Condition:</strong> <%= weatherData.current.condition.text %></p>
<p><strong>Humidity:</strong> <%= weatherData.current.humidity %>%</p>
<!-- Add more weather data properties as needed -->
<% } else { %>
<p>No weather data available for the specified location.</p>
<% } %>
<!-- Form to input location -->
<h2>Input Location:</h2>
<form action="/dashboard" method="get">
<label for="location">Location:</label>
<input type="text" id="location" name="location" required>
<button type="submit">Submit</button>
</form>
</body>
</html>