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.


                <div id="marsloc"></div>
<article id="marsinfo">
    <p>Home to both the Solar System's highest mountain <i>(Olympus Mons)</i>, and deepest canyon <i>(Valles Marineris)</i>, Mars is the also the planet most likely to support life outside of Earth; seasonal methane plumes observed over several decades have yet to be explained.


                @import url(',400i|Oxygen:300');
* {
  box-sizing: border-box;
body {
  background: black;
  margin: 0;
  min-height: 100vh;
  font-family: Oxygen, sans-serif;
  color: #fff;
#marsloc {
  cursor: grab;
#marsinfo { 
  position: absolute;
  top: 0;
  width: 100%;
  padding: 2rem;
#marsinfo h1 {
  font-size: 8vw;
  margin-top: 0;
  font-weight: 100;
  line-height: 1;
  position: absolute;
#marsinfo div {
  width: 40%;
  position: absolute;
  background-color: rgba(0,0,0,0.3);
  right: 0;
  padding: 1.3rem;
  line-height: 1.6;
  font-size: 1.2rem;
  pointer-events: none;
  @media all and (max-width: 540px) {
    width: 100%;
    left: 0;
    top: 40vw;



                let clock = new THREE.Clock();

const imgLoc = "";
let camera = new THREE.PerspectiveCamera(45, window.innerWidth / window.innerHeight, 0.1, 10000),
light = new THREE.PointLight(0xFFFFFF, 2, 5000);
camera.position.set(1300, 0, 0),
scene = new THREE.Scene();

light.position.set(2000, 2000, 1500);

let marsGeo = new THREE.SphereGeometry (500, 32, 32),
marsMaterial = new THREE.MeshPhongMaterial(),
marsMesh = new THREE.Mesh(marsGeo, marsMaterial);

let loader = new THREE.TextureLoader(); = loader.load(imgLoc+'mars-map.jpg');
marsMaterial.bumpMap = loader.load(imgLoc+'mars-bump.jpg');
marsMaterial.bumpScale = 8;
marsMaterial.specular = new THREE.Color('#000000');

let renderer = new THREE.WebGLRenderer({antialiasing : true});
renderer.setSize(window.innerWidth - 40, window.innerHeight -40)       

let controls = new THREE.OrbitControls(camera, renderer.domElement);
controls.addEventListener('change', render);

function animate(){
function render(){
   var delta = clock.getDelta();
   marsMesh.rotation.y += 0.1 * delta;
   renderer.render(scene, camera); 


marsloc.addEventListener('mousedown', function() { = "-moz-grabbing"; = "-webkit-grabbing"; = "grabbing";

marsloc.addEventListener('mouseup', function() { = "-moz-grab"; = "-webkit-grab"; = "grab";

window.addEventListener( 'resize', onWindowResize, false );

function onWindowResize(){
  camera.aspect = window.innerWidth / window.innerHeight;
  renderer.setSize(window.innerWidth - 40, window.innerHeight - 40);