2019-01-15 19:34:35 +00:00
|
|
|
function hrefToFrame(link) {
|
2019-01-15 11:53:10 +00:00
|
|
|
top.frames['gameframe'].location = link
|
2021-03-10 21:06:07 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Отображаем уведомление на 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);
|
2019-01-15 11:52:15 +00:00
|
|
|
}
|