Skip to content

Sea Turtles - Tiffini H.#68

Open
tiffinihyatt wants to merge 40 commits into
ada-c17:mainfrom
tiffinihyatt:main
Open

Sea Turtles - Tiffini H.#68
tiffinihyatt wants to merge 40 commits into
ada-c17:mainfrom
tiffinihyatt:main

Conversation

@tiffinihyatt

Copy link
Copy Markdown

No description provided.

@kelsey-steven-ada kelsey-steven-ada 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.

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 =]

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

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 really like how you handled attribution for the photos!

Comment thread src/index.js
} else if (state.temperature >= 20 && state.temperature <= 39) {
state.currentColor = '#1a557d';
} else {
state.currentColor = '#67686b';

Copy link
Copy Markdown

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
Copy Markdown
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!

Comment thread index.html
</head>

<body>
<div class="container">

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 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
Copy Markdown
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.

Comment thread index.html
</section>

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

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 use of the figure element!

Comment thread src/index.js
@@ -0,0 +1,238 @@
'use strict';

const state = {

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 use of the state object!

Comment thread src/index.js
const skyCaption = document.getElementById('sky-caption');
const selectedSky = document.getElementById('sky-dropdown').value;

state.currentSky = 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.

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
Copy Markdown
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!

Comment thread src/index.js

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

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

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 use of comments throughout!

Comment thread index.html
alt="Crystal clear turquoise water in a pool or sea">
<figcaption id="landscape-caption">Photo by Marissa Rodriguez</figcaption>
</figure>
</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.

Overall, nice division of content into sections.

Copy link
Copy Markdown
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!

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

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 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
Copy Markdown
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!

Comment thread src/index.js
skyDropdown.addEventListener('change', manuallyChangeSky);
};

document.addEventListener('DOMContentLoaded', registerEventHandlers);

Copy link
Copy Markdown

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