benhatsor / coco

CSS Orientation controls for CSS 3D builds.

Home Page:https://barhatsor.medium.com/creating-3d-worlds-with-css-21186d754984

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

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.

About

CSS Orientation controls for CSS 3D builds.

https://barhatsor.medium.com/creating-3d-worlds-with-css-21186d754984

License:MIT License


Languages

Language:JavaScript 99.4%Language:Shell 0.6%