Skip to content

Latest commit

 

History

History
86 lines (62 loc) · 2.39 KB

README.md

File metadata and controls

86 lines (62 loc) · 2.39 KB

Frontend Mentor - Advice generator app solution

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.

Table of contents

Overview

The challenge

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

Screenshot

Screenshot 2022-08-31 at 12-07-43 Frontend Mentor Advice generator app

Links

 

My process

Built with

  • Semantic HTML5 markup
  • CSS custom properties
  • Flexbox
  • CSS Grid
  • Vanilla JS
  • Advice Slip API

 

What I learned

  • HTML
    • Don't forget the following!!!
    <noscript>JavaScript disabled</noscript>

 

  • CSS
    • To create the glow effect for the dice upon hover, I used a box shadow...
    #diceBox:hover{box-shadow: 0.1vh 0.1vh 4vh 0.75vh hsl(150, 100%, 66%);}
    • I also learnt that you can 'justify-self' and 'align-self' for individual 'child' elements

 

  • JS
    • I learnt to use an API! ('no-cache' was vital for randomisation otherwise the browser would cache the response and lead to the same advice being generated again and again
    return await fetch("https://api.adviceslip.com/advice", {
          method: 'GET',
          cache: "no-cache"
      })

 

Continued development

  • I would like to practise working with APIs more

Author