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

Sea Turtles - Tiffini H. #68

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

Conversation

tiffinihyatt
Copy link

No description provided.

Copy link

@kelsey-steven-ada kelsey-steven-ada 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 Tiffini! I've left some comments & suggestions, take a look when you have time and let me know if there's anything I can clarify =]

if (state.temperature >= 80) {
landscapeImage.src = 'assets/marissa-rodriguez-summer.jpg';
landscapeImage.alt = 'Crystal clear turquoise water in a pool or sea';
landscapeCaption.textContent = 'Photo by Marissa Rodriguez';

Choose a reason for hiding this comment

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

I really like how you handled attribution for the photos!

} else if (state.temperature >= 20 && state.temperature <= 39) {
state.currentColor = '#1a557d';
} else {
state.currentColor = '#67686b';

Choose a reason for hiding this comment

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

In production code we'd likely want to include comments about what each of the hex colors are, since many folks cannot sight-read hex values.

Copy link
Author

Choose a reason for hiding this comment

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

Ahh, that makes sense. Thank you!

<body>
<div class="container">

Choose a reason for hiding this comment

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

I recommend replacing this div with a main element, since main is intended to represent the significant content of a page. Depending on if it significantly changes the layout, another option might be to move class="container" to the body tag and remove this div.

Copy link
Author

Choose a reason for hiding this comment

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

Thank you, Kelsey! I thought that this div would maybe be okay since I was grouping just for styling purposes, but I can see how a main tag would have made more sense.

</section>

<section id="sky-and-landscape-container">
<figure id="sky-with-caption">

Choose a reason for hiding this comment

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

Nice use of the figure element!

@@ -0,0 +1,238 @@
'use strict';

const state = {

Choose a reason for hiding this comment

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

Nice use of the state object!

const skyCaption = document.getElementById('sky-caption');
const selectedSky = document.getElementById('sky-dropdown').value;

state.currentSky = selectedSky;

Choose a reason for hiding this comment

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

We update state.currentSky here, but it doesn't look like that value is read anywhere in the file. We can probably remove currentSky from state so we don't hold onto data we won't use.

Copy link
Author

Choose a reason for hiding this comment

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

Ooh, that's a great catch!


const currentTemp = document.getElementById('temperature');

// update display temp, sky, and landscape after retrieving weather data

Choose a reason for hiding this comment

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

Nice use of comments throughout!

alt="Crystal clear turquoise water in a pool or sea">
<figcaption id="landscape-caption">Photo by Marissa Rodriguez</figcaption>
</figure>
</section>

Choose a reason for hiding this comment

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

Overall, nice division of content into sections.

Copy link
Author

Choose a reason for hiding this comment

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

Thank you! I worked really hard to make my html as thoughtful as possible based on your feedback about how HTML can impact accessibility, so I'm glad it's an improvement!

return [lat, lon];
})
// get current temp of current city
.then((response) => {

Choose a reason for hiding this comment

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

Nice use of .then chaining to fire the calls off in sequence! This function is a bit long, if we wanted to divide it up for clarity, we could move the /weather endpoint call to its own function and call the new function from a .then block here.

Copy link
Author

Choose a reason for hiding this comment

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

Ooh, I'd love to talk about this when we check in next!

skyDropdown.addEventListener('change', manuallyChangeSky);
};

document.addEventListener('DOMContentLoaded', registerEventHandlers);

Choose a reason for hiding this comment

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

It's easy to overlook this line nestled between functions. I recommend moving it to the very bottom to keep functions together and separate from code that we immediately call and execute.

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