-
Notifications
You must be signed in to change notification settings - Fork 4.1k
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
Create Dog CEO App #12
base: master
Are you sure you want to change the base?
Create Dog CEO App #12
Conversation
App fetches images and breeds from URL's. Breeds can be filtered with a dropdown. Clicking on a breed changes the color randomly.
<option value="e">e</option> | ||
<option value="f">f</option> | ||
<option value="g">g</option> | ||
<option value="h">h</option> | ||
<option value="i">i</option> | ||
<option value="j">j</option> | ||
<option value="k">k</option> | ||
<option value="l">l</option> | ||
<option value="m">m</option> | ||
<option value="n">n</option> | ||
<option value="o">o</option> | ||
<option value="p">p</option> | ||
<option value="q">q</option> | ||
<option value="r">r</option> | ||
<option value="s">s</option> | ||
<option value="t">t</option> | ||
<option value="u">u</option> | ||
<option value="v">v</option> | ||
<option value="w">w</option> | ||
<option value="x">x</option> | ||
<option value="y">y</option> | ||
<option value="z">z</option> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can you think of any ways to do this programmatically in JS?
} | ||
|
||
const handleError = (error) => { | ||
console.log(error) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
console.log(error) |
function getRandomColor() { | ||
const hexLetters = '0123456789ABCDEF'; | ||
let color = '#'; | ||
for (let i = 0; i < 6; i++) { | ||
color += hexLetters[Math.floor(Math.random() * 16)]; | ||
} | ||
return color; | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Fun!
App fetches images and breeds from URL's.
Breeds can be filtered with a dropdown. Clicking on a breed changes the color randomly.