Skip to content

Latest commit

 

History

History
52 lines (38 loc) · 1.34 KB

README.md

File metadata and controls

52 lines (38 loc) · 1.34 KB

CSS Orientation Controls

Orientation controls for 3D CSS builds.

About coco

Usage

Import the script in your HTML:

<script src="https://unpkg.com/cocobean/coco.min.js"></script>

And add coco to an element:

document.querySelector('.3dCSS').coco();

Rotate by dragging, move with arrow keys.

Disable default controls

document.querySelector('.3dCSS').coco(false);

Move the camera

var scene = document.querySelector('.3dCSS').coco();
scene.camera(x, y, z);

Multiple elements (grouped coco)

document.querySelectorAll('.3dCSS, .3dPlane').coco();

Examples

Check out this collection on Codepen.