Skip to content

Commit

Permalink
Clear all unused code
Browse files Browse the repository at this point in the history
  • Loading branch information
DiksonIvySon committed Oct 19, 2023
1 parent 4771bec commit 912f871
Show file tree
Hide file tree
Showing 2 changed files with 0 additions and 93 deletions.
26 changes: 0 additions & 26 deletions weatherApp/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -213,32 +213,6 @@ <h3>Running</h3>
</a>
</div>
</section>

<!--all weather information-->
<!--
<hr>
<section class="pageThree">
<h1>Map</h1>
<div class="map-container">
<div class="map cloudsMap" style="display: none">cloud</div>
<div class="map precipitationMap" style="display: none">Precipitation</div>
<div class="map pressureMap" style="display: none">Pressure</div>
<div class="map windMap" style="display: none">wind</div>
<div class="map temperatureMap" style="display: none">temperature</div>
</div>
<div class="mapButtons">
<button class="mapBtn">Clouds</button>
<button class="mapBtn">Precipitation</button>
<button class="mapBtn">Pressure</button>
<button class="mapBtn">Wind</button>
<button class="mapBtn">Temperature</button>
</div>
</section>
-->

<!--map-->
<section class="pageFour"></section>

</main>

<footer>
Expand Down
67 changes: 0 additions & 67 deletions weatherApp/script.js
Original file line number Diff line number Diff line change
Expand Up @@ -474,71 +474,4 @@ function showSlides(n) {
dots[slideIndex-1].className += " active";
}

/*
///Event listen with anonymous function
let mapButtons = document.querySelectorAll('.mapBtn');
mapButtons.forEach( mapButton => mapButton.addEventListener('click', function() {
let mapButtonValue = mapButton.textContent;
let maps = document.querySelectorAll('.map');
maps.forEach(map => {map.style.display = "none"});
displayThisMap(mapButtonValue);
}))
//function to display selected weather map and hide the others
function displayThisMap(mapButtonValue) {
console.log(mapButtonValue);
let classValue;
if (mapButtonValue === "Clouds") {
classValue = "." + "cloudsMap";
}
else if (mapButtonValue === "Precipitation") {
classValue = "." + "precipitationMap";
}
else if (mapButtonValue === "Pressure") {
classValue = "." + "pressureMap";
}
else if (mapButtonValue === "Wind") {
classValue = "." + "windMap";
}
else {
classValue = "." + "temperatureMap";
}
document.querySelector(classValue).style.display = "block";
}
function prepareWeatherInfo() {
let clouds_img = getWeatherImg("clouds_new");
document.querySelector(".cloudsMap").innerHTML = clouds_img;
let precipitation_img = getWeatherImg("precipitation_new");
document.querySelector(".precipitationMap").innerHTML = precipitation_img;
let pressure_img = getWeatherImg("pressure_new");
document.querySelector(".pressureMap").innerHTML = pressure_img;
let wind_img = getWeatherImg("wind_new");
document.querySelector(".windMap").innerHTML = wind_img;
let temp_img = getWeatherImg("temp_new");
document.querySelector(".temperatureMap").innerHTML = temp_img;
console.log(getWeatherImg("temp_new"));
}
//function to fetch the data from the API and initialize the weather information variables.
async function getWeatherImg(layer) {
let mapLink = "https://tile.openweathermap.org/map/" + layer + "/" + 1 + "/" + lon + "/" + lat + ".png?appid=05319f9ba4c5b0028375576bbd53d5a2";
const response = await fetch( mapLink, {mode: 'cors'});
const mapData = await response.json();
return mapData;
}
*/


0 comments on commit 912f871

Please sign in to comment.