Skip to content

Ruby- Samantha H #59

Open
hamsurtado wants to merge 5 commits into
Ada-C19:mainfrom
hamsurtado:main
Open

Ruby- Samantha H #59
hamsurtado wants to merge 5 commits into
Ada-C19:mainfrom
hamsurtado:main

Conversation

@hamsurtado

Copy link
Copy Markdown

No description provided.

@kendallatada kendallatada left a comment

Copy link
Copy Markdown

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 thread index.html
Comment on lines +20 to +22
<section id="grid_space_one" class="grid-item">
<section id="city-space">
<section id="city-name-section">

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'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 😌 🧹

Comment thread index.html
</section>

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

Copy link
Copy Markdown

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!

Comment thread index.html
</section>


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

Copy link
Copy Markdown

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).

Comment thread index.html
<h1> ✨Look Inspiration✨</h1>

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

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Love this fashion landscape 🤩 💃🏾

Comment thread src/index.js

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

Copy link
Copy Markdown

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 👏🏾

Comment thread src/index.js
}
}

async function updateWeather() {

Copy link
Copy Markdown

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.

Comment thread src/index.js
}

function resetCity(){
const cityName = document.getElementById('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.

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.

Comment thread src/index.js
@@ -0,0 +1,157 @@
const city = document.getElementById('city_name')
let inputCity = document.getElementById('city_input')

Copy link
Copy Markdown

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 thread src/index.js
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;

Copy link
Copy Markdown

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.

Comment thread styles/index.css
}

main {
display: grid;

Copy link
Copy Markdown

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