Сообщение от рони
|
JS может справится
|
<!doctype html>
<html lang="ru">
<head>
<meta charset="UTF-8">
<title>Document</title>
<style type="text/css">
.terms_of_use {
transform: translateY(0);
position: fixed;
height: 70px;
width: 100%;
background-color: hsla(40, 100%, 30%, 1);
transition: .8s;
}
.terms_of_use.yes{
transform: translateY(-120%);
}
body.hide .terms_of_use{
display: none;
}
</style>
<script>
window.onload = function(){
const termsOfUse = document.querySelector(".terms_of_use");
const iAgree = document.querySelector(".i_agree");
if (!localStorage.getItem("hiden")){
iAgree.onclick = function() {
termsOfUse.classList.add("yes");
localStorage.setItem("hiden", "abrakadabra")
}
}
}
</script>
</head>
<body>
<script>
if (localStorage.getItem("hiden")) document.body.classList.add("hide");
</script>
<div class="terms_of_use"><button class="i_agree">принять</button></div>
</body>
</html>