Giter Site home page Giter Site logo

j3c-coding-challenge-terrence-jung's Introduction

J3C-Coding-Challenge-Terrence-Jung

Setup

For this coding challenge, I will be using React/TypeScript, TailwindCSS, and Framer Motion.

React + TypeScript Setup

I will be using Vite to set up my React/TypeScript project. To start a Vite project, run:

npm create vite@latest

Follow the command line prompts and choose React + TypeScript.

Tailwind CSS Setup

To set up TailwindCSS with a Vite project, run the following commands:

npm install -D tailwindcss postcss autoprefixer
npx tailwindcss init -p

Next, in the tailwind.config file, add paths to all template files in the content object:

/**@type {import('tailwindcss').Config}*/
export default {
  content: ["./index.html", "./src/**/*.{js,ts,jsx,tsx}"],
  theme: {
    extend: {},
  },
  plugins: [],
};

Finally, add the following to your index.css file:

@tailwind base;
@tailwind components;
@tailwind utilities;

Framer Motion Setup

To install Framer Motion, run the following command:

npm install framer-motion

Project Startup

First, ensure you have downloaded all of the project dependencies. Make sure that you are in your project directory. Then run the next command to run your build process.

npm install
npm run dev

Project Notes

Time started: 3:40pm PST (Dec 10th, Sunday)

Time ended: 5:40pm PST (Dec 10th, Sunday)

Notes

Text Animation

  • For text animations static, centered text (unhover) and animations on hover. For the hover animation, I have to make the bottom text visible.
  • Used three span elements inside one span element. This way the 2nd and 3rd span elements are aligned correctly within the button. I made the 1st span element invisible.
  • For animation, I used useAnimationControls to trigger the animation on the span element when a user hovers over the button element.
  • Used a 0.5 duration for onHoverStart and a 0.05 duration for onHoverEnd. The site example has an instantaneous onHoverEnd animation but I was not able to implement that on mine due to an unusual, glitchy movement that happens.

Border Animation

  • onHoverStart: Green -> Gold -> White
  • onHoverEnd: completely reset
  • starts from the right side and moves along a clockwise path
  • the movement seems to have a slow to fast animation
  • to implement this animation using framer motion it seems like I need to use an SVG and path element

Incomplete

  • Border Animation: I wasn't able to figure out how to fit the svg along the button border but was able to get a color gradient animation going. If I had more time, I would place both the SVG element and button element inside a div element and figure out how to set the viewBox correctly.

j3c-coding-challenge-terrence-jung's People

Contributors

terrencejihoonjung 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.