JSFiddle - React, Tailwind, and code Playground
by Kocsten
CSS
.zornet_ru_lidsam {
display:none;
position: fixed;
bottom: 100px;
background: #4784f7;
color: #f8f8fd;
padding: 9px;
border-radius: 4px;
font-family: sans-serif;font-size:14px;
z-index: 9999;
text-align: center;
left: 27%;
right: 27%;
}
JavaScript
module = location.pathname;
$('body').append('<div class="zornet_ru_lidsam"></div>');
push = { call:function(pushInfo,file){
$('.zornet_ru_lidsam').html(pushInfo).fadeIn(500).delay(14000).fadeOut(500);
mp3=new Audio(file);mp3.src=file;mp3.play(); }};
dates = new Date();
sDt = dates.getDate();
sDm = dates.getMonth() +1; if(sDm < 10) {sDm = '0'+sDm}
sDy = dates.getFullYear();
sTh = dates.getHours();
sTm = dates.getMinutes();
activeAll = localStorage[module];
acSound = 'http://zornet.ru/ABVUN/cl3-7.m4a';
if(localStorage[module] == undefined) {
activeAll = '0|'+sDt+'.'+sDm+'.'+sDy+' в '+sTh+':'+sTm+'';
push.call('Добро пожаловать на ZORNET.RU',acSound);
} else {
activeAll = activeAll.split('|');
activeAll[0] = Number(activeAll[0])+Number(1);
activeAll = ''+activeAll[0]+'|'+activeAll[1]+'';
localStorage.setItem(module, ''+activeAll+'');
activeAll = activeAll.split('|');
push.call('Был уже: '+activeAll[0]+' раз.<hr>Последний раз '+activeAll[1]+'',acSound);
}
activeAll = ''+activeAll[0]+'|'+sDt+'.'+sDm+'.'+sDy+' в '+sTh+':'+sTm+'';
localStorage.setItem(module, ''+activeAll+'');