Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: Climate visible for destinations #901

Merged
merged 3 commits into from
Jun 26, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
53 changes: 38 additions & 15 deletions dedicated-destinations/Dubai/main.js
Original file line number Diff line number Diff line change
@@ -1,27 +1,49 @@
// 'js/mian.js'

let slider_img = document.querySelector('.slider-img');
let images = ['Dubai1.jpg', 'Dubai2.webp', 'Dubai3.jpg', 'Dubai4.jpg', 'Dubai5.jpg', 'Dubai6.jpg', 'Dubai7.jpg', 'Dubai8.webp'];
let slider_img = document.querySelector(".slider-img");
let images = [
"Dubai1.jpg",
"Dubai2.webp",
"Dubai3.jpg",
"Dubai4.jpg",
"Dubai5.jpg",
"Dubai6.jpg",
"Dubai7.jpg",
"Dubai8.webp",
];
let i = 0;

function prev(){
if(i <= 0) i = images.length;
i--;
return setImg();
function prev() {
if (i <= 0) i = images.length;
i--;
return setImg();
}

function next(){
if(i >= images.length-1) i = -1;
i++;
return setImg();
function next() {
if (i >= images.length - 1) i = -1;
i++;
return setImg();
}

function setImg(){
return slider_img.setAttribute('src', "./gallery/"+images[i]);

function setImg() {
return slider_img.setAttribute("src", "./gallery/" + images[i]);
}
const url =
"https://api.shecodes.io/weather/v1/forecast?query=Dubai&key=057314561f8344abb8d5d80t6761o6ae&units=metric";
axios.get(url).then(weather);
function weather(response) {
let max_temp = document.querySelector(".max");
maximum = Math.round(response.data.daily[0].temperature.maximum);
max_temp.innerHTML = maximum;
let min_temp=document.querySelector(".min");
minimum = Math.round(response.data.daily[0].temperature.minimum);
min_temp.innerHTML = minimum;
let hum = document.querySelector(".humidity");
humidity = Math.round(response.data.daily[0].temperature.humidity);
hum.innerHTML = humidity;
}

const url = 'https://weather-by-api-ninjas.p.rapidapi.com/v1/weather?city=dubai';
/*
const options = {
method: 'GET',
headers: {
Expand Down Expand Up @@ -50,4 +72,5 @@ fetch(url, options)

weatherInfoContainer.innerHTML = weatherInfoHTML;
})
.catch(error => console.error('Error fetching weather data:', error));
.catch(error => console.error('Error fetching weather data:', error));
*/
7 changes: 5 additions & 2 deletions dedicated-destinations/Dubai/start.html
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Tourguide</title>
<link rel="stylesheet" href="./Dubai.css">

<script src="https://unpkg.com/[email protected]/dist/axios.min.js"></script>
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.5.1/css/all.min.css">
<link rel="stylesheet" href="https://www.w3schools.com/w3css/4/w3.css">
<link rel="stylesheet" href="https://fonts.googleapis.com/css?family=Inconsolata">
Expand Down Expand Up @@ -211,7 +211,10 @@ <h5>Offers</h5>


<div id="weatherInfo">

<h2>Climate Info </h2>
<div>Maximum Temperature:<span class="max"></span>°C</div>
<div>Minimum Temperature:<span class="min"></span>°C</div>
<div>Humidity:<span class="humidity"></span>%</div>
<!-- Weather information will be inserted here -->
</div>
</div>
Expand Down
19 changes: 17 additions & 2 deletions dedicated-destinations/Goa/main.js
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,21 @@ function setImg(){
return slider_img.setAttribute('src', "./gallery/"+images[i]);

}

const url =
"https://api.shecodes.io/weather/v1/forecast?query=Goa&key=057314561f8344abb8d5d80t6761o6ae&units=metric";
axios.get(url).then(weather);
function weather(response) {
let max_temp = document.querySelector(".max");
maximum = Math.round(response.data.daily[0].temperature.maximum);
max_temp.innerHTML = maximum;
let min_temp = document.querySelector(".min");
minimum = Math.round(response.data.daily[0].temperature.minimum);
min_temp.innerHTML = minimum;
let hum = document.querySelector(".humidity");
humidity = Math.round(response.data.daily[0].temperature.humidity);
hum.innerHTML = humidity;
}
/*
const url = 'https://weather-by-api-ninjas.p.rapidapi.com/v1/weather?city=goa';
const options = {
method: 'GET',
Expand Down Expand Up @@ -50,4 +64,5 @@ fetch(url, options)

weatherInfoContainer.innerHTML = weatherInfoHTML;
})
.catch(error => console.error('Error fetching weather data:', error));
.catch(error => console.error('Error fetching weather data:', error));
*/
9 changes: 6 additions & 3 deletions dedicated-destinations/Goa/start.html
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Tourguide</title>
<link rel="stylesheet" href="./Goa.css">

<script src="https://unpkg.com/[email protected]/dist/axios.min.js"></script>
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.5.1/css/all.min.css">
<link rel="stylesheet" href="https://www.w3schools.com/w3css/4/w3.css">
<link rel="stylesheet" href="https://fonts.googleapis.com/css?family=Inconsolata">
Expand Down Expand Up @@ -198,9 +198,12 @@ <h5>Offers</h5>
}
document.getElementById("myLink").click();
</script>
<div id="weatherInfo">
<div id="weatherInfo">
<h2>Climate Info </h2>
<div>Maximum Temperature:<span class="max"></span>°C</div>
<div>Minimum Temperature:<span class="min"></span>°C</div>
<div>Humidity:<span class="humidity"></span>%</div>
<!-- Weather information will be inserted here -->
</div>
</div>
</div>

Expand Down
18 changes: 16 additions & 2 deletions dedicated-destinations/London/main.js
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,21 @@ function setImg(){
return slider_img.setAttribute('src', "./gallery/"+images[i]);

}

const url =
"https://api.shecodes.io/weather/v1/forecast?query=London&key=057314561f8344abb8d5d80t6761o6ae&units=metric";
axios.get(url).then(weather);
function weather(response) {
let max_temp = document.querySelector(".max");
maximum = Math.round(response.data.daily[0].temperature.maximum);
max_temp.innerHTML = maximum;
let min_temp = document.querySelector(".min");
minimum = Math.round(response.data.daily[0].temperature.minimum);
min_temp.innerHTML = minimum;
let hum = document.querySelector(".humidity");
humidity = Math.round(response.data.daily[0].temperature.humidity);
hum.innerHTML = humidity;
}
/*
const url = 'https://weather-by-api-ninjas.p.rapidapi.com/v1/weather?city=london';
const options = {
method: 'GET',
Expand Down Expand Up @@ -50,4 +64,4 @@ fetch(url, options)

weatherInfoContainer.innerHTML = weatherInfoHTML;
})
.catch(error => console.error('Error fetching weather data:', error));
.catch(error => console.error('Error fetching weather data:', error));*/
13 changes: 8 additions & 5 deletions dedicated-destinations/London/start.html
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Tourguide</title>
<link rel="stylesheet" href="./London.css">

<script src="https://unpkg.com/[email protected]/dist/axios.min.js"></script>
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.5.1/css/all.min.css">
<link rel="stylesheet" href="https://www.w3schools.com/w3css/4/w3.css">
<link rel="stylesheet" href="https://fonts.googleapis.com/css?family=Inconsolata">
Expand Down Expand Up @@ -200,10 +200,13 @@ <h3>Bus</h3>
document.getElementById("myLink").click();
</script>

<div id="weatherInfo">

<!-- Weather information will be inserted here -->
</div>
<div id="weatherInfo">
<h2>Climate Info </h2>
<div>Maximum Temperature:<span class="max"></span>°C</div>
<div>Minimum Temperature:<span class="min"></span>°C</div>
<div>Humidity:<span class="humidity"></span>%</div>
<!-- Weather information will be inserted here -->
</div>



Expand Down
17 changes: 17 additions & 0 deletions dedicated-destinations/Maldives/main.js
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,22 @@ function setImg(){
return slider_img.setAttribute('src', "./gallery/"+images[i]);

}
const url =
"https://api.shecodes.io/weather/v1/forecast?query=Maldives&key=057314561f8344abb8d5d80t6761o6ae&units=metric";
axios.get(url).then(weather);
function weather(response) {
let max_temp = document.querySelector(".max");
maximum = Math.round(response.data.daily[0].temperature.maximum);
max_temp.innerHTML = maximum;
let min_temp = document.querySelector(".min");
minimum = Math.round(response.data.daily[0].temperature.minimum);
min_temp.innerHTML = minimum;
let hum = document.querySelector(".humidity");
humidity = Math.round(response.data.daily[0].temperature.humidity);
hum.innerHTML = humidity;
}

/*
const url = 'https://weather-by-api-ninjas.p.rapidapi.com/v1/weather?city=Maldives&country=Maldives';
const options = {
method: 'GET',
Expand Down Expand Up @@ -51,3 +67,4 @@ fetch(url, options)
weatherInfoContainer.innerHTML = weatherInfoHTML;
})
.catch(error => console.error('Error fetching weather data:', error));
*/
6 changes: 5 additions & 1 deletion dedicated-destinations/Maldives/start.html
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Tourguide</title>
<link rel="stylesheet" href="./maldive.css">

<script src="https://unpkg.com/[email protected]/dist/axios.min.js"></script>
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.5.1/css/all.min.css">
<link rel="stylesheet" href="https://www.w3schools.com/w3css/4/w3.css">
<link rel="stylesheet" href="https://fonts.googleapis.com/css?family=Inconsolata">
Expand Down Expand Up @@ -189,6 +189,10 @@ <h5>Offers</h5>
document.getElementById("myLink").click();
</script>
<div id="weatherInfo">
<h2>Climate Info </h2>
<div>Maximum Temperature:<span class="max"></span>°C</div>
<div>Minimum Temperature:<span class="min"></span>°C</div>
<div>Humidity:<span class="humidity"></span>%</div>
<!-- Weather information will be inserted here -->
</div>
</div>
Expand Down
17 changes: 16 additions & 1 deletion dedicated-destinations/Paris/main.js
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,21 @@ function setImg(){
return slider_img.setAttribute('src', "./gallery/"+images[i]);

}
const url =
"https://api.shecodes.io/weather/v1/forecast?query=Paris&key=057314561f8344abb8d5d80t6761o6ae&units=metric";
axios.get(url).then(weather);
function weather(response) {
let max_temp = document.querySelector(".max");
maximum = Math.round(response.data.daily[0].temperature.maximum);
max_temp.innerHTML = maximum;
let min_temp = document.querySelector(".min");
minimum = Math.round(response.data.daily[0].temperature.minimum);
min_temp.innerHTML = minimum;
let hum = document.querySelector(".humidity");
humidity = Math.round(response.data.daily[0].temperature.humidity);
hum.innerHTML = humidity;
}
/*
const url = 'https://weather-by-api-ninjas.p.rapidapi.com/v1/weather?city=Paris';
const options = {
method: 'GET',
Expand Down Expand Up @@ -49,4 +64,4 @@ fetch(url, options)

weatherInfoContainer.innerHTML = weatherInfoHTML;
})
.catch(error => console.error('Error fetching weather data:', error));
.catch(error => console.error('Error fetching weather data:', error));*/
6 changes: 5 additions & 1 deletion dedicated-destinations/Paris/start.html
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Tourguide</title>
<link rel="stylesheet" href="./Paris.css">

<script src="https://unpkg.com/[email protected]/dist/axios.min.js"></script>
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.5.1/css/all.min.css">
<link rel="stylesheet" href="https://www.w3schools.com/w3css/4/w3.css">
<link rel="stylesheet" href="https://fonts.googleapis.com/css?family=Inconsolata">
Expand Down Expand Up @@ -187,6 +187,10 @@ <h5>Offers</h5>
document.getElementById("myLink").click();
</script>
<div id="weatherInfo">
<h2>Climate Info </h2>
<div>Maximum Temperature:<span class="max"></span>°C</div>
<div>Minimum Temperature:<span class="min"></span>°C</div>
<div>Humidity:<span class="humidity"></span>%</div>
<!-- Weather information will be inserted here -->
</div>
</div>
Expand Down
19 changes: 17 additions & 2 deletions dedicated-destinations/bali/main.js
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,21 @@ function setImg(){
return slider_img.setAttribute('src', "./gallery/"+images[i]);

}

const url =
"https://api.shecodes.io/weather/v1/forecast?query=Bali&key=057314561f8344abb8d5d80t6761o6ae&units=metric";
axios.get(url).then(weather);
function weather(response) {
let max_temp = document.querySelector(".max");
maximum = Math.round(response.data.daily[0].temperature.maximum);
max_temp.innerHTML = maximum;
let min_temp = document.querySelector(".min");
minimum = Math.round(response.data.daily[0].temperature.minimum);
min_temp.innerHTML = minimum;
let hum = document.querySelector(".humidity");
humidity = Math.round(response.data.daily[0].temperature.humidity);
hum.innerHTML = humidity;
}
/*
const url = 'https://weather-by-api-ninjas.p.rapidapi.com/v1/weather?city=bali&country=bali';
const options = {
method: 'GET',
Expand Down Expand Up @@ -50,4 +64,5 @@ fetch(url, options)

weatherInfoContainer.innerHTML = weatherInfoHTML;
})
.catch(error => console.error('Error fetching weather data:', error));
.catch(error => console.error('Error fetching weather data:', error));
*/
12 changes: 8 additions & 4 deletions dedicated-destinations/bali/start.html
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Tourguide</title>
<link rel="stylesheet" href="./bali.css">

<script src="https://unpkg.com/[email protected]/dist/axios.min.js"></script>
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.5.1/css/all.min.css">
<link rel="stylesheet" href="https://www.w3schools.com/w3css/4/w3.css">
<link rel="stylesheet" href="https://fonts.googleapis.com/css?family=Inconsolata">
Expand Down Expand Up @@ -201,9 +201,13 @@ <h5>Offers</h5>
}
document.getElementById("myLink").click();
</script>
<div id="weatherInfo">

<!-- Weather information will be inserted here -->
<div id="weatherInfo">
<h2>Climate Info </h2>
<div>Maximum Temperature:<span class="max"></span>°C</div>
<div>Minimum Temperature:<span class="min"></span>°C</div>
<div>Humidity:<span class="humidity"></span>%</div>
<!-- Weather information will be inserted here -->
</div>
</div>
</div>

Expand Down
19 changes: 17 additions & 2 deletions dedicated-destinations/brazil/main.js
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,21 @@ function setImg(){
return slider_img.setAttribute('src', "./gallery/"+images[i]);

}

const url =
"https://api.shecodes.io/weather/v1/forecast?query=Brazil&key=057314561f8344abb8d5d80t6761o6ae&units=metric";
axios.get(url).then(weather);
function weather(response) {
let max_temp = document.querySelector(".max");
maximum = Math.round(response.data.daily[0].temperature.maximum);
max_temp.innerHTML = maximum;
let min_temp = document.querySelector(".min");
minimum = Math.round(response.data.daily[0].temperature.minimum);
min_temp.innerHTML = minimum;
let hum = document.querySelector(".humidity");
humidity = Math.round(response.data.daily[0].temperature.humidity);
hum.innerHTML = humidity;
}
/*
const url = 'https://weather-by-api-ninjas.p.rapidapi.com/v1/weather?city=brazil&country=brazil';
const options = {
method: 'GET',
Expand Down Expand Up @@ -50,4 +64,5 @@ fetch(url, options)

weatherInfoContainer.innerHTML = weatherInfoHTML;
})
.catch(error => console.error('Error fetching weather data:', error));
.catch(error => console.error('Error fetching weather data:', error));
*/
Loading
Loading