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

Ruby- Samantha H #59

Open
wants to merge 5 commits into
base: main
Choose a base branch
from
Open

Ruby- Samantha H #59

wants to merge 5 commits into from

Conversation

hamsurtado
Copy link

No description provided.

Copy link

@kendallatada kendallatada left a comment

Choose a reason for hiding this comment

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

Hi Samantha! Your project has been scored as green. You can find my comments in your PR. Let me know if you have any questions! Nice work! 😊

Comment on lines +20 to +22
<section id="grid_space_one" class="grid-item">
<section id="city-space">
<section id="city-name-section">

Choose a reason for hiding this comment

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

I'd recommend trying to consolidate some of these section tags so that you don't have as many tags to keep track of and maintain 😌 🧹

</section>

<section class="search">
<input id="city_input" type="text" placeholder="enter city name" spellcheck="true">

Choose a reason for hiding this comment

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

Nice usage of the placeholder and spellcheck attributes!

</section>


<section id="grid_space_three" class="grid-item">

Choose a reason for hiding this comment

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

Make sure you're being consistent with your class and id naming conventions. Best practice is lowercase with hyphens (-) separating words when needed (unless you're using the BEM convention).

<h1> ✨Look Inspiration✨</h1>

<section class="fashion-image-container">
<img id="fashion_landscape" src="assets/80_degree_outfit.jpeg">

Choose a reason for hiding this comment

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

Love this fashion landscape 🤩 💃🏾


function changeSkyImage() {
let selectedSky = skySelector.value;
switch(selectedSky) {

Choose a reason for hiding this comment

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

Great usage of a switch statement here 👏🏾

}
}

async function updateWeather() {

Choose a reason for hiding this comment

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

Similar to how you handled changing the city name, I'd recommend adding some logic to this function to have it only execute after the Enter key is pressed. At the moment, it executes after every single character that's entered into the input box which is causing a lot of unnecessary API calls and errors.

}

function resetCity(){
const cityName = document.getElementById('city_name')

Choose a reason for hiding this comment

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

Note that this city_name element is already available for use in the global variable city. I think I prefer this locally scoped variable better though so I'd probably recommend moving the global variable inside the changeCity function too.

@@ -0,0 +1,157 @@
const city = document.getElementById('city_name')
let inputCity = document.getElementById('city_input')

Choose a reason for hiding this comment

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

Suggested change
let inputCity = document.getElementById('city_input')
const inputCity = document.getElementById('city_input')

Note these type of variables storing html elements can be declared as const variables since under the hood they're just objects, so you'll still be able to modify the data inside the object. This just ensures the variable itself can't be reassigned.

Comment on lines +88 to +94
case 'skySnowy':
skyImage.src = 'assets/skies/snowy_sky.jpeg';
break;

case 'skyStarry':
skyImage.src = 'assets/skies/starry_sky_blue.jpeg';
break;

Choose a reason for hiding this comment

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

Note that there are some formatting issues for the Starry and Snowy options where the section header The Sky Today and the dropdown menu for sky selection get pushed out of the visible area of the box due to the images being too large. This makes a page refresh required to get the selection box back.

For things like this, it's really good to restrict the maximum size of images, make all images the same size, and/or make the position of the header and dropdown menu fixed so they can't disappear.

}

main {
display: grid;

Choose a reason for hiding this comment

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

Nice usage of grid ✨

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