This is a solution to the Advice generator app challenge on Frontend Mentor. Frontend Mentor challenges help you improve your coding skills by building realistic projects.
Users should be able to:
- View the optimal layout for the app depending on their device's screen size
- See hover states for all interactive elements on the page
- Generate a new piece of advice by clicking the dice icon
- Solution URL: Click Here
- Live Site URL: Click Here
- Semantic HTML5 markup
- CSS custom properties
- Flexbox
- Mobile-first workflow
I learnt how to use asyn await function effectively
async function advice() {
const response = await fetch(URL);
const data = await response.json();
const { id, advice } = data.slip;
adviceText.innerHTML = `<h1 class="advice__heading">Advice # ${id}</h1>
<p class="advice__text">
" ${advice} "
</p>`;
}
advice();
- Frontend Mentor - Nishant Kumar