dev #41

Merged
lopar merged 29 commits from dev into master 2021-05-25 15:28:14 +00:00
Showing only changes of commit 9046670081 - Show all commits

View File

@ -1,3 +1,39 @@
function hrefToFrame(link) {
top.frames['gameframe'].location = link
}
/**
* Отображаем уведомление на 5 секунд.
* @top Отступ сверху.
* @right Отступ справа.
* @className Тип уведомления.
* @html Текст уведомления в HTML формате.
*/
function showNotification({top = 0, right = 0, className, html}) {
let notification = document.createElement('div');
notification.style.cssText = `
position: fixed;
z-index: 1000;
padding: 5px;
border: 1px solid black;
font-size: 20px;
background: white;
text-align: center;
`;
if (className === "danger") {
notification.style.cssText += `
background: #b80000;
color: yellow;
`;
}
notification.style.top = top + 'px';
notification.style.right = right + 'px';
notification.innerHTML = html;
document.body.append(notification);
setTimeout(() => notification.remove(), 5000);
}