Latest solutions
Latest comments
- @VidottizzzSubmitted about 3 years ago@Icekid35Posted about 3 years ago
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 😉•••••
0 - @RageOfAthenaSubmitted about 3 years ago@Icekid35Posted about 3 years ago
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
0 - @axlgomezSubmitted about 3 years ago@Icekid35Posted about 3 years ago
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 helpful1 - @MaikolrmSubmitted about 3 years ago@Icekid35Posted about 3 years ago
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 helpful1 - @fersanabria8Submitted about 3 years ago@Icekid35Posted about 3 years ago
Awesome work👏
To get rid of some of the accessibility issues wrap all the element in your body tag with <main></main>
0 - @mensur-durakovicSubmitted about 3 years ago@Icekid35Posted about 3 years ago
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 ^_^
0