-
Notifications
You must be signed in to change notification settings - Fork 0
/
yellow.html
115 lines (94 loc) · 3.97 KB
/
yellow.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
105
106
107
108
109
110
111
112
113
114
115
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Uttarakhand Travel Destinations</title>
<link rel="stylesheet" href="styles.css">
</head>
<body>
<header>
<h1>Uttarakhand Travel Destinations</h1>
<input type="text" id="searchInput" placeholder="Search...">
</header>
<section id="destinations">
</section>
<script>
const destinations = [
{ name: 'Mussoorie', state: 'Uttarakhand', description: 'Queen of the Hills', references: ['Link 1', 'Link 2'] },
{ name: 'Nainital', state: 'Uttarakhand', description: 'City of Lakes', references: ['Link 3', 'Link 4'] },
{ name: 'Mussoorie', state: 'Uttarakhand', description: 'Queen of the Hills', references: ['Link 1', 'Link 2'] },
{ name: 'Nainital', state: 'Uttarakhand', description: 'City of Lakes', references: ['Link 3', 'Link 4'] },
{ name: 'Rishikesh', state: 'Uttarakhand', description: 'Yoga Capital of the World', references: ['Link 5', 'Link 6'] },
{ name: 'Haridwar', state: 'Uttarakhand', description: 'Gateway to the Gods', references: ['Link 7', 'Link 8'] },
{ name: 'Auli', state: 'Uttarakhand', description: 'Skiing Destination', references: ['Link 9', 'Link 10'] },
{ name: 'Dehradun', state: 'Uttarakhand', description: 'Capital City', references: ['Link 11', 'Link 12'] },
{ name: 'Jim Corbett National Park', state: 'Uttarakhand', description: 'Oldest National Park in India', references: ['Link 13', 'Link 14'] },
];
function displayDestinations(filteredDestinations = destinations) {
const destinationsSection = document.getElementById('destinations');
destinationsSection.innerHTML = '';
filteredDestinations.forEach(dest => {
const card = document.createElement('div');
card.classList.add('card');
card.innerHTML = `<h2>${dest.name}</h2>
<p><strong>State:</strong> ${dest.state}</p>
<p>${dest.description}</p>
<p><strong>References:</strong></p>
<ul>${dest.references.map(ref => `<li><a href="${ref}" target="_blank">${ref}</a></li>`).join('')}</ul>`;
destinationsSection.appendChild(card);
});
}
function filterDestinations() {
const searchInput = document.getElementById('searchInput').value.toLowerCase();
const filteredDestinations = destinations.filter(dest => dest.name.toLowerCase().includes(searchInput));
displayDestinations(filteredDestinations);
}
displayDestinations();
document.getElementById('searchInput').addEventListener('input', filterDestinations);
</script>
<style>
body {
font-family: Arial, sans-serif;
margin: 0;
padding: 0;
background-color: #f4f4f4;
}
header {
background-color: #333;
color: white;
padding: 1em;
text-align: center;
}
h1 {
margin: 0;
}
#searchInput {
padding: 0.5em;
margin-top: 1em;
}
#destinations {
display: flex;
flex-wrap: wrap;
justify-content: space-around;
padding: 1em;
}
.card {
background-color: white;
border: 1px solid #ddd;
border-radius: 8px;
margin: 1em;
padding: 1em;
width: 300px;
}
ul {
padding: 0;
margin: 0;
list-style-type: none;
}
ul li {
margin-bottom: 5px;
}
</style>
</body>
</html>