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

Zoisite - Liz Trejo & Muniba Kimes #55

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

Conversation

Lissetet
Copy link

@Lissetet Lissetet commented Jun 12, 2023

We completed the base project in the digital-template branch. We then added additional styling and functionality in the styling branch, which is the branch this pull request was made from.

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 looking site Muniba & Liz! I've left a few comments, once you take a look please let me know if there's anything I can clarify =]

</div>
<button id="cityNameReset" class="city-name__reset-btn">Reset</button>
</section>
<section class="footer__content">

Choose a reason for hiding this comment

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

To follow best practices for semantic HTML, if this represents a footer, we should use the <footer> tag and style as needed.

<h2 id="headerCityName" class="header__city-name">Las Vegas</h2>
</div>
<span>Weather Last Updated: <span id="lastUpdatedValue">N/A</span></span>
<div class="temperature__content">

Choose a reason for hiding this comment

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

I would strongly suggest swapping out some of the divs across the page for more semantic elements like nested sections or articles, and consider using a main tag to make it clear what is the central content of the page for folks using assistive technologies.

city: 'las vegas', //default city
weather: {},
}
const temperatureMappings = [

Choose a reason for hiding this comment

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

I love this for making it easy to see what the temperature settings are all in one place.

Comment on lines +17 to +18
const elementsWithId = document.querySelectorAll('[id')
elementsWithId.forEach(element => state[element.id] = element);

Choose a reason for hiding this comment

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

If you know you want every element with an ID loaded up at the start, this is such a handy way to do it!

state.weather.sunset = convertTimestampToTime(sunset);
state.lastUpdated = convertTimestampToTime(weatherResponse.data['dt']);

// update UI

Choose a reason for hiding this comment

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

Great use of short comments to help organize the code and give readers context

}

const handleCityNameUpdate = () => {
state.city = state.cityNameInput.value || 'Las Vegas';

Choose a reason for hiding this comment

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

I love this to handle when the user might clear the input field.

Comment on lines +123 to +124
const handleIncrease = () => handleTempChange(1);
const handleDecrease = () => handleTempChange(-1);

Choose a reason for hiding this comment

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

These are declared pretty far from where they're used, I'd consider moving them closer to the function that registers these as callbacks. Since they are only used in one location, another option could be writing them as anonymous functions where they are registered:

state.increaseTempControl.addEventListener('click', () => {
    handleTempChange(1)
});

Comment on lines +139 to +143
document.documentElement.style.
setProperty('--bgImage', `var(--${state.timePeriod}BgImage)`);
document.documentElement.style.
setProperty('--bgColor', `var(--${state.timePeriod}BgColor)`);
state.sky.src = `./src/icons/01${state.timePeriod}.svg`;

Choose a reason for hiding this comment

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

So good how the background updates with the real environment ^_^

setTimePeriod();
};

document.addEventListener('DOMContentLoaded', onLoaded);

Choose a reason for hiding this comment

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

Really nice organization of code across the file!

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.

4 participants