Coder Social home page Coder Social logo

crowdedastronaut / advice-generator-app Goto Github PK

View Code? Open in Web Editor NEW
1.0 1.0 0.0 321 KB

Advice generator app is a deployed, mobile first, website that allows the user to click on a button and receive advice from an API.

Home Page: https://crowdedastronaut.github.io/advice-generator-app/

HTML 28.66% JavaScript 7.47% SCSS 63.86%
front-end-development front-end-mentor design

advice-generator-app's Introduction

Frontend Mentor - NFT preview card component solution

This is a solution to the Advice Generator App challenge on Frontend Mentor.

Table of contents

About

Advice generator app is a deployed, mobile first, website that allows the user to click on a button and receive advice from an API. This project was an exercise in:

  • Semantic HTML5 markup
  • CSS custom properties
  • Flexbox
  • Mobile-first workflow
  • Sass - Syntactically Awesome Style Sheets
  • Retrieving data from an API using fetch
  • Styling data from an API

The challenge

Users should be able to:

  • View the optimal layout depending on their device's screen size
  • See hover states for interactive elements

Screenshots

Mobile Preview

Mobile Preview

Desktop Preview

Desktop Preview

Technologies

Front End Languages HTML CSS SASS
Design Figma
Utilities Git
Deployment Github Pages


What I learned

This exercise tested pixel perfect design and adjusting font-size, line-height, and line-spacing for the mobile vs. desktop views. It also tested the very basics of rendering data using the JS fetch API. There is a CSS hover state on the desktop view that I'm still figuring out!

I used an anchor tag as opposed to a button for the click listener.

<a
  role="button"
  tabindex="0"
  class="green-button"
  onclick="getAdvice()"
  aria-label="click here to generate some advice"
  target="_blank"
  rel="noopener"
></a>

I used scss color variables to make things easy to read and easy to change.

.proud-of-this-scss {
  $dark-blue: #202733;
  $dark-grayish-blue: #313a48;
  $grayish-blue: #4f5d74;
  $light-cyan: #cee3e9;
  $neon-green: #53ffaa;
}

I used the JS fetch API to GET the data from the advice API and return the data as JSON.

const getAdvice = async () => {
  const result = await fetch(
    "https://api.adviceslip.com/advice"
  );
  const data = await result.json();
};

Author

Acknowledgments

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.