0xabdulkhalid / advice-generator

This is a solution to the "Advice generator" challenge on Frontend Mentor

Home Page:https://advice-generator-0xabdulkhalid.vercel.app/

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

frontendmentor

Advice Generator Solution

Frontend Mentor Challenge

View Demo  ·  Report Bug  ·  Request Feature

Abdul Khalid's Profile     Status Completed     Challenge Difficulty - Junior


Preview

Project cover image

Links


Pagespeed Insights Score

  • Overall Score 99.3%, Average of Mobile and Desktop
    [ Mobile devices score is only shown below ]
    Scoreboard
    Check out Pagespeed Insights to get live score

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

Installation

To set up the Advice Generator Application locally, follow these steps:

  1. Clone the GitHub repository to your local machine:

    git clone https://github.com/0xabdulkhalid/advice-generator.git
  2. Navigate to the project's directory:

    cd advice-generator
  3. Install the project's dependencies using npm:

    npm install
  4. Build the project to bundle JavaScript, minify HTML and CSS, and move images:

    npm run build
  5. The build files can be found on dist (distribution) directory.


Tags

ES6 Modules | Webpack Bundling | API Integration | Cross-Browser Compatibility | Responsive Design | Code Formatting Guidelines | Automated Deployment with Vercel   

Learnings / Notes

  • Finded a manual way for trigger/invoke click event for button element by creating a new MouseEvent object of type "click" and dispatch it on the button element using the dispatchEvent method.

    • This will simulate a click on the button, and any event listeners attached to it will be triggered as if the button were clicked by the user.
    • I have implemented this feature for initializing advice feed once the user visits/open the app.
  • Learned to create a 3D Dice by using multiple div elements for Dice face along with preserve-3d.

    • Each one uses the transform property to rotate or translate the face in 3D space, giving the illusion of a 3D object.
    • It also applies the dice-spin animation, which presumably spins the dice, the overall result is wonderfull!

Built With

HTML5   CSS3   JavaScript   Webpack   html-minifier   CSS3


Tools Used

NPM   Google   Prettier   Eslint   Visual Studio Code   Git


Acknowledgment


Let's Connect 👋

Linkedin Profile   mail/   Frontend-Mentor Profile   Github Profile

About

This is a solution to the "Advice generator" challenge on Frontend Mentor

https://advice-generator-0xabdulkhalid.vercel.app/

License:MIT License


Languages

Language:CSS 46.1%Language:HTML 32.6%Language:JavaScript 21.3%