');
private _size = 1000;
private _viewWidth = 0;
@@ -42,6 +43,7 @@ export class ViewCanvas {
private _dragging = false;
private _pinching = false;
private _previousPinchLength = 0;
+
private _placerTag: HTMLElement | null = null;
private _placerRequestTime: number = 0;
@@ -107,10 +109,14 @@ export class ViewCanvas {
public initialize(): void {
this.picker.initialize();
+ this._userInfo.innerText = 'Login';
+ this._userInfo.setAttribute('href', '/login');
+
this._wrapper.append(this._coods);
this._container.append(this._canvas);
this._wrapper.append(this._cursor);
this._wrapper.append(this._container);
+ this._wrapper.append(this._userInfo);
this._wrapper.append(this.picker.element);
document.body.append(this._wrapper);
@@ -325,6 +331,9 @@ export class ViewCanvas {
public setUser(user: IcyNetUser): void {
this._user = user;
+ this._userInfo.innerText = user.username;
+ this._userInfo.classList.add('logged-in');
+ this._userInfo.setAttribute('href', '/logout');
this.picker.setLoggedIn(user);
}
diff --git a/src/client/picker.ts b/src/client/picker.ts
index 6633d8d..3aa6e8b 100644
--- a/src/client/picker.ts
+++ b/src/client/picker.ts
@@ -11,7 +11,6 @@ export class Picker {
private _content = $('');
private _colorsEl = $('
');
private _colorHistoryEl = $('
');
- private _user = $('
');
private _colorInput = $('') as HTMLInputElement;
private _placebtn = $('