<a class="toggle" href="#node" data-toggle>Toggle</a>
<div class="node" id="node" data-node></div>
*, *:before, *:after {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html, 
body {
  width: 100%;
  height: 100%;
}

body {
  display: flex;
  font-family: sans-serif;
  background-color: #fffeca;
}

.node {
  width: 100px;
  height: 100px;
  margin: auto;
  background-color: #00f;
  
  // initial state
  opacity: 0;
  transform: translateY(100%) rotate(360deg);
}

.toggle {
  position: absolute;
  top: 20px;
  left: 50%;
  padding: 6px 10px 5px 10px;
  
  text-align: center;
  text-decoration: none;
  border: 1px solid #00f;
  border-radius: 3px;

  transform: translateX(-50%);
}
View Compiled
const node = document.querySelector('[data-node]')
const toggle = document.querySelector('[data-toggle]')
let initial = true

const tween = node.animate({
  transform: [ 'translateY(100%) rotate(360deg)', 'translateY(0%) rotate(0deg)' ], 
  opacity: [ 0, 1 ],
  easing: 'ease-out',
}, {
  duration: 500,
  fill: 'both'
})

tween.pause()

function handleToggle(event) {
  event.preventDefault()
  
  if(initial) {
    tween.play()
    initial = false
  } else {
    tween.reverse() 
  }
}

toggle.addEventListener('click', handleToggle)
View Compiled
Run Pen

External CSS

This Pen doesn't use any external CSS resources.

External JavaScript

This Pen doesn't use any external JavaScript resources.