Telegram Web K with changes to work inside I2P
https://web.telegram.i2p/
You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
49 lines
1.5 KiB
49 lines
1.5 KiB
3 years ago
|
import { LangPackKey, i18n } from "../lib/langPack";
|
||
|
|
||
|
export default class LoginPage {
|
||
|
public element: HTMLElement;
|
||
|
public container: HTMLElement;
|
||
|
public imageDiv: HTMLElement;
|
||
|
public inputWrapper: HTMLElement;
|
||
|
public title: HTMLElement;
|
||
|
public subtitle: HTMLParagraphElement;
|
||
|
|
||
|
constructor(options: {
|
||
|
className: string,
|
||
|
withInputWrapper?: boolean,
|
||
|
titleLangKey?: LangPackKey,
|
||
|
subtitleLangKey?: LangPackKey,
|
||
|
}) {
|
||
|
this.element = document.body.querySelector('.' + options.className) as HTMLDivElement;
|
||
|
//this.element = document.createElement('div');
|
||
|
//this.element.className = 'page-' + options.className;
|
||
|
|
||
|
this.container = document.createElement('div');
|
||
|
this.container.className = 'container center-align';
|
||
|
|
||
|
this.imageDiv = document.createElement('div');
|
||
|
this.imageDiv.className = 'auth-image';
|
||
|
|
||
|
this.title = document.createElement('h4');
|
||
|
if(options.titleLangKey) {
|
||
|
this.title.append(i18n(options.titleLangKey));
|
||
|
}
|
||
|
|
||
|
this.subtitle = document.createElement('p');
|
||
|
this.subtitle.className = 'subtitle';
|
||
|
if(options.subtitleLangKey) {
|
||
|
this.subtitle.append(i18n(options.subtitleLangKey));
|
||
|
}
|
||
|
|
||
|
this.container.append(this.imageDiv, this.title, this.subtitle);
|
||
|
|
||
|
if(options.withInputWrapper) {
|
||
|
this.inputWrapper = document.createElement('div');
|
||
|
this.inputWrapper.className = 'input-wrapper';
|
||
|
this.container.append(this.inputWrapper);
|
||
|
}
|
||
|
|
||
|
this.element.append(this.container);
|
||
|
}
|
||
|
}
|