A Pen by Pawel

Thumbnail
This awesome code was written by Szczepkowski, you can see more from this user in the personal repository.
You can find the original code on Codepen.io
Copyright Szczepkowski ©
  • HTML
  • CSS
  • JavaScript
    <div id="test2"><div id="test"></div></div>


/*Downloaded from https://www.codeseek.co/Szczepkowski/a-pen-by-pawel-MwabZR */
    #test {
  width: 100%;
  height: 100%;
}
#test2 {
  width: 300px;
  height: 300px;
  border: 4px solid black;
  background-color: red;
}
.flipper {
  transform: rotateY(180deg);
  transition: transform 2s;
}
.flipper2 {
  transform: rotateY(180deg);
  transition: transform 2s 2s;
}



/*Downloaded from https://www.codeseek.co/Szczepkowski/a-pen-by-pawel-MwabZR */
    var element = document.getElementById("test");

test.addEventListener("click", action, false);

function action(element) {
  var td=element.target;
  td.className = "flipper";
  td.textContent = "gowno";
  td.addEventListener("transitionend", function(){td.parentNode.className = "flipper2";}, false);
  td.parentNode.className = "";
}





Comments