Latest solutions
Latest comments
- @Vidottizzz@Icekid35
Hello there Nice work 👏👏
The reason it keeps reload is because you are calling location.reload() method another way to generate the advice without reloading is to modify your script from •{ fetch("https://api.adviceslip.com/advice").then((response) => { response.json().then((json) => {
titleAdvice.innerText = `ADVICE #${json.slip.id}`; advice.innerText = `" ${json.slip.advice}"`; }); btn.addEventListener('click', function() { window.location.reload(); }) });
}•••••••• To ••••••••••{ fetch("https://api.adviceslip.com/advice").then((response) => { response.json().then((json) => {
titleAdvice.innerText = `ADVICE #${json.slip.id}`; advice.innerText = `" ${json.slip.advice}"`; }); btn.addEventListener('click', function() { fetch("https://api.adviceslip.com/advice").then((response) => { response.json().then((json) => { titleAdvice.innerText = `ADVICE #${json.slip.id}`; advice.innerText = `" ${json.slip.advice}"`; });
})
}) });
}•••••• or you can just wrap it in another function like this ••••••••••••{ function Regenerate(){ fetch("https://api.adviceslip.com/advice").then((response) => { response.json().then((json) => {
titleAdvice.innerText = `ADVICE #${json.slip.id}`; advice.innerText = `" ${json.slip.advice}"`; });
} °°°°°°°°°°then call the function like this °°°°°° btn.onclick=Regenerate }••••••••• ALSO TO GET RID OF THE ACCESSIBILITY ISSUES WRAP ALL YOUR ELEMENT IN A MAIN TAG 😉•••••
- @RageOfAthena@Icekid35
Nice work 👏👏 Especially the loading animation Just a few tips: •increase the margin top to make it look more identical(optional) •increase the padding (top and bottom) for each of your element Aside that bravo👏 good job
- @axlgomez@Icekid35
Bravo👏👏 Nice work To get rid of the html issue - you can replace your 'display__current ' element with an h1 element instead of a div
Marked as helpful - @Maikolrm@Icekid35
Amazing work 👏 To get rid of some accessibility issues ensure you wrap all the element in your body tag with a<main</main> tag😉
Marked as helpful - @fersanabria8@Icekid35
Awesome work👏
To get rid of some of the accessibility issues wrap all the element in your body tag with <main></main>
- @mensur-durakovic@Icekid35
Awesome work💯
Let me put a little tip in the tip jar🤓
To clear the accessibility issues :-
• Wrap your entire component in a <main></main> Tag • wrap your score in an <h1></h1> tag
And to make your animation cooler
I think you should show make the 'play again' button (including win lose and tie ) show up after what the house picked has showed up;-)
Stunning animations by the way ^_^