Skip to content

benhatsor/coco

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

88 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

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.