<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>Document</title>
<style>
* {
box-sizing: border-box;
}
body {
max-width: 400px;
}
a {
text-decoration: none;
}
.block {
width: 30px;
height: 30px;
position: relative;
background: #333;
}
.n2 {
float: right;
}
.n1 {
display: none;
transition: 1s;
left:0;
}
</style>
</head>
<body>
<div class="container-1">
<ul>
<li><a href="">1</a></li>
<li><a href="">2</a></li>
<li><input id="koasw" type="checkbox">3</li>
<li><a href="">4</a></li>
</ul>
</div>
<div class="container-2">
<div class="block n1"></div>
</div>
<div class="container-3">
<div class="block n2"></div>
</div>
<script>
var koasw = document.querySelector('#koasw');
koasw.onclick =e=> {
e.target.parentNode.style.display = 'none';
var n1 = document.querySelector('.n1');
n1.style.display = 'block';
setTimeout(()=>n1.style.left = '100%');
setTimeout(()=>n1.style.display = 'none',1000);
localStorage.setItem('an', 1);
};
if(localStorage.getItem('an') == 1) koasw.click();
</script>
</body>
</html>