Giter Club home page Giter Club logo

advice-generator's Introduction

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

Note: Delete this note and update the table of contents based on what sections you keep.

Overview

The challenge

Users should be able to:

  • ✅ Render the page in
  • ✅ See the advice & number upon rendering.
  • ✅ Be able to click the button to generate new advice.

Screenshot

Desktop Solution

Links

My process

  • I initially built the HTML & CSS template using measurements from the figma design file & style guide.

  • After implementing the HTML & CSS for both desktop & mobile versions, I wrote the JavaScript to pull advice data from the Advice Slip API.

  • I then wired the button to update the advice number span & advice text span with a random quote every time it was clicked.

  • After the main functionality, I decided to play around a bit with adding a spinning animation to the button & an animation to the attribution div.

Built with

  • Semantic HTML5 markup
  • SASS (Css Preprocessor)
  • Flexbox
  • CSS Table
  • Desktop-first workflow

Note: These are just examples. Delete this note and replace the list above with your own choices

What I learned

This helped me in practicing SASS & JavaScript. I particularly enjoyed adding my own animations to the project after completing the main functionality to improve the user experience.

Some of the code I enjoyed writing during the project:

<div class="attribution_img normal" onclick="Rotate()" id="vector_div">
    <img src="images/up-arrow-svgrepo-com.svg" alt="vectorup" class="vector" id="vector">
</div>
.rotate {
    -ms-transform: rotate(180deg);
    -webkit-transform: rotate(180deg);
    transform: rotate(180deg);
    transition-duration: 1.5s;
}

.normal {
    -ms-transform: rotate(0deg);
    -webkit-transform: rotate(0deg);
    transform: rotate(0deg);
    transition-duration: 1.5s;
}
const Rotate = () => {
    if (vector_div.classList.contains("normal")) {
        vector_div.classList.add("rotate");
        vector_div.classList.remove("normal");
    } else if (vector_div.classList.contains("rotate")){
        vector_div.classList.add("normal");
        vector_div.classList.add("rotate");
    }
}

Continued development

I would like to continue focusing on getting better at adding animation interactions whilst maintaining best practices when writing code.

I would like to focus on becoming more adept at improving user experience through improving my typography, animation skillset & copywriting.

Useful resources

  • Example resource 1 - This helped me with any SCSS & JS problems I was running into during making this project.

Author

advice-generator's People

Contributors

shadyxstep avatar

Watchers

 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.