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
- Semantic HTML5 markup
- CSS custom properties
- Display
- CSS Grid
- JS
.click-btn:hover{
box-shadow:0 0 20px hsl(150, 100%, 66%);
}
function main() {
const apiLink='https://api.adviceslip.com/advice';
var advId=document.getElementById('advice-id');
var adv=document.getElementById('advice');
var fetchData=fetch(apiLink);
fetchData.then((data)=>{
return data.json()
}).then((data)=>{
advId.innerHTML="Advice #"+data.slip.id;
adv.innerHTML="\""+data.slip.advice+"\"";
})
}
- Example resource 1 - This helped me for shadow generating. I really liked this pattern and will use it going forward.
- Website - [Aman Singh]
- Frontend Mentor - @aman-abesec