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

Pine - Diana #68

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

Pine - Diana #68

wants to merge 3 commits into from

Conversation

DLozanoC
Copy link

No description provided.

Copy link

@CheezItMan CheezItMan left a comment

Choose a reason for hiding this comment

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

Nice work Diana, you hit the learning goals here. Well done. I like the styling, very solid submission.

Other than my comments the only suggestion for improvement I have is to consider adjusting the layout to fit mobile devices. (not important, just a note for later).

const resetButton = document.getElementById('reset');
resetButton.addEventListener('click', resetCity)
};
document.addEventListener("DOMContentLoaded", registerEventhandlers);

Choose a reason for hiding this comment

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

👍

Comment on lines +49 to +67
const upTemperature = () => {
const tempUp = document.getElementById('base-temp');
//Makes temp count go up
state.temperature += 1;
//Making the text content o tempUp = the current temperature
tempUp.textContent = `${state.temperature}`;
//querySelector: Returns the first element
const tempUptemp = document.querySelector('#temperature')
const clothes = document.getElementById('clothes')
temperature()
};
const downTemperature = () => {
const tempDown = document.getElementById('base-temp');
state.temperature -= 1;
//Returns every element in the Node
tempDown.textContent = `${state.temperature}`;
//This line is selecting the temperature id
temperature()
};

Choose a reason for hiding this comment

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

Just note that these two functions could be combined into one that takes a parameter.

Then the event handler could look like.

TemperatureHot.addEventListener('click', () => upTemperature(+1))

and

TemperatureHot.addEventListener('click', () => upTemperature(-1))

You would just need to modify the function to use the parameter instead of a hardcoded state.temperature += 1 or state.temperature -= 1

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