JSFiddle - React, Tailwind, and code Playground

HTML

<div class="block"></div>
<button>Click</button>

CSS

.block{
    position:absolute;
    bottom:10px;
    right:10px;
    left:10px;
    height:100px;
    background:gray;
    -webkit-transition: -webkit-transform 2s;
}

JavaScript

document.querySelector("button").addEventListener("click",function(){
    document.querySelector(".block").classList.add("hide");
});
var stylesheet = document.styleSheets[0];
ruleTextContainer = stylesheet.insertRule('.block.hide{ -webkit-transform:translateY(-'+window.innerHeight+'px); }',stylesheet.cssRules.length);