Skip to content

Pine - Diana #68

Open
DLozanoC wants to merge 3 commits intoAda-C16:mainfrom
DLozanoC:main
Open

Pine - Diana #68
DLozanoC wants to merge 3 commits intoAda-C16:mainfrom
DLozanoC:main

Conversation

@DLozanoC
Copy link
Copy Markdown

No description provided.

Copy link
Copy Markdown

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

Comment thread src/index.js
const resetButton = document.getElementById('reset');
resetButton.addEventListener('click', resetCity)
};
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.

👍

Comment thread src/index.js
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()
};
Copy link
Copy Markdown

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