28 lines
984 B
TypeScript
28 lines
984 B
TypeScript
export const api_endpoint: string = 'http://api.vdk2ch.ru:5000/';
|
|
//export const api_endpoint: string = 'http://localhost:7141/';
|
|
export var displayed_thread: number;
|
|
export function setDisplayedThread(toset:number){
|
|
displayed_thread = toset;
|
|
};
|
|
|
|
const ALERT_SHOW_TIME = 5000;
|
|
const showAlert = (message:string, color:string) => {
|
|
const alertContainer = document.createElement('div');
|
|
alertContainer.style.zIndex = '100';
|
|
alertContainer.style.position = 'fixed';
|
|
alertContainer.style.left = '50';
|
|
alertContainer.style.top = '0';
|
|
alertContainer.style.right = '0';
|
|
alertContainer.style.padding = '10px 3px';
|
|
alertContainer.style.fontSize = '30px';
|
|
alertContainer.style.textAlign = 'center';
|
|
alertContainer.style.backgroundColor = color;
|
|
alertContainer.style.border = "2px dashed #6CFFDD"
|
|
alertContainer.textContent = message;
|
|
document.body.append(alertContainer);
|
|
setTimeout(() => {
|
|
alertContainer.remove();
|
|
}, ALERT_SHOW_TIME);
|
|
}
|
|
export {showAlert}
|