<div class="wrapper">
  <div class="container">
    <a href="https://github.com/daybrush" target="_blank" data-typing="i">I</a>
    <a href="https://github.com/daybrush" target="_blank" data-typing="frontend">'m Front-End</a>
    <a href="https://github.com/daybrush" target="_blank" data-typing="engineer">Engineer</a>
    <p data-typing="with">with</p>
    <p data-typing="javascript">JavaScript</p>
    <p data-typing="typescript">TypeScript</p>
    <p data-typing="css">CSS</p>
    <p data-typing="nodejs">Node.js</p>
    <p data-typing="animation">Animation</p>
    <a href="https://github.com/daybrush/scenejs" target="_blank" data-typing="scenejs">Scene.js</a>
    <div class="origin"></div>
  </div>
</div>
@import url('https://fonts.googleapis.com/css?family=Raleway:900&display=swap');

html, body {
  position: relative;
  height: 100%;
  font-family: 'Raleway', sans-serif;
  font-size: 20px;
  margin: 0;
  padding: 0;
  overflow: hidden;
}
* {
  box-sizing: border-box;
}
.wrapper {
  position: absolute;
  width: 300px;
  height: 300px;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%) translateY(20px) scale(1.5);
/*   overflow: hidden; */
  border: 1px solid #333;
}
@media screen and (max-width: 600px) {
  .wrapper {
    transform: translate(-50%, -50%) scale(1);
  }
}
.container {
  position: absolute;
  width: 300px;
  height: 300px;
  border: 1px solid #f55;
}
[data-typing] {
  position: absolute;
  top: 0;
  /*   border: 1px solid #f55; */
  transform-origin: 0% 0%;
  font-size: 25px;
  margin: 0;
  padding: 0;
  top: 100px;
  line-height: 1;
  color: #333;
}
[data-typing="i"] {
  top: 0;
  left: 50px;
  font-size: 90px;
  height: 70px;
  line-height: 70px;
}
[data-typing="frontend"] {
  top: 3px;
  left: 80px;
  font-size: 27px;
  letter-spacing: 1px;
}
[data-typing="engineer"] {
  top: 30px;
  left: 80px;     
  font-size: 40px;
  letter-spacing: 1px;
}
[data-typing="with"] {
  top: 74px;
  left: 265px;
  font-size: 36px;
  transform: rotate(90deg);
  background: #333;
  color: #fff;
  padding: 0px 4px;
}
[data-typing="javascript"] {
  top: 74px;
  left: 229px;
  transform: rotate(90deg);
  font-size: 35px;
}
[data-typing="typescript"] {
  top: 72px;
  right: 110px;
  font-size: 25px;
}
[data-typing="css"] {
  top: 97px;
  right: 110px;
  font-size: 40px;
}
[data-typing="nodejs"] {
  top: 134px;
  right: 110px;
  font-size: 35px;
}
[data-typing="animation"] {
  top: 167px;
  right: 110px;
  font-size: 35px;
}
[data-typing="scenejs"] {
  top: 200px;
  right: 110px;
  font-size: 35px;
}

a {
  color: #333;
  text-decoration: none;
}

body .scenejs-editor-timeline {
  position: fixed;
  bottom: 0;
  max-height: 300px;
}
.origin {
  position: absolute;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #f55; 
  top: 50%;
  left: 50%;
}
/*
https://github.com/daybrush/scenejs
*/
const scene = new Scene({
  ".container": {},
  ".origin": {}
}, {
  selector: true,
});

const item = scene.getItem(".container");
const originItem = scene.getItem(".origin");

function move(startTime, endTime, left, top, rotate, scale) {
  const frame = Scene.kineticFrame({
    left: `${left}px`,
    top: `${top}px`
  }).set({
    transform: {
      rotate: `${rotate}deg`,
      scale,
    }
  })
  const originKeyframe = {
    transform: {
      translate: `calc(-50% - ${left}px), calc(-50% - ${top}px)`,
    }
  }
  item.set({
    [startTime]: frame,
    [endTime]: frame,
  });
  originItem.set({
    [startTime]: originKeyframe,
    [endTime]: originKeyframe,
  });
}


move(0, 0, 90, 115, 0, 5);
move(1, 1, 90, 115, 0, 2);
move(2, 3, 0, 115, 0, 1);
move(4, 4.5, -100, 0, -90, 2);
move(5.5, 6, -52, -18, -90, 1.6);
move(7, 7.5, 30, 45, 0, 2);
move(8.5, 9,  10, 30, 0, 3);
move(10, 10.5, 25, 0, 0, 2.2);
move(11.5, 12, 49, -35, 0, 1.65);
move(13, 13.5, 35, -70, 0, 2);
move(14.5, 18, 0, 0, 0, 1);


/*
typing
https://github.com/daybrush/scenejs-effects
*/

scene.setPlaySpeed(1);
scene.setEasing("ease-in-out");
scene.setIterationCount("infinite");
scene.play();


// new Timeline(scene, document.body)

External CSS

This Pen doesn't use any external CSS resources.

External JavaScript

  1. //daybrush.com/scenejs/release/latest/dist/scene.js
  2. //daybrush.com/scenejs-effects/release/latest/dist/effects.js
  3. //daybrush.com/codepen/scene.js