WoodNeck / css-camera

New way to see a web page with CSS3 3D transform

Home Page:https://woodneck.github.io/css-camera/

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

πŸ“· CSS-CAMERA

npm GitHub

Add depth to your web page with CSS3 3D transform.

This project is mostly inspired by Keith Clark's work.

✨ Features

  • Movable, and Rotatable camera for your scene.
  • Can move to in front of any element in your scene, whether it has been rotated or translated.

βš™οΈ Installation

npm i css-camera
# or
yarn add css-camera

πŸƒ Quick Start

// Prerequisite:
// Create your scene as you like
const card = document.querySelector("#card");
const cardButton = document.querySelector("#card-button");

// First, make camera
const camera = new CSSCamera("#space");

// Call its method, then update it!
cardButton.onclick = () => {
  camera.focus(card);
  camera.update(2000);
}

Check more methods on the πŸ“„API Documentation page

πŸ“œ License

MIT

About

New way to see a web page with CSS3 3D transform

https://woodneck.github.io/css-camera/

License:MIT License


Languages

Language:TypeScript 72.2%Language:HTML 17.9%Language:CSS 7.4%Language:JavaScript 2.6%