<div class="hello" style="display:none" id="welcome-window">
<div class="hellotext">
<div align="center" class="logo">
<img src="/logo.png" alt="" />
Добро пожаловать!
</div>
</div>
</div>
<script>
(function(){
const timestamp=new Date().getTime();//miliseconds
const maxInactivePeriod=2;//hours
const cookieName='welcome_window';
let lastVisit;
try{
lastVisit=+(localStorage.getItem('lastVisit')||timestamp);
localStorage.setItem('lastVisit',timestamp);
}catch(e){
lastVisit=timestamp;
console.error(e);
};
if(
lastVisit+maxInactivePeriod*3600*1000>timestamp &&
document.cookie.indexOf(cookieName)>=0
)
return;
const win=document.getElementById('welcome-window');
if(!win)
return;
win.style.display='block';
document.cookie='name='+cookieName+'; path=/;';
})();
</script>