Giter VIP home page Giter VIP logo

advice-generator's Introduction

Advice generator App

Netlify Status

Advice-generator-banner

Welcome! 👋

Thanks for checking out this front-end coding challenge by Frontend Mentor a platform for helping you improve your coding skills by building realistic projects.

To do this challenge, you need a basic understanding of HTML, CSS and JavaScript.

The challenge

Your challenge is to build out this advice generator app using the Advice Slip API and get it looking as close to the design as possible. You can use any tools you like to help you complete the challenge. So if you've got something you'd like to practice, feel free to give it a go. Your 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

Support

Join our Slack community and ask questions in the #help channel.

📝 Learning

Picture Tag

The picture tag is a semantic html element used in adding multiple images, according to W3schools, the most common use of the element is for art direction in responsive designs. Instead of having one image that is scaled up or down based on the viewport width, multiple images can be designed to more nicely fill the browser viewport.

Since we have a small and large image for the line, we can use the picture element to specify what image to show based on a given viewport. Example:

<picture>
<source class="desktop" media="(min-width: 601px)" srcset="images/pattern-divider-desktop.svg" />
<source class="mobile" media="(max-width: 550px)" srcset="images/pattern-divider-mobile.svg" />
<img class="line" src="images/pattern-divider-desktop.svg" alt="Icon divider" />
</picture>

In the code above, at 601px and above, (from tablet to desktop and beyond) we want to load the desktop divider image and on 550px and below, we want to load the mobile divider image and then we have a fallback image in case of any browser support issues. No css, no hiding the image manually, 😎 cool right?

Semantic Tags

To practice writing cleaner and more accesible code, I made sure to use semantic html elemnents like:

  • <Blockquote></Blockquote>: For wrapping the advice element
  • <Picture></Picture>: For the images
  • <Main></Main>: For wrapping the whole content
  • <Section></Section>: For the card container itself.

advice-generator's People

Contributors

evavic44 avatar imgbotapp avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.