The D - Anime JS

In this example below you will see how to do a The D - Anime JS with some HTML / CSS and Javascript

Thumbnail
This awesome code was written by jackley, you can see more from this user in the personal repository.
You can find the original code on Codepen.io
Copyright jackley ©
  • HTML
  • CSS
  • JavaScript
<!DOCTYPE html>
<html lang="en" >

<head>
  <meta charset="UTF-8">
  <title>The D - Anime JS</title>
  
  
  
      <link rel="stylesheet" href="css/style.css">

  
</head>

<body>

  <div class="flex">
  <svg version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" viewBox="-1.5 -1.5 85 96.25"
     style="width:400px;margin: auto;">
<g id="Layer_1" focusable="false">
  <path fill="#E95E3F" stroke="none" class="letter-d fill" d="M34.106,0H1.149C0.767,0,0,0.383,0,1.149v91.206c0,0.384,0.383,1.149,1.149,1.149h32.957 c27.975,0,47.902-19.544,47.902-46.752C82.009,19.544,62.082,0,34.106,0L34.106,0z M34.106,76.644H17.628V16.479h16.479 c17.628,0,29.891,12.263,29.891,30.274C63.998,63.997,51.734,76.644,34.106,76.644z"/>
  
  <path fill="none" stroke="#020202" class="outer line"  d="M34.106,0H1.149C0.767,0,0,0.383,0,1.149v91.206c0,0.384,0.383,1.149,1.149,1.149h32.957 c27.975,0,47.902-19.544,47.902-46.752C82.009,19.544,62.082,0,34.106,0L34.106,0z"/>
  <!--
  <path fill="none" stroke="red" class="inner2 line"   d="M34.106,76.644H17.628V16.479h16.479c17.628,0,29.891,12.263,29.891,30.274 C63.998,63.997,51.734,76.644,34.106,76.644z"/>
  -->
	<path fill="none" stroke="#020202" class="inner line"   d="M34.106,76.644H17.628V16.479h16.479c17.628,0,29.891,12.263,29.891,30.274 C63.998,63.997,51.734,76.644,34.106,76.644z"/>
  
  

  
  
  <!--<path fill="none" stroke="green" stroke-width="12.1" style="transform: scale(1.37, 1.28) translateX(-11px) translateY(-10px);" class="inner2 line"   d="M34.106,76.644H17.628V16.479h16.479c17.628,0,29.891,12.263,29.891,30.274 C63.998,63.997,51.734,76.644,34.106,76.644z"/>
-->
</g>
</svg>
</div>
  <script src='js/ymlarg.js'></script>

  

    <script  src="js/index.js"></script>




</body>

</html>

/*Downloaded from https://www.codeseek.co/jackley/the-d-anime-js-dvBLJw */
.flex {
  display: flex;
}

/*Downloaded from https://www.codeseek.co/jackley/the-d-anime-js-dvBLJw */
var logoTimeline = anime.timeline({
  direction: 'alternate',
  loop: true,
});
logoTimeline
 .add({
  targets: '.line.outer',
  direction: 'alternate',
  loop: true,
  strokeDashoffset: {
    value: [anime.setDashoffset, 0],
    duration: 3000,
    delay: 500,
    easing: 'linear'
  },
  strokeWidth: {
    value: [0, 1],
    delay: 500,
    duration: 200,
    easing: 'linear'
  },
  offset: 0
})
.add({
  targets: '.line.inner',  
  strokeDashoffset: {
    value: [anime.setDashoffset, 0],
    duration: 3000,
    delay: 500,
    easing: 'linear'
  },
  strokeWidth: {
    value: [0, 1],
    delay: 500,
    duration: 200,
    easing: 'linear'
  },
  offset: 0
})
.add({
  targets: '.letter-d.fill',
  opacity: {
    value: [0, 1],
    delay: 3600,
    duration: 800,
    easing: 'linear'
  },
  
  offset: 0
})
.add({
  targets: '.line.outer',
  opacity: {
    value: [1,0],
    duration: 600,
    delay: 4100,
    easing: 'linear'
  },
  offset: 0
})
.add({
  targets: '.line.inner',
  opacity: {
    value: [1,0],
    duration: 600,
    delay: 4100,
    easing: 'linear'
  },
  offset: 0
})

Comments