This project is a web-based tool for generating cubic bezier curves for CSS animations. It allows users to visually adjust the control points of a cubic bezier curve and see the resulting animation in real-time.
- Interactive canvas to drag control points and adjust the curve
- Real-time preview of the animation
- Copy the generated
cubic-bezier
value to the clipboard - Responsive design
- Node.js (version 14 or higher)
- npm (version 6 or higher)
- Clone the repository:
git clone https://github.com/ArjunGTX/cubic-bezier-generator.git cd cubic-bezier-generator
- Install the dependencies:
npm install
- Running the Development Server
This will start the Vite development server and you can view the application in your browser at http://localhost:5173.
npm run dev
To build the project for production, run:
npm run build
The production-ready files will be generated in the dist directory.
- Open the application in your browser.
- Drag the control points P1 and P2 on the canvas to adjust the curve.
- The generated cubic-bezier value will be displayed in the output section.
- Click the "Copy" button to copy the value to the clipboard.
- Use the copied value in your CSS animation-timing-function property.
I created this project to experiment with Object-Oriented Programming (OOP) in TypeScript, the HTML canvas element, and vanilla JavaScript. This project is built purely using HTML, CSS, and vanilla JavaScript; no libraries were used.