Skip to content

Ihovanna Huezo#88

Open
Ihovanna wants to merge 1 commit intoAda-C18:mainfrom
Ihovanna:main
Open

Ihovanna Huezo#88
Ihovanna wants to merge 1 commit intoAda-C18:mainfrom
Ihovanna:main

Conversation

@Ihovanna
Copy link
Copy Markdown

No description provided.

@@ -1,4 +1,4 @@
# Wave 6: Resetting the City Name
Wave 6: Resetting the City Name
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks like this was mistakenly updated

Copy link
Copy Markdown

@ameerrah9 ameerrah9 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Great work on this project Ihovanna! The code you wrote for wave 4 is really close, I've put in a suggested solution, but I didn't have time to test it so it may need some adjustments. The code in this project is really clean and easy to read. This project is yellow 🟡

Comment thread index.html
Comment on lines +13 to +35
<div class="container" id="outermost-margin">
<div class="weather-box" id="left-box">
<p id="current-date">Today's date</p>
<p id="display-city"> City</p>
<section id="sky"></section>
<section id="temperature-container" class="container">
<button type="button" id="decrease-temp-button" class="button">❄️</button>
<p id="display-temperature">Temperature</p>
<button type="button" id="increase-temp-button" class="button">🔥</button>
</section>
<section id="landscape">emojis</section><br>
<button type="button" id="current-temp-button" class="button">See current weather</button>
<br>
<button type="button" id="reset-city-button" class="button">reset city</button>
</div>

<div class="weather-box" id="right-box">
<select name="weather" id="weather-dropdown" class="dropdown">
<option value=" ">Choose your sky!</option>
<option value="sun">Sunny</option>
<option value="clouds">Cloudy</option>
<option value="rain">Rainy</option>
<option value="snow">Snowy</option>
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Markup looks great!

Comment thread src/index.js
Comment on lines +9 to +12
let currentCity = 'San Diego, CA, USA'
document.getElementById('display-city').textContent = currentCity;

let temperatureNumber = 70;
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Consider storing your default state in an object like so:

const state = {
  city: 'San Diego, CA, USA',
  lat: 47.6038321,
  long: -122.3300624,
  temp: 70,
};

Comment thread src/index.js
Comment on lines +139 to +140
let secondCall = findWeather(lat,long);
secondCall;
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We don't need an extra variable to hold the function call here

Comment thread src/index.js
temperatureResponse = Math.floor(response.data['main']['temp']);
// weatherResponse = JSON.stringify(response.data['weather'][0]['main']);
// console.log(`Successful weather response: ${weatherResponse}`)
temperatureNumber = temperatureResponse
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I noticed you aren't converting kelvin to farenheit which throws off your changeLandscape logic since you're using farenheit to determine which landscape to display.

Comment thread src/index.js
Comment on lines +93 to +100
const upButton = document.getElementById('increase-temp-button');
upButton.textContent = '🔥';
upButton.addEventListener("click", function() {
temperatureNumber += 1;
logTempText();
changeTextColor();
logLandscape(temperatureNumber);
});
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This works, but it would make sense to have a reference to these functions instead of calling them in the event listener

Comment thread src/index.js
Comment on lines +80 to +82
logTempText();
changeTextColor();
logLandscape(temperatureNumber);
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Prefer to register this to be called in response to the DOMContentLoaded event. In the similar live code we did, we did call our onLoaded function directly, since codesandbox got in the way of our code being able to see the DOMContentLoaded event.

Comment thread src/index.js
dropdownValue.addEventListener('change', function handleChange () {
let newSky = changeSky(dropdownValue.options[dropdownValue.selectedIndex].value);
displaySky.textContent = `${newSky}`;
display
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't believe this line is needed 😁

Comment thread src/index.js
Comment on lines +111 to +116
const resetCity = document.getElementById('reset-city-button');
resetCity.addEventListener("click", function() {
currentCity = 'San Diego, CA, USA';
document.getElementById('display-city').textContent = currentCity;
document.getElementById('text-box').value='';
})
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

There's an issue with wave 04 (calling the apis), the requirements specify that your code should get the weather of the currently displayed city name & when the   element is clicked updates and displays the realtime temperature of the currently displayed city name. Currently your code is not resetting the temperature of the displayed city.

Copy link
Copy Markdown

@ameerrah9 ameerrah9 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Great work, Ihovanna! 🥳

Thank you for your patience as we catch up on grading. Nice work! The HTML is structured well and the JS is clear and well-factored. However, the requirements for wave 2 and 3 were not met. I've left comments on your PR. This makes the project a yellow. 🟡

Keep it up 💯

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants