Pen Settings

HTML

CSS

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

JavaScript

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

Behavior

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.

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.

HTML

            
              <div id="lottie"></div>
<div id="title_text">Click to start your spirit animal search</div>
            
          
!

CSS

            
              body,
html {
  background-color: #000845;
  margin: 0px;
  height: 100%;
  overflow-x: hidden;
  overflow-y: auto;
}

#lottie {
  background-color: #000845;
  width: 100%;
  height: 100%;
  min-width: 600px;
  min-height: 400px;
  /*width:1024px;*/
  /*height:1024px;*/
  position: absolute;
  left: 0px;
  top: 0px;
  display: block;
  overflow: hidden;
  transform: translate3d(0, 0, 0);
  box-sizing: border-box;
  /*margin: auto;*/
  /*display:none;*/
}

.email_input_front {
  pointer-events: none;
}

.email_input,
.password_input {
  width: 290px;
  height: 70px;
  font-size: 30px;
  text-align: center;
  border: 0;
  padding: 0;
  color: white;
  background-color: transparent;
  box-sizing: border-box;
  padding: 10px 10px;
}

.password_input {
  width: 340px;
}

.email_input:focus {
  outline: none;
}

.Scene_1_box_1 .at,
.Scene_1_box_1 .domain,
.Scene_1_box_2 .user,
.Scene_1_box_2 .domain,
.Scene_1_box_3 .user,
.Scene_1_box_3 .at {
  display: none !important;
}

.master {
  overflow: visible !important;
}

.master > div {
  pointer-events: none;
}

.master > div > div {
  pointer-events: all;
}

#submit_button_init,
#submit_button_email,
#submit_button_password,
#submit_button_traits,
#submit_button_slider,
#submit_button_year {
  cursor: pointer;
}

#submit_button_email div,
#submit_button_slider div,
#submit_button_password div,
.SCENE_3_Question {
  pointer-events: none;
}

#submit_button_email div svg,
#submit_button_email div svg *,
#submit_button_slider div svg *,
#submit_button_password div svg,
#submit_button_password div svg * {
  pointer-events: all;
}

.scene_3_checkbox {
  cursor: pointer;
}

#year_txt {
  -webkit-user-select: none; /* Safari */
  -moz-user-select: none; /* Firefox */
  -ms-user-select: none; /* IE10+/Edge */
  user-select: none; /* Standard */
}

#Scene_4_b_slider {
  cursor: ew-resize;
}

#Scene_4_slider {
  cursor: pointer;
}

#title_text {
  position: absolute;
  top: 20px;
  left: 0;
  right: 0;
  margin: auto;
  font-size: 30px;
  color: #eccc4f;
  text-align: center;
  font-family: Arial, sans-serif;
  transform: translateY(-60px);
  transition: transform 2.5s cubic-bezier(0.85, 0, 0.23, 1);
}

#title_text.enter {
  transition: transform 2.5s cubic-bezier(0.01, 0.83, 0.31, 0.985);
  transform: translateY(0px);
}

            
          
!

JS

            
              
//If you want to control the camera with your mouse set cameraActive to true
var cameraActive = true;
// cameraRatio controls the maximum movement of the camera
var cameraRatio = .2;

var animationContainer = document.getElementById('lottie');
var animData = {
    container: animationContainer,
    renderer: 'html',
    loop: true,
    autoplay: false,
    rendererSettings: {
        preserveAspectRatio: 'xMidYMid meet',
        className: 'master',
        hideOnTransparent: false,
        progressiveLoad: true
    },
    path: 'https://labs.nearpod.com/bodymovin/demo/monument/data.json'
};
anim = lottie.loadAnimation(animData);
var animationAPI;
window.addEventListener('mousemove', updateMouseValue);
window.addEventListener('touchmove', updateMouseValue);
window.addEventListener('mousewheel', updateMouseWheel);
var last_mouse_coords = [0,0];
var FRAME_RATE = 30;
var camera_zoom_value = 5000;
var current_camera_zoom_value = 5000;
var camera_null_animator;
anim.addEventListener('DOMLoaded', setup);

function setupCamera() {
    var camera_position = animationAPI.getKeyPath('ISOMETRIC_CAMERA,Position');
    animationAPI.addValueCallback(camera_position, function(currentValue) {
        var x = last_mouse_coords[0] + (((mouse_coords[0] - window.innerWidth / 2) * cameraRatio) - last_mouse_coords[0]) / 10;
        var y = last_mouse_coords[1] + (((mouse_coords[1] - window.innerHeight / 2) * cameraRatio) - last_mouse_coords[1]) / 10;
        last_mouse_coords[0] = x;
        last_mouse_coords[1] = y;
        var newCoords = [x, y, currentValue[2]]
        return newCoords
    })
    var camera_zoom_animator = animationAPI.getKeyPath('ISOMETRIC_CAMERA,Zoom');
    animationAPI.addValueCallback(camera_zoom_animator, function(currentValue) {
        current_camera_zoom_value = current_camera_zoom_value + (camera_zoom_value - current_camera_zoom_value) / 20;
        return current_camera_zoom_value
    })

    /*var orientation = [0,0,0];
    var camera_orientation_animator = animationAPI.getKeyPath('ISOMETRIC_CAMERA,Orientation');
    animationAPI.addValueCallback(camera_orientation_animator, function(currentValue) {
        return orientation
    })
    function deviceOrientationHandler(e) {
        var body = document.getElementById('lottie');
        body.style.backgroundColor = 'black';
        orientation[0] = e.alpha
        orientation[1] = (e.beta - 90)
        orientation[2] = e.gamma
    }
    if (window.DeviceOrientationEvent) {
      window.addEventListener('deviceorientation', deviceOrientationHandler, false);
    }*/
}

function completeScene0() {
    titleText.exitText();
    scene1.setup();
    //scene4_b.setup();
    //scene5.setup();
    setTimeout(function() {
        camera_null_animator.playSegment(0 / FRAME_RATE, 253 / FRAME_RATE);
    },500);
}

function completeScene1() {
    titleText.exitText();
    scene2.setup();
    setTimeout(function() {
        camera_null_animator.playSegment(253 / FRAME_RATE, 506 / FRAME_RATE);
    },500);
}

function completeScene2() {
    titleText.exitText();
    scene3.setup();
    camera_null_animator.playSegment(507 / FRAME_RATE, 758 / FRAME_RATE);
}

function completeScene3() {
    titleText.exitText();
    scene4_b.setup();
    camera_null_animator.playSegment(759 / FRAME_RATE, 1010 / FRAME_RATE);
}

function completeScene4() {
    titleText.exitText();
    scene4_b.setup();
    camera_null_animator.playSegment(1011 / FRAME_RATE, 1262 / FRAME_RATE);
}

function completeScene4_b() {
    titleText.exitText();
    scene5.setup();
    camera_null_animator.playSegment(1011 / FRAME_RATE, 1262 / FRAME_RATE);
}

function setupMainComp() {
    camera_null_animator = animationAPI.getKeyPath('Timed_Comp,Time Remap').getPropertyAtIndex(0);
    camera_null_animator.setLoop(false);
    camera_null_animator.playSegment(0, 0);
    var humanoid_animator = animationAPI.getKeyPath('Timed_Comp,Humanoid_2,Time Remap').getPropertyAtIndex(0);
    humanoid_animator.playSegment(0, 40 / FRAME_RATE);
}

function setup() {
    animationAPI = lottie_api.createAnimationApi(anim);
    window.addEventListener('resize',function(){anim.resize()});
    setTimeout(function(){
        setupMainComp();
      if(cameraActive) {
        setupCamera();
      }
        titleText.setup();
        scene0.setup();
        anim.play();
    }, 100)
}

var mouse_coords = [0,0];
function updateMouseValue(ev) {
    mouse_changed = true;
    var mouseX, mouseY;
    if(ev.touches && ev.touches.length) {
        var mouseX = ev.touches[0].pageX;
        var mouseY = ev.touches[0].pageY; 
    } else if(ev.pageX !== undefined) {
        mouseX = ev.pageX;
        mouseY = ev.pageY;
    }
    mouse_coords[0] = mouseX;
    mouse_coords[1] = mouseY;
}

function updateMouseWheel(ev) {
    camera_zoom_value -= ev.deltaY * 2;
    if(camera_zoom_value >= 9000 ) {
        camera_zoom_value = 9000;
    }
  ev.preventDefault();
  ev.stopImmediatePropagation();
}
            
          
!
999px

Console