Pen Settings



CSS Base

Vendor Prefixing

Add External Stylesheets/Pens

Any URL's added here will be added as <link>s in order, and before the CSS in the editor. If you link to another Pen, it will include the CSS from that Pen. If the preprocessor matches, it will attempt to combine them before processing.

+ add another resource


Babel is required to process package imports. If you need a different preprocessor remove all packages first.

Add External Scripts/Pens

Any URL's added here will be added as <script>s in order, and run before the JavaScript in the editor. You can use the URL of any other Pen and it will include the JavaScript from that Pen.

+ add another resource


Save Automatically?

If active, Pens will autosave every 30 seconds after being saved once.

Auto-Updating Preview

If enabled, the preview panel updates automatically as you code. If disabled, use the "Run" button to update.

Format on Save

If enabled, your code will be formatted when you actively save your Pen. Note: your code becomes un-folded during formatting.

Editor Settings

Code Indentation

Want to change your Syntax Highlighting theme, Fonts and more?

Visit your global Editor Settings.

HTML Settings

Here you can Sed posuere consectetur est at lobortis. Donec ullamcorper nulla non metus auctor fringilla. Maecenas sed diam eget risus varius blandit sit amet non magna. Donec id elit non mi porta gravida at eget metus. Praesent commodo cursus magna, vel scelerisque nisl consectetur et.




  background: linear-gradient(to bottom, #920000, #d03a3a);
  overflow: hidden


const [ww, wh] = [window.innerWidth, window.innerHeight];

// WebGL Rendering Engine
const renderer = new THREE.WebGLRenderer({ alpha: true, antialias: true });
renderer.setSize(ww, wh);
renderer.shadowMap.enabled = true;

// New Scene
const scene = new THREE.Scene();

// Perspective Camera
const camera = new THREE.PerspectiveCamera(45, ww/wh, 0.1, 150);

// Position x,y,z axis of camera
camera.position.set(0, 0, 50);

// Controls
const controls = new THREE.OrbitControls(camera);

// create the mesh from geometry and material
const tree = new THREE.Group();

const cylinder = new THREE.CylinderGeometry(2, 2, 5, 32);
const cylmaterial = new THREE.MeshLambertMaterial({ color: 0x966F33 });
const wood = new THREE.Mesh(cylinder, cylmaterial);
wood.position.y = -12;

'xmas'.split('').forEach((layer, i) => {
  const geometry = new THREE.ConeGeometry(7, 20, 32);
  const material = new THREE.MeshLambertMaterial({ color: 0x2C9E4B });
  const cone = new THREE.Mesh(geometry, material);
  const scale = 1 - (i * 0.25);
  cone.position.y = i * 3;
  cone.scale.set(scale, scale, scale);

// lights
const light = new THREE.DirectionalLight(0xeaeaea);
light.position.set(5, 25, 50);
light.castShadow = true;

// adding objects to the scene

// render the scene
const render = () => {
  renderer.render(scene, camera);