Pen Settings

HTML

CSS

CSS Base

Vendor Prefixing

Add External Stylesheets/Pens

Any URLs added here will be added as <link>s in order, and before the CSS in the editor. You can use the CSS from another Pen by using its URL and the proper URL extension.

+ add another resource

JavaScript

Babel includes JSX processing.

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

Packages

Add Packages

Search for and use JavaScript packages from npm here. By selecting a package, an import statement will be added to the top of the JavaScript editor for this package.

Behavior

Auto Save

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

              
                <p>*go to css line 94 - 100 to change augmenatations (replace the last class name with one of the options in the comment)</p>
<div id="bm"></div>
    <div id="types"> 
      <button class="curioso" onclick="curiosoType(1)">cat</button>
      <button class="curioso" onclick="curiosoType(2)">bird</button>
      <button class="curioso" onclick="curiosoType(0)">beast</button>
    </div>
    <div id="emote"> 
      <button onclick="btnEmote(idleFrames)">idle (loop)</button>
      <button onclick="btnEmote(walkFrames)">walk (loop)</button>
      <button onclick="btnEmote(jumpFrames, 1)">jump</button>
      <button onclick="btnEmote(happyFrames, 1)">happy</button>
      <button onclick="btnEmote(sadFrames, 1)">sad</button>
      <button onclick="btnEmote(curiosFrames, 1)">curios</button>
    </div>
    <div id="color"> 
      <button class="style" onclick="btnStyle(1)">style 1</button>
      <button class="style" onclick="btnStyle(2)">style 2</button>
      <button class="style" onclick="btnStyle(3)">style 3</button>
      <button class="style" onclick="btnStyle(4)">style 4</button>
    </div>

              
            
!

CSS

              
                html,body {
  background-color: #36383F;/*F2F2F2, 36383F*/
  width: 100%;
  height: 100%;
  margin: 0;
  overflow: hidden;
}
p {
  color: lightgray;
  position: absolute;
  width: 190px;
  bottom: 20px;
  right: 20px;
}
#bm {
  margin-left: auto;
  margin-right: auto;
  width: 525px;
  height: 525px;
/*   transform: scaleX(-1); */
}
#emote {
  width: 100%;
  position: absolute;
  bottom: 15%;
  left: 10px;
}
#color {
  width: 100%;
  position: absolute;
  bottom: 4%;
  left: 10px;
}
.style {
  width: 60px;
  height: 60px;
}
#types {
  width: 100px;
  position: absolute;
  top: 10%;
  right: 6%;
}

#emote > button {
  width: 100px;
  height: 40px;
}
.curioso {
  width: 60px;
  height: 60px;
  border-radius: 10px;
}

/*  
  base -> body
  highlight1 -> chin + top shade of tail
  highlight2 -> strips on body
  highlight3 -> dots on body

  highlight2 is the middle color btw base and 3, 1 is bright;
*/

.base.style2 path { fill: rgb(200, 100, 150); }
.highlight1.style2 path { fill: rgb(70, 120, 170); }
.highlight2.style2 path { fill: rgb(180, 200, 120); }
.highlight3.style2 path { fill: rgb(220, 120, 150); }

.base.style3 path { fill: #EEDA58; }
.highlight1.style3 path { fill: #5BBC9F; }
.highlight2.style3 path { fill: #E6A237; }
.highlight3.style3 path { fill: #00BDA8; }

.base.style4 path { fill: #128DC2; }
.highlight1.style4 path { fill: #29B0D4; }
.highlight2.style4 path { fill: #E5DD74; }
.highlight3.style4 path { fill: #D2C625; }

/* .type,  */
.glow,
.aug.face, 
.aug.eyes,
.aug.head,
.aug.body,
.aug.legs,
.aug.back,
.aug.tail
{ display: none; }


/* note: moved cloak to back
lacecollar is upper body*/

.aug.face.goatbeard, /* none, tusks, goatbeard, mustache, fangs */
.aug.eyes.starryeyes, /* default, aviatorgoggles, reptile, glasses, eyebrows, redcheeks, paint, starryeyes, leaf, mask, sunglasses */
.aug.head.aviatorhat, /* none, default, antlers, aviatorhat, partyhat, flower, acorn, winterhat, unicorn, crown, horns */
.aug.body.lacecollar, /* none, default, lacecollar, quilted, bolt, scarf, collar */
.aug.legs.rainboots,/* none, default, duckfeet, starry, ghost, mercuryboots, redshoes, flower, fire, rainboots, octopus, spider */
.aug.back.starryback, /* none, firespikes, flower, starryback, cloak, bat, wings, spikes */
.aug.tail.fish /* default, squirrel, spikey, winter, starry, dragon, fish */
{ display: block; }

.glow.none /* none, powered_up, book_magic, mind_reader, inspiration */
{ 
  display: block; 
  animation: pulse 1.5s infinite ease-in-out;
}

@keyframes pulse {
  0% {
    opacity: .2;
  }
  50% {
    opacity: 1;
  }
  100% {
    opacity: .2;
  }
}

              
            
!

JS

              
                var styleNum = document.getElementsByClassName("style");
var bases = document.getElementsByClassName("base");
var highlight1s = document.getElementsByClassName("highlight1");
var highlight2s = document.getElementsByClassName("highlight2");
var highlight3s = document.getElementsByClassName("highlight3");
var styleArray = [bases, highlight1s, highlight2s, highlight3s];
var curiosoTypes = document.getElementsByClassName("type");
var shareCode = "FcPmtU";

var walkFrames = [0, 60];
var idleFrames = [60, 120];
var jumpFrames = [120, 170];
var happyFrames = [170, 220];
var sadFrames = [220, 275];
var curiosFrames = [275, 330];

var isLooping = false;

var bm = document.getElementById("bm");
var animData = {
  container: bm,
  renderer: "svg",
  loop: true,
  prerender: false,
  autoplay: false,
  autoloadSegments: false,
  path: "https://assets4.lottiefiles.com/temp/lf20_" + shareCode + ".json"
  
  //https://amplifylitco.github.io/aqua-sandbox/bodymovin/curioso/curioso_aug_emo_test.json"
};
var anim;

anim = bodymovin.loadAnimation(animData);
anim.addEventListener("DOMLoaded", startAnimation);

function btnEmote(emote, resetIdle){
  if (resetIdle == 1) {
     if (isLooping) {
        return;
      }
      isLooping = true;
      anim.playSegments([emote,idleFrames], true);
      anim.addEventListener("loopComplete", setIdle);
  } else {
      anim.playSegments(emote, true);
  }
}

function setIdle() {
 isLooping = false;
 anim.removeEventListener("loopComplete", setIdle);
}

function startAnimation() {
  btnEmote(idleFrames);
}

function btnStyle(n) {
  for (var j = 0; j < styleArray.length; j++){
    for (var i = 0; i < styleArray[j].length; i++) {   
      for (var k = 2; k <= styleNum.length; k++){
        styleArray[j][i].classList.remove('style' + k);
      }
      styleArray[j][i].classList.add('style' + n);
    }
  }
}

function curiosoType(type) {
  for (var i = 0; i < curiosoTypes.length; i++) {
      curiosoTypes[i].style.display = "none";
  }
  curiosoTypes[type].style.display = "block";
}
              
            
!
999px

Console