pwa-auth 3.5.1 → 3.7.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +139 -491
- package/base/export/drawer.d.ts +2 -0
- package/base/export/drawer.d.ts.map +1 -0
- package/base/export/drawer.js +2 -0
- package/base/export/drawer.js.map +1 -0
- package/base/export/icon.d.ts +2 -0
- package/base/export/icon.d.ts.map +1 -0
- package/base/export/icon.js +2 -0
- package/base/export/icon.js.map +1 -0
- package/base/export/login.d.ts +2 -0
- package/base/export/login.d.ts.map +1 -0
- package/base/export/login.js +2 -0
- package/base/export/login.js.map +1 -0
- package/base/export/reset.d.ts +2 -0
- package/base/export/reset.d.ts.map +1 -0
- package/base/export/reset.js +2 -0
- package/base/export/reset.js.map +1 -0
- package/base/export/settings.d.ts +2 -0
- package/base/export/settings.d.ts.map +1 -0
- package/base/export/settings.js +2 -0
- package/base/export/settings.js.map +1 -0
- package/base/firebase/google.d.ts +9 -0
- package/base/firebase/google.d.ts.map +1 -0
- package/base/firebase/google.js +56 -0
- package/base/firebase/google.js.map +1 -0
- package/base/firebase/interface.d.ts.map +1 -1
- package/base/firebase/interface.js +2 -0
- package/base/firebase/interface.js.map +1 -1
- package/base/firebase/message.d.ts.map +1 -1
- package/base/firebase/message.js +1 -0
- package/base/firebase/message.js.map +1 -1
- package/base/webcomponents/css/animation.d.ts +2 -0
- package/base/webcomponents/css/animation.d.ts.map +1 -1
- package/base/webcomponents/css/animation.js +49 -11
- package/base/webcomponents/css/animation.js.map +1 -1
- package/base/webcomponents/drawer/css/drawer.d.ts.map +1 -1
- package/base/webcomponents/drawer/css/drawer.js +11 -55
- package/base/webcomponents/drawer/css/drawer.js.map +1 -1
- package/base/webcomponents/drawer/css/exit.js +1 -1
- package/base/webcomponents/drawer/css/paragraph.d.ts.map +1 -1
- package/base/webcomponents/drawer/css/paragraph.js +10 -3
- package/base/webcomponents/drawer/css/paragraph.js.map +1 -1
- package/base/webcomponents/drawer/drawer.d.ts +25 -0
- package/base/webcomponents/drawer/drawer.d.ts.map +1 -1
- package/base/webcomponents/drawer/drawer.js +276 -20
- package/base/webcomponents/drawer/drawer.js.map +1 -1
- package/base/webcomponents/form/css/button.d.ts.map +1 -1
- package/base/webcomponents/form/css/button.js +53 -15
- package/base/webcomponents/form/css/button.js.map +1 -1
- package/base/webcomponents/form/css/input.d.ts.map +1 -1
- package/base/webcomponents/form/css/input.js +10 -1
- package/base/webcomponents/form/css/input.js.map +1 -1
- package/base/webcomponents/form/css/label.d.ts.map +1 -1
- package/base/webcomponents/form/css/label.js +19 -1
- package/base/webcomponents/form/css/label.js.map +1 -1
- package/base/webcomponents/form/css/list.d.ts.map +1 -1
- package/base/webcomponents/form/css/list.js +2 -1
- package/base/webcomponents/form/css/list.js.map +1 -1
- package/base/webcomponents/form/css/notice.js +3 -3
- package/base/webcomponents/form/css/status.d.ts.map +1 -1
- package/base/webcomponents/form/css/status.js +18 -5
- package/base/webcomponents/form/css/status.js.map +1 -1
- package/base/webcomponents/form/css/toggle.d.ts.map +1 -1
- package/base/webcomponents/form/css/toggle.js +7 -0
- package/base/webcomponents/form/css/toggle.js.map +1 -1
- package/base/webcomponents/form/forgot.d.ts.map +1 -1
- package/base/webcomponents/form/forgot.js +5 -4
- package/base/webcomponents/form/forgot.js.map +1 -1
- package/base/webcomponents/form/google-button.d.ts +3 -0
- package/base/webcomponents/form/google-button.d.ts.map +1 -0
- package/base/webcomponents/form/google-button.js +23 -0
- package/base/webcomponents/form/google-button.js.map +1 -0
- package/base/webcomponents/form/login.d.ts +5 -0
- package/base/webcomponents/form/login.d.ts.map +1 -1
- package/base/webcomponents/form/login.js +41 -1
- package/base/webcomponents/form/login.js.map +1 -1
- package/base/webcomponents/form/signup.d.ts +5 -0
- package/base/webcomponents/form/signup.d.ts.map +1 -1
- package/base/webcomponents/form/signup.js +41 -1
- package/base/webcomponents/form/signup.js.map +1 -1
- package/base/webcomponents/icon/css/icon.d.ts.map +1 -1
- package/base/webcomponents/icon/css/icon.js +9 -0
- package/base/webcomponents/icon/css/icon.js.map +1 -1
- package/base/webcomponents/login/css/auth.d.ts +2 -2
- package/base/webcomponents/login/css/auth.d.ts.map +1 -1
- package/base/webcomponents/login/css/auth.js +12 -13
- package/base/webcomponents/login/css/auth.js.map +1 -1
- package/base/webcomponents/login/page.d.ts +21 -1
- package/base/webcomponents/login/page.d.ts.map +1 -1
- package/base/webcomponents/login/page.js +191 -8
- package/base/webcomponents/login/page.js.map +1 -1
- package/base/webcomponents/settings/css/navigation.js +3 -3
- package/base/webcomponents/settings/input/delete.d.ts.map +1 -1
- package/base/webcomponents/settings/input/delete.js +7 -1
- package/base/webcomponents/settings/input/delete.js.map +1 -1
- package/base/webcomponents/settings/input/uploader.d.ts.map +1 -1
- package/base/webcomponents/settings/input/uploader.js +8 -4
- package/base/webcomponents/settings/input/uploader.js.map +1 -1
- package/base/webcomponents/settings/input/verify.d.ts.map +1 -1
- package/base/webcomponents/settings/input/verify.js +24 -7
- package/base/webcomponents/settings/input/verify.js.map +1 -1
- package/base/webcomponents/settings/settings.d.ts +19 -1
- package/base/webcomponents/settings/settings.d.ts.map +1 -1
- package/base/webcomponents/settings/settings.js +177 -12
- package/base/webcomponents/settings/settings.js.map +1 -1
- package/docs/drawer-slide.md +206 -0
- package/docs/sliders.md +73 -0
- package/package.json +49 -10
- package/source/pwa-auth.js +510 -297
- package/source/pwa-styles.css +0 -7
- package/firebase.md +0 -107
- package/intro.md +0 -19
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"verify.js","sourceRoot":"","sources":["../../../../typescript/webcomponents/settings/input/verify.ts"],"names":[],"mappings":";;;;;;;;;AAAA,OAAO,EAAkB,UAAU,EAAE,GAAG,EAAE,IAAI,EAAE,MAAM,KAAK,CAAC;AAC5D,OAAO,EAAE,KAAK,EAAE,MAAM,mBAAmB,CAAC;AAC1C,OAAO,EAAE,OAAO,EAAE,MAAM,aAAa,CAAC;AAEtC,OAAO,KA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C,aAAa,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC;QACjC,IAAI,CAAC,KAAK,GAAG,CAAC,CAAC;QACf,IAAI,CAAC,QAAQ,GAAG,CAAC,CAAC;IACpB,CAAC;IAEO,WAAW;QAEjB,MAAM,CAAC,aAAa,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC;QAEjC,IAAI,CAAC,KAAK,GAAG,MAAM,CAAC,WAAW,CAAC,GAAG,EAAE;YAEnC,IAAI,IAAI,CAAC,QAAQ,IAAI,CAAC,EAAE,CAAC;gBACvB,IAAI,CAAC,QAAQ,GAAG,CAAC,CAAC;gBAClB,MAAM,CAAC,aAAa,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC;gBACjC,IAAI,CAAC,KAAK,GAAG,CAAC,CAAC;gBACf,OAAO;YACT,CAAC;YAED,IAAI,CAAC,QAAQ,IAAI,CAAC,CAAC;QAErB,CAAC,EAAE,IAAI,CAAC,CAAC;IAEX,CAAC;CAEF;AAvQkB;IAAhB,KAAK,EAAE;;0CAAuB;AACd;IAAhB,KAAK,EAAE;;6CAA0B;AACjB;IAAhB,KAAK,EAAE;;0CAAoB;AACX;IAAhB,KAAK,EAAE;;2CAAqB;AACZ;IAAhB,KAAK,EAAE;;yCAAmB;AACV;IAAhB,KAAK,EAAE;;yCAAsB;AACb;IAAhB,KAAK,EAAE;;6CAAsB;AAmQhC,cAAc,CAAC,MAAM,CAAC,cAAc,EAAE,WAAW,CAAC,CAAC"}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { CSSResultArray, LitElement } from 'lit';
|
|
1
|
+
import { CSSResultArray, LitElement, PropertyValues } from 'lit';
|
|
2
2
|
import { AppState } from '../../store.js';
|
|
3
3
|
import './input/uploader.js';
|
|
4
4
|
import './input/name.js';
|
|
@@ -44,6 +44,13 @@ export declare class UserSettings extends UserSettings_base {
|
|
|
44
44
|
private name;
|
|
45
45
|
private email;
|
|
46
46
|
private login;
|
|
47
|
+
private clipHeight;
|
|
48
|
+
private sheetShift;
|
|
49
|
+
private rollMotion;
|
|
50
|
+
private booted;
|
|
51
|
+
private heldHeight;
|
|
52
|
+
private columnWidth;
|
|
53
|
+
private columnObserver;
|
|
47
54
|
constructor();
|
|
48
55
|
connectedCallback(): void;
|
|
49
56
|
disconnectedCallback(): void;
|
|
@@ -52,6 +59,17 @@ export declare class UserSettings extends UserSettings_base {
|
|
|
52
59
|
stateChanged(state: AppState): void;
|
|
53
60
|
static get styles(): CSSResultArray;
|
|
54
61
|
private openTab;
|
|
62
|
+
protected willUpdate(changed: PropertyValues): void;
|
|
63
|
+
protected updated(changed: PropertyValues): void;
|
|
64
|
+
private watchColumn;
|
|
65
|
+
private clip;
|
|
66
|
+
private sheet;
|
|
67
|
+
private reduced;
|
|
68
|
+
private rest;
|
|
69
|
+
private clipStyle;
|
|
70
|
+
private sheetStyle;
|
|
71
|
+
private rollBetween;
|
|
72
|
+
private onClipEnd;
|
|
55
73
|
protected render(): import("lit-html").TemplateResult<1>;
|
|
56
74
|
}
|
|
57
75
|
declare global {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"settings.d.ts","sourceRoot":"","sources":["../../../typescript/webcomponents/settings/settings.ts"],"names":[],"mappings":"AAAA,OAAO,EAAO,cAAc,EAAQ,UAAU,EAAE,
|
|
1
|
+
{"version":3,"file":"settings.d.ts","sourceRoot":"","sources":["../../../typescript/webcomponents/settings/settings.ts"],"names":[],"mappings":"AAAA,OAAO,EAAO,cAAc,EAAQ,UAAU,EAAE,cAAc,EAAE,MAAM,KAAK,CAAC;AAI5E,OAAO,EAAS,QAAQ,EAAE,MAAqB,gBAAgB,CAAC;AAGhE,OAAO,qBAAqB,CAAC;AAC7B,OAAO,iBAAiB,CAAC;AACzB,OAAO,kBAAkB,CAAC;AAC1B,OAAO,qBAAqB,CAAC;AAC7B,OAAO,mBAAmB,CAAC;AAC3B,OAAO,mBAAmB,CAAC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAM3B,qBACa,YAAa,SAAQ,iBAA0B;IAGV,KAAK,SAAM;IAElD,OAAO,CAAC,YAAY,CAAM;IAC1B,OAAO,CAAC,IAAI,CAAM;IAClB,OAAO,CAAC,KAAK,CAAM;IACnB,OAAO,CAAC,KAAK,CAAS;IAGtB,OAAO,CAAC,UAAU,CAAU;IAG5B,OAAO,CAAC,UAAU,CAAU;IAG5B,OAAO,CAAC,UAAU,CAAS;IAEpC,OAAO,CAAC,MAAM,CAAS;IACvB,OAAO,CAAC,UAAU,CAAuB;IACzC,OAAO,CAAC,WAAW,CAAK;IACxB,OAAO,CAAC,cAAc,CAA+B;;IAK5C,iBAAiB,IAAI,IAAI;IAOzB,oBAAoB,IAAI,IAAI;IAOrC,OAAO,CAAC,QAAQ,CAEf;IAGD,OAAO,CAAC,QAAQ;IAYhB,YAAY,CAAC,KAAK,EAAE,QAAQ;IAO5B,MAAM,KAAK,MAAM,IAAG,cAAc,CA6D5B;IAEN,OAAO,CAAC,OAAO;IAIf,SAAS,CAAC,UAAU,CAAC,OAAO,EAAE,cAAc,GAAG,IAAI;IAWnD,SAAS,CAAC,OAAO,CAAC,OAAO,EAAE,cAAc,GAAG,IAAI;IAehD,OAAO,CAAC,WAAW;IAiBnB,OAAO,CAAC,IAAI;IAIZ,OAAO,CAAC,KAAK;IAIb,OAAO,CAAC,OAAO;IAKf,OAAO,CAAC,IAAI;IAMZ,OAAO,CAAC,SAAS;IAWjB,OAAO,CAAC,UAAU;IASlB,OAAO,CAAC,WAAW;IA2BnB,OAAO,CAAC,SAAS,CAKf;IAEF,SAAS,CAAC,MAAM;CAuJjB;AAED,OAAO,CAAC,MAAM,CAAC;IACb,UAAU,qBAAqB;QAC3B,eAAe,EAAE,YAAY,CAAC;KACjC;CACF"}
|
|
@@ -9,6 +9,7 @@ var __metadata = (this && this.__metadata) || function (k, v) {
|
|
|
9
9
|
};
|
|
10
10
|
import { css, html, LitElement } from 'lit';
|
|
11
11
|
import { state, customElement, property } from 'lit/decorators.js';
|
|
12
|
+
import { styleMap } from 'lit/directives/style-map.js';
|
|
12
13
|
import { connect } from 'pwa-helpers/connect-mixin.js';
|
|
13
14
|
import { store } from '../../store.js';
|
|
14
15
|
import { navigateAuth } from '../../redux/frontend.js';
|
|
@@ -20,7 +21,6 @@ import './input/password.js';
|
|
|
20
21
|
import './input/delete.js';
|
|
21
22
|
import './input/verify.js';
|
|
22
23
|
import { listStyle } from '../form/css/list.js';
|
|
23
|
-
import { animation } from '../css/animation.js';
|
|
24
24
|
import { tapStyle } from '../css/tap.js';
|
|
25
25
|
import { applyFirebaseConfig } from '../../firebase/attribute.js';
|
|
26
26
|
import { accountTitle } from '../form/letters.js';
|
|
@@ -32,9 +32,25 @@ let UserSettings = class UserSettings extends connect(store)(LitElement) {
|
|
|
32
32
|
this.name = '';
|
|
33
33
|
this.email = '';
|
|
34
34
|
this.login = false;
|
|
35
|
+
this.clipHeight = 'auto';
|
|
36
|
+
this.sheetShift = 'none';
|
|
37
|
+
this.rollMotion = false;
|
|
38
|
+
this.booted = false;
|
|
39
|
+
this.heldHeight = null;
|
|
40
|
+
this.columnWidth = 0;
|
|
41
|
+
this.columnObserver = null;
|
|
35
42
|
this.onSubmit = (event) => {
|
|
36
43
|
event.preventDefault();
|
|
37
44
|
};
|
|
45
|
+
this.onClipEnd = (event) => {
|
|
46
|
+
if (!(event instanceof TransitionEvent))
|
|
47
|
+
return;
|
|
48
|
+
if (event.target !== event.currentTarget)
|
|
49
|
+
return;
|
|
50
|
+
if (event.propertyName !== 'max-height')
|
|
51
|
+
return;
|
|
52
|
+
this.rest();
|
|
53
|
+
};
|
|
38
54
|
}
|
|
39
55
|
connectedCallback() {
|
|
40
56
|
applyFirebaseConfig(this);
|
|
@@ -43,6 +59,8 @@ let UserSettings = class UserSettings extends connect(store)(LitElement) {
|
|
|
43
59
|
}
|
|
44
60
|
disconnectedCallback() {
|
|
45
61
|
this.removeEventListener('submit', this.onSubmit);
|
|
62
|
+
this.columnObserver?.disconnect();
|
|
63
|
+
this.columnObserver = null;
|
|
46
64
|
super.disconnectedCallback();
|
|
47
65
|
}
|
|
48
66
|
onTabKey(event) {
|
|
@@ -67,13 +85,37 @@ let UserSettings = class UserSettings extends connect(store)(LitElement) {
|
|
|
67
85
|
return [
|
|
68
86
|
navigation,
|
|
69
87
|
listStyle,
|
|
70
|
-
animation,
|
|
71
88
|
tapStyle,
|
|
72
89
|
css `
|
|
73
90
|
|
|
74
91
|
:host {
|
|
75
|
-
display:
|
|
76
|
-
|
|
92
|
+
display: block;
|
|
93
|
+
box-sizing: border-box;
|
|
94
|
+
width: 100%;
|
|
95
|
+
min-width: 0; /* Required - shrink inside a flex or grid track */
|
|
96
|
+
max-width: 100%;
|
|
97
|
+
/* Required - this component's clock. It is not the drawer or the page login. */
|
|
98
|
+
--pwa_slide: 2s;
|
|
99
|
+
background-color: var(--pwa_background, var(--pwa_settings_background_color, #fff));
|
|
100
|
+
}
|
|
101
|
+
|
|
102
|
+
@media (prefers-reduced-motion: reduce) {
|
|
103
|
+
:host { --pwa_slide: 0s; }
|
|
104
|
+
}
|
|
105
|
+
|
|
106
|
+
/* Required - this settings roll only. Block, so the sheet is not stretched. */
|
|
107
|
+
.settings-clip {
|
|
108
|
+
display: block;
|
|
109
|
+
overflow: hidden;
|
|
110
|
+
min-height: 0;
|
|
111
|
+
}
|
|
112
|
+
|
|
113
|
+
.settings-sheet {
|
|
114
|
+
display: block;
|
|
115
|
+
height: auto;
|
|
116
|
+
width: 100%;
|
|
117
|
+
box-sizing: border-box;
|
|
118
|
+
background-color: var(--pwa_background, var(--pwa_settings_background_color, #fff));
|
|
77
119
|
}
|
|
78
120
|
|
|
79
121
|
form {
|
|
@@ -86,7 +128,7 @@ let UserSettings = class UserSettings extends connect(store)(LitElement) {
|
|
|
86
128
|
|
|
87
129
|
.signed-out {
|
|
88
130
|
margin: 0;
|
|
89
|
-
padding: 20px
|
|
131
|
+
padding: 20px var(--pwa_inset, 0px);
|
|
90
132
|
text-align: center;
|
|
91
133
|
color: var(--pwa_label_text_color, #1c2430);
|
|
92
134
|
font-size: 0.95rem;
|
|
@@ -106,6 +148,114 @@ let UserSettings = class UserSettings extends connect(store)(LitElement) {
|
|
|
106
148
|
openTab(name) {
|
|
107
149
|
store.dispatch(navigateAuth(name));
|
|
108
150
|
}
|
|
151
|
+
willUpdate(changed) {
|
|
152
|
+
if (!this.booted || !this.login || changed.has('login'))
|
|
153
|
+
return;
|
|
154
|
+
if (!changed.has('profileTopic'))
|
|
155
|
+
return;
|
|
156
|
+
const clip = this.clip();
|
|
157
|
+
if (!clip)
|
|
158
|
+
return;
|
|
159
|
+
this.heldHeight = Math.ceil(clip.getBoundingClientRect().height);
|
|
160
|
+
this.rollMotion = false;
|
|
161
|
+
this.clipHeight = `${this.heldHeight}px`;
|
|
162
|
+
this.sheetShift = 'translate3d(0, 0, 0)';
|
|
163
|
+
}
|
|
164
|
+
updated(changed) {
|
|
165
|
+
const boot = !this.booted;
|
|
166
|
+
this.booted = true;
|
|
167
|
+
if (boot)
|
|
168
|
+
this.watchColumn();
|
|
169
|
+
if (boot || !changed.has('profileTopic') || !this.login || changed.has('login'))
|
|
170
|
+
return;
|
|
171
|
+
const clip = this.clip();
|
|
172
|
+
const sheet = this.sheet();
|
|
173
|
+
if (!clip || !sheet || this.heldHeight == null)
|
|
174
|
+
return;
|
|
175
|
+
const from = this.heldHeight;
|
|
176
|
+
this.heldHeight = null;
|
|
177
|
+
const to = Math.ceil(sheet.getBoundingClientRect().height);
|
|
178
|
+
if (Math.abs(to - from) > 1)
|
|
179
|
+
this.rollBetween(clip, sheet, from, to, to);
|
|
180
|
+
else
|
|
181
|
+
this.rest();
|
|
182
|
+
}
|
|
183
|
+
watchColumn() {
|
|
184
|
+
if (typeof ResizeObserver === 'undefined')
|
|
185
|
+
return;
|
|
186
|
+
this.columnObserver = new ResizeObserver(() => {
|
|
187
|
+
const width = Math.round(this.getBoundingClientRect().width);
|
|
188
|
+
if (!width || width === this.columnWidth)
|
|
189
|
+
return;
|
|
190
|
+
this.columnWidth = width;
|
|
191
|
+
if (!this.rollMotion)
|
|
192
|
+
return;
|
|
193
|
+
const clip = this.clip();
|
|
194
|
+
const sheet = this.sheet();
|
|
195
|
+
if (!clip || !sheet)
|
|
196
|
+
return;
|
|
197
|
+
const from = Math.ceil(clip.getBoundingClientRect().height);
|
|
198
|
+
const sheetH = Math.ceil(sheet.getBoundingClientRect().height);
|
|
199
|
+
this.rollBetween(clip, sheet, from, sheetH, sheetH);
|
|
200
|
+
});
|
|
201
|
+
this.columnObserver.observe(this);
|
|
202
|
+
}
|
|
203
|
+
clip() {
|
|
204
|
+
return this.shadowRoot?.querySelector('.settings-clip') ?? null;
|
|
205
|
+
}
|
|
206
|
+
sheet() {
|
|
207
|
+
return this.shadowRoot?.querySelector('.settings-sheet') ?? null;
|
|
208
|
+
}
|
|
209
|
+
reduced() {
|
|
210
|
+
return window.matchMedia('(prefers-reduced-motion: reduce)').matches;
|
|
211
|
+
}
|
|
212
|
+
rest() {
|
|
213
|
+
this.rollMotion = false;
|
|
214
|
+
this.clipHeight = 'auto';
|
|
215
|
+
this.sheetShift = 'none';
|
|
216
|
+
}
|
|
217
|
+
clipStyle() {
|
|
218
|
+
const travel = this.rollMotion && !this.reduced();
|
|
219
|
+
return {
|
|
220
|
+
height: this.clipHeight,
|
|
221
|
+
maxHeight: this.clipHeight === 'auto' ? 'none' : this.clipHeight,
|
|
222
|
+
transition: travel
|
|
223
|
+
? 'height var(--pwa_slide, 2s) ease-in-out, max-height var(--pwa_slide, 2s) ease-in-out'
|
|
224
|
+
: 'none',
|
|
225
|
+
};
|
|
226
|
+
}
|
|
227
|
+
sheetStyle() {
|
|
228
|
+
const travel = this.rollMotion && !this.reduced();
|
|
229
|
+
return {
|
|
230
|
+
transform: this.sheetShift,
|
|
231
|
+
transition: travel ? 'transform var(--pwa_slide, 2s) ease-in-out' : 'none',
|
|
232
|
+
};
|
|
233
|
+
}
|
|
234
|
+
rollBetween(clip, sheet, from, to, sheetHeight) {
|
|
235
|
+
const start = from - sheetHeight;
|
|
236
|
+
const end = to - sheetHeight;
|
|
237
|
+
const shift = (px) => `translate3d(0, ${px}px, 0)`;
|
|
238
|
+
if (this.reduced() || Math.abs(to - from) <= 1) {
|
|
239
|
+
this.rest();
|
|
240
|
+
return;
|
|
241
|
+
}
|
|
242
|
+
const travel = 'height var(--pwa_slide, 2s) ease-in-out, max-height var(--pwa_slide, 2s) ease-in-out';
|
|
243
|
+
const move = 'transform var(--pwa_slide, 2s) ease-in-out';
|
|
244
|
+
clip.style.transition = 'none';
|
|
245
|
+
sheet.style.transition = 'none';
|
|
246
|
+
clip.style.height = `${Math.max(0, from)}px`;
|
|
247
|
+
clip.style.maxHeight = `${Math.max(0, from)}px`;
|
|
248
|
+
sheet.style.transform = shift(start);
|
|
249
|
+
void clip.offsetHeight;
|
|
250
|
+
clip.style.transition = travel;
|
|
251
|
+
sheet.style.transition = move;
|
|
252
|
+
clip.style.height = `${Math.max(0, to)}px`;
|
|
253
|
+
clip.style.maxHeight = `${Math.max(0, to)}px`;
|
|
254
|
+
sheet.style.transform = shift(end);
|
|
255
|
+
this.rollMotion = true;
|
|
256
|
+
this.clipHeight = `${Math.max(0, to)}px`;
|
|
257
|
+
this.sheetShift = shift(end);
|
|
258
|
+
}
|
|
109
259
|
render() {
|
|
110
260
|
if (!this.login) {
|
|
111
261
|
return html `
|
|
@@ -173,8 +323,11 @@ let UserSettings = class UserSettings extends connect(store)(LitElement) {
|
|
|
173
323
|
</nav>
|
|
174
324
|
|
|
175
325
|
|
|
176
|
-
<div
|
|
177
|
-
|
|
326
|
+
<div
|
|
327
|
+
class="settings-clip"
|
|
328
|
+
style=${styleMap(this.clipStyle())}
|
|
329
|
+
@transitionend=${this.onClipEnd}>
|
|
330
|
+
<div class="settings-sheet" style=${styleMap(this.sheetStyle())}>
|
|
178
331
|
|
|
179
332
|
|
|
180
333
|
<!-- Page 1: Profile -->
|
|
@@ -183,7 +336,7 @@ let UserSettings = class UserSettings extends connect(store)(LitElement) {
|
|
|
183
336
|
role="tabpanel"
|
|
184
337
|
aria-hidden="${this.profileTopic === 'profile' ? 'false' : 'true'}"
|
|
185
338
|
?inert="${this.profileTopic !== 'profile'}"
|
|
186
|
-
|
|
339
|
+
?hidden="${this.profileTopic !== 'profile'}">
|
|
187
340
|
|
|
188
341
|
<!-- Display Username -->
|
|
189
342
|
<h2>${title}</h2>
|
|
@@ -199,7 +352,7 @@ let UserSettings = class UserSettings extends connect(store)(LitElement) {
|
|
|
199
352
|
role="tabpanel"
|
|
200
353
|
aria-hidden="${this.profileTopic === 'verification' ? 'false' : 'true'}"
|
|
201
354
|
?inert="${this.profileTopic !== 'verification'}"
|
|
202
|
-
|
|
355
|
+
?hidden="${this.profileTopic !== 'verification'}">
|
|
203
356
|
|
|
204
357
|
<!-- Page Title -->
|
|
205
358
|
<h2>Contact Information</h2>
|
|
@@ -221,7 +374,7 @@ let UserSettings = class UserSettings extends connect(store)(LitElement) {
|
|
|
221
374
|
role="tabpanel"
|
|
222
375
|
aria-hidden="${this.profileTopic === 'password' ? 'false' : 'true'}"
|
|
223
376
|
?inert="${this.profileTopic !== 'password'}"
|
|
224
|
-
|
|
377
|
+
?hidden="${this.profileTopic !== 'password'}">
|
|
225
378
|
|
|
226
379
|
<!-- Page Title -->
|
|
227
380
|
<h2>Password</h2>
|
|
@@ -237,7 +390,7 @@ let UserSettings = class UserSettings extends connect(store)(LitElement) {
|
|
|
237
390
|
role="tabpanel"
|
|
238
391
|
aria-hidden="${this.profileTopic === 'delete' ? 'false' : 'true'}"
|
|
239
392
|
?inert="${this.profileTopic !== 'delete'}"
|
|
240
|
-
|
|
393
|
+
?hidden="${this.profileTopic !== 'delete'}">
|
|
241
394
|
|
|
242
395
|
<!-- Page Title -->
|
|
243
396
|
<h2>Delete Account</h2>
|
|
@@ -247,7 +400,7 @@ let UserSettings = class UserSettings extends connect(store)(LitElement) {
|
|
|
247
400
|
|
|
248
401
|
</section>
|
|
249
402
|
|
|
250
|
-
|
|
403
|
+
</div>
|
|
251
404
|
</div>
|
|
252
405
|
|
|
253
406
|
`;
|
|
@@ -273,6 +426,18 @@ __decorate([
|
|
|
273
426
|
state(),
|
|
274
427
|
__metadata("design:type", Object)
|
|
275
428
|
], UserSettings.prototype, "login", void 0);
|
|
429
|
+
__decorate([
|
|
430
|
+
state(),
|
|
431
|
+
__metadata("design:type", Object)
|
|
432
|
+
], UserSettings.prototype, "clipHeight", void 0);
|
|
433
|
+
__decorate([
|
|
434
|
+
state(),
|
|
435
|
+
__metadata("design:type", Object)
|
|
436
|
+
], UserSettings.prototype, "sheetShift", void 0);
|
|
437
|
+
__decorate([
|
|
438
|
+
state(),
|
|
439
|
+
__metadata("design:type", Object)
|
|
440
|
+
], UserSettings.prototype, "rollMotion", void 0);
|
|
276
441
|
UserSettings = __decorate([
|
|
277
442
|
customElement('user-settings'),
|
|
278
443
|
__metadata("design:paramtypes", [])
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"settings.js","sourceRoot":"","sources":["../../../typescript/webcomponents/settings/settings.ts"],"names":[],"mappings":";;;;;;;;;AAAA,OAAO,EAAE,GAAG,EAAkB,IAAI,EAAE,UAAU,
|
|
1
|
+
{"version":3,"file":"settings.js","sourceRoot":"","sources":["../../../typescript/webcomponents/settings/settings.ts"],"names":[],"mappings":";;;;;;;;;AAAA,OAAO,EAAE,GAAG,EAAkB,IAAI,EAAE,UAAU,EAAkB,MAAM,KAAK,CAAC;AAC5E,OAAO,EAAE,KAAK,EAAE,aAAa,EAAE,QAAQ,EAAE,MAAgB,mBAAmB,CAAC;AAC7E,OAAO,EAAE,QAAQ,EAAE,MAA4B,6BAA6B,CAAC;AAC7E,OAAO,EAAE,OAAO,EAAE,MAA6B,8BAA8B,CAAC;AAC9E,OAAO,EAAE,KAAK,EAAY,MAAqB,gBAAgB,CAAC;AAChE,OAAO,EAAE,YAAY,EAAE,MAAwB,yBAAyB,CAAC;AACzE,OAAO,EAAE,UAAU,E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7B,IAAI,CAAC,YAAY,KAAK,QAAQ;;;;;;;;;;;;;KAahD,CAAA;IACH,CAAC;CAEF,CAAA;AA5YiD;IAA/C,QAAQ,CAAC,EAAC,IAAI,EAAE,MAAM,EAAE,OAAO,EAAE,IAAI,EAAC,CAAC;;2CAAmB;AAE1C;IAAhB,KAAK,EAAE;;kDAA2B;AAClB;IAAhB,KAAK,EAAE;;0CAAmB;AACV;IAAhB,KAAK,EAAE;;2CAAoB;AACX;IAAhB,KAAK,EAAE;;2CAAuB;AAGd;IAAhB,KAAK,EAAE;;gDAA6B;AAGpB;IAAhB,KAAK,EAAE;;gDAA6B;AAGpB;IAAhB,KAAK,EAAE;;gDAA4B;AAjBzB,YAAY;IADxB,aAAa,CAAC,eAAe,CAAC;;GAClB,YAAY,CA+YxB"}
|
|
@@ -0,0 +1,206 @@
|
|
|
1
|
+
# Drawer login and sign-up slide
|
|
2
|
+
|
|
3
|
+
The drawer unrolls downward and its buttons ride the bottom edge. Nothing animates when the page first loads. Login and sign-up then trade places in the same space.
|
|
4
|
+
|
|
5
|
+
The controls sit on the host edge. `--pwa_inset` defaults to `0`. `--pwa_max_width` defaults to `400px`: the form column fills a narrow host, then centers at that cap. Signed-in drawer links use that same column. The drawer header stays full width. The host is `display: block`, `width: 100%`, `min-width: 0`, so it follows a flex or grid track. A page sets either variable on `user-drawer`, `user-login`, `user-settings`, and `email-reset`. Do not set `--pwa_max_width` on `:host` inside the component; that would beat the page.
|
|
6
|
+
|
|
7
|
+
The form swap is a transform inside `.inner`. The drawer rolls open and closed on its own: `.drawer-clip` eases `height` and `max-height` between `0px` and the measured content height, and `section.userDrawer` translates so its bottom stays on the clip's bottom. Both use this component's `--pwa_slide` (`2s`, `ease-in-out`). The page login and the settings tabs roll the same way, each inside its own file. There is no shared roll module.
|
|
8
|
+
|
|
9
|
+
## How the form swap works
|
|
10
|
+
|
|
11
|
+
`form-login` and `form-signup` share one grid cell. `.inner` is a grid with `grid-template-areas: 'pages'`. Both forms have `grid-area: pages`, so they occupy the same cell. `.inner` is `overflow: hidden`, which clips anything that leaves that cell.
|
|
12
|
+
|
|
13
|
+
The open form (class `opened`) is `position: relative` and `transform: translate3d(0, 0, 0)`. It is the only one in flow, so it sets the panel height.
|
|
14
|
+
|
|
15
|
+
The closed form (class `closed`) is `position: absolute` at `top: 0; left: 0`, with `width: 100%` and `height: auto`. Absolute removes it from the row, so it does not stretch the panel. It is translated `translate3d(0, -100%, 0)`. A percentage in `translate` is a percentage of the element itself, so `-100%` moves it up by its own height, just outside the clip.
|
|
16
|
+
|
|
17
|
+
The transform runs for `var(--pwa_slide, 2s)` with `ease-in-out` in both directions. The arriving form moves from `-100%` to `0`. The leaving form moves from `0` to `-100%`. Both travel upward through the same cell. `opened` is `z-index: 3` and `closed` is `z-index: 2`, so the arriving form paints on top.
|
|
18
|
+
|
|
19
|
+
The leaving form is hidden when that transform ends. `.content` sets `transition: transform var(--pwa_slide, 2s) ease-in-out, visibility 0s linear var(--pwa_slide, 2s)`. Visibility duration is `0s` and its delay is the slide, so visibility snaps to `hidden` at the same moment the transform finishes. `.opened` overrides that with `visibility 0s linear 0s`, so the arriving form is shown immediately. `pointer-events: none` and the `inert` attribute are separate from the paint. `inert` keeps the off-screen form out of the tab order.
|
|
20
|
+
|
|
21
|
+
`prefers-reduced-motion: reduce` sets `--pwa_slide` to `0s` on that component's `:host`. The swap is instant, and the visibility wait does not linger.
|
|
22
|
+
|
|
23
|
+
The form transition is off until `.inner` also has class `motion`. The first render binds `opened` and `closed` with `classMap`, and `.content` has `transition: none`. After that paint, `motion` is added on that component's `.inner` only. A later change of those classes is what runs the swap. The closed form does not slide into place at load.
|
|
24
|
+
|
|
25
|
+
### What toggles it
|
|
26
|
+
|
|
27
|
+
The buttons are `part="switch"`.
|
|
28
|
+
|
|
29
|
+
- `form-login` label: `create a new account`. File: `typescript/webcomponents/form/login.ts`.
|
|
30
|
+
- `form-signup` label: `login with existing email`. File: `typescript/webcomponents/form/signup.ts`.
|
|
31
|
+
|
|
32
|
+
Each `change()` dispatches `universalToggle(this.source)`. Inside the drawer, `source` is `"drawer"`. `universalToggle` in `typescript/redux/frontend.ts` flips `frontend.registerOne`.
|
|
33
|
+
|
|
34
|
+
`UserDrawer.stateChanged` copies `registerOne` onto `this.signup`. The render in `typescript/webcomponents/drawer/drawer.ts` then sets the classes:
|
|
35
|
+
|
|
36
|
+
- `form-login` is `opened` when `this.signup === this.subscribe`, otherwise `closed`.
|
|
37
|
+
- `form-signup` is `opened` when `!this.signup === this.subscribe`, otherwise `closed`.
|
|
38
|
+
|
|
39
|
+
`subscribe` is the boolean attribute on `user-drawer`. It flips which form is open for a given `registerOne`. The closed form also gets `inert`.
|
|
40
|
+
|
|
41
|
+
These do not run the form swap:
|
|
42
|
+
|
|
43
|
+
- Attribute `drawer`, class `out` / `in` on `.userDrawer`, and attribute `sliding` open and close the shell. See below.
|
|
44
|
+
- Classes `spec-in` and `spec-out` follow the open flag. They do not transform.
|
|
45
|
+
- Attribute `on` on `.spec` is `display`. It shows the logged-out block. It is not a slide.
|
|
46
|
+
|
|
47
|
+
## The roll
|
|
48
|
+
|
|
49
|
+
What you see: the drawer's bottom edge moves down on open and up on close. The last control stays on that edge, like the roller of a scroll. The title and the top of the form come into view from above the clip, and leave the same way. The page heading does not move.
|
|
50
|
+
|
|
51
|
+
Two boxes, one clock, and they belong to one component.
|
|
52
|
+
|
|
53
|
+
```
|
|
54
|
+
clip .drawer-clip overflow hidden, height and max-height ease
|
|
55
|
+
sheet section.userDrawer translateY eases, holds header + forms
|
|
56
|
+
```
|
|
57
|
+
|
|
58
|
+
`.wrapper` starts under the header. Rolling only `.inner` would leave the title stuck while the form rode the edge. The sheet is the whole `section.userDrawer`.
|
|
59
|
+
|
|
60
|
+
The same picture, with different elements, lives in the other two components. Nothing is shared.
|
|
61
|
+
|
|
62
|
+
| Component | Clip | Sheet | Clock |
|
|
63
|
+
|---|---|---|---|
|
|
64
|
+
| `user-drawer` | `.drawer-clip` | `section.userDrawer` | `:host` `--pwa_slide` from `animation.ts` |
|
|
65
|
+
| `user-login` | `.login-clip` | `section.service` | that host's own `--pwa_slide` |
|
|
66
|
+
| `user-settings` | `.settings-clip` | `.settings-sheet` | that host's own `--pwa_slide` in `settings.ts` |
|
|
67
|
+
|
|
68
|
+
`--pwa_slide` (`2s`, `ease-in-out`) is a custom property on that component's `:host`. It inherits into that shadow tree and stops there. A sibling `user-login` does not see the drawer's variable, classes, or events. The clip is `display: block`. A grid clip would stretch the sheet to the clip's height and the bottom would no longer be the content's bottom.
|
|
69
|
+
|
|
70
|
+
### No shared roll
|
|
71
|
+
|
|
72
|
+
`typescript/webcomponents/css/roll.ts` is gone. Each component keeps its own `rollBetween`, its own clip and sheet class names, and its own `transitionend` listener. The listener ignores any event whose target is not the clip itself, so a form transform inside the sheet cannot finish another component's roll, or even this one early.
|
|
73
|
+
|
|
74
|
+
A shared `.roll` class, a shared `:host { transition: height, max-height }`, or one helper that wrote those inline styles was enough to ease a component that had not been asked to move. The drawer shell no longer transitions `height`, `max-height`, or `transform`. `drawerShell` only holds the closed backstop: `max-height: 0`, `visibility: hidden`, `pointer-events: none`, with no transition. `sliding` lifts that backstop. The motion itself is the style binding below.
|
|
75
|
+
|
|
76
|
+
### Lit bindings, and no animation at boot
|
|
77
|
+
|
|
78
|
+
The clip and the sheet read their box from the template. `styleMap` writes `height`, `max-height`, `transform`, and `transition` from component state. `classMap` writes `opened` and `closed` on the forms.
|
|
79
|
+
|
|
80
|
+
The first render binds the resting state and `transition: none`:
|
|
81
|
+
|
|
82
|
+
- Drawer shut: clip `0px`, sheet `translate3d(0, -100%, 0)`. `.inner` has no `motion` class, so the forms do not transition either.
|
|
83
|
+
- Page login: clip `auto`, sheet `none`. The open form is `opened`. The other is `closed` and already at `-100%`.
|
|
84
|
+
- Settings: the signed-out line, or the active tab at `auto`, with the sheet at `none`. Inactive panels are `hidden`. They are not `closed`.
|
|
85
|
+
|
|
86
|
+
That paint is static. `motion` is reflected only after it, and the roll's `transition` string is written only inside `rollBetween`, which runs from a later update (the drawer attribute, `registerOne` / `registerTwo`, or a settings tab). Load does not play an open-to-closed ease.
|
|
87
|
+
|
|
88
|
+
`rollBetween` then eases. It locks the start px with `transition: none`, reads `offsetHeight` so the next change has a from-value, and writes the end px with `transition` set to `var(--pwa_slide, 2s) ease-in-out`. `height` and `max-height` are the same px, because `max-height` only caps and cannot hold a shorter sheet open.
|
|
89
|
+
|
|
90
|
+
### Lockstep at progress p
|
|
91
|
+
|
|
92
|
+
`p` runs 0 → 1 with `ease-in-out`. `H` is the sheet's height in px. Open from a closed drawer:
|
|
93
|
+
|
|
94
|
+
- clip height = `p * H`
|
|
95
|
+
- sheet `translateY` = `(p - 1) * H` (start `-H`, which is `-100%`, end `0`)
|
|
96
|
+
- sheet bottom = clip top + translateY + H = clip top + `p * H` = clip bottom
|
|
97
|
+
|
|
98
|
+
Close swaps the ends: translateY runs `0` → `-H` while the clip runs `H` → `0`. The same identity holds.
|
|
99
|
+
|
|
100
|
+
A height change that does not start at 0 (a taller form, a settings tab) uses the sheet's real height `S` and clip ends `A` → `B`:
|
|
101
|
+
|
|
102
|
+
- clip = `A + (B - A) * p`
|
|
103
|
+
- translateY = clip − S
|
|
104
|
+
- start `A - S`, end `B - S`
|
|
105
|
+
|
|
106
|
+
When the new sheet is the thing on screen, `S = B`, so it finishes at `translateY: 0` and starts at `A - B`. Each component's `rollBetween` writes those pixel values through the same `styleMap` the first paint used. Open from 0 is the `-100%` case of the same formula. The resting closed sheet can stay at `-100%` so boot does not have to measure.
|
|
107
|
+
|
|
108
|
+
### Why the px value has to be measured
|
|
109
|
+
|
|
110
|
+
`max-height` only eases between two lengths, and it only caps. It cannot hold a box open taller than its content, so a shrink would drop the bottom immediately. `rollBetween` sets `height` and `max-height` to the same px value. `none` and `auto` have no midpoint, so they snap. A cap of `100dvh` or `9999px` does ease, but the timing function is spread across that whole range. A 480px drawer inside a 1000px range is fully open at 48% of the time, and the named ease is not what you see. The open path reads the sheet once with the clip cap released (no paint), and that integer is the end of the animation. After the clip's own `max-height` `transitionend`, the binding goes back to `height: auto` and `max-height: none` so a later reflow is not stuck. The next close, or the next height change, measures again.
|
|
111
|
+
|
|
112
|
+
### Visibility, inert, reduced motion
|
|
113
|
+
|
|
114
|
+
`sliding` turns on in the same turn as the open. `visibility` and `pointer-events` come on with it, and `inert` comes off. It turns off only when this drawer's clip fires `max-height` `transitionend` and the box is shorter than 2px. A bubbled transform from a form does not qualify (`event.target` must be the clip). That is the close, not a second timer. `prefers-reduced-motion: reduce` sets `--pwa_slide` to `0s` on that host, and `rollBetween` snaps to the end state with `transition: none`.
|
|
115
|
+
|
|
116
|
+
### Where it is used
|
|
117
|
+
|
|
118
|
+
| Place | Clip | Sheet | When it rolls |
|
|
119
|
+
|---|---|---|---|
|
|
120
|
+
| `user-drawer` | `.drawer-clip` | `section.userDrawer` | open, close, and a form swap that changes height |
|
|
121
|
+
| `user-login` | `.login-clip` | `section.service` | `registerTwo` (login ↔ sign-up) and sign-in ↔ signed-in |
|
|
122
|
+
| `user-settings` | `.settings-clip` | `.settings-sheet` | tab change, after the panels are already on screen. The nav stays put |
|
|
123
|
+
|
|
124
|
+
The drawer's login/sign-up pair still slides inside `.inner` with `.opened` / `.closed`. That is a different motion (two forms, one cell). The page login keeps that inner swap and also rolls the card. Settings tabs do not use `.opened` / `.closed`; the roll is the only motion, and settings does not import `animation.ts`. `.in`, `.out`, `.spec-in`, and `.spec-out` are gone.
|
|
125
|
+
|
|
126
|
+
### Apply it to a new component
|
|
127
|
+
|
|
128
|
+
Copy the roll into that component. Do not import a shared helper, and do not reuse `.drawer-clip`, `.login-clip`, `.settings-clip`, or `.settings-sheet`.
|
|
129
|
+
|
|
130
|
+
1. Put `--pwa_slide: 2s` on that component's `:host`, and `0s` inside `prefers-reduced-motion`. Give the clip a class that exists only in this file. `display: block`, `overflow: hidden`.
|
|
131
|
+
2. Bind the clip and the sheet with `styleMap`. The first render is the resting state and `transition: none`.
|
|
132
|
+
3. On a user change after that first update, remember the clip's height, render the new sheet, measure its height, and run this component's own from/to ease. `height` and `max-height` share the px value. `translateY` is clip minus sheet height.
|
|
133
|
+
4. On that clip's `max-height` `transitionend`, and only when `event.target` is the clip, set the binding back to `auto` / `none`.
|
|
134
|
+
5. Do not put a height transition on `:host` in a stylesheet other components import. Do not translate a sheet that leaves out an element that should ride the edge.
|
|
135
|
+
|
|
136
|
+
### Files
|
|
137
|
+
|
|
138
|
+
- `typescript/webcomponents/drawer/drawer.ts` — drawer roll, open, close, form-swap height.
|
|
139
|
+
- `typescript/webcomponents/login/page.ts` — page-login roll and `registerTwo`.
|
|
140
|
+
- `typescript/webcomponents/settings/settings.ts` — settings roll and tab panels.
|
|
141
|
+
- `typescript/webcomponents/css/animation.ts` — `--pwa_slide` and the form-swap `.opened` / `.closed` rules. Class `motion` on `.inner` arms the form transition. The drawer shell has no height transition.
|
|
142
|
+
- `typescript/webcomponents/form/login.ts` and `signup.ts` — the switch buttons.
|
|
143
|
+
- `typescript/redux/frontend.ts` — `universalToggle`, `registerOne`, `registerTwo`, `navigateAuth`.
|
|
144
|
+
- Built copies: `base/webcomponents/css/animation.js`, `source/pwa-auth.js`, `website/javascript/pwa-auth.js`. There is no `roll.js`.
|
|
145
|
+
|
|
146
|
+
`@keyframes slide-out` is still in the file. It is not applied. Do not put it on `.closed`.
|
|
147
|
+
|
|
148
|
+
## History
|
|
149
|
+
|
|
150
|
+
- `97c7256` introduced the slide. `.closed` became `position: absolute` in the same cell, `translate3d(0, -100%, 0)`, with a `0.8s` transform. Before that, `.closed` was `height: 0`, `width: 0`, and `transform: none`, so the swap was instant.
|
|
151
|
+
- `8868da7` timed the swap from one variable: `1.4s * 1.429`, about `2s` `ease-in-out`. Visibility on the way out waits for that transform. Visibility on the way in is immediate.
|
|
152
|
+
- `15b3ed6` is the last commit where that mechanism was intact in the shared rule (`height: auto` and `align-self: start` on `.closed`, so a stretched row does not pull controls to the top).
|
|
153
|
+
- `f607737` broke the drawer. It added a more specific `.userDrawer .content.closed`: `position: relative`, `visibility: visible`, and `animation: slide-out 2s`. The shell timings were being put back on Jack's elements. The form override went with them.
|
|
154
|
+
- `19dfd75` copied that override into the shared `.closed` rule. The drawer, the page login, and the settings tabs all snapped.
|
|
155
|
+
|
|
156
|
+
`slide-out` only animates `max-height` from `100%` to `100dvh`. With `.closed` back in flow, the row changes size while the transform runs. The panels no longer pass through one clipped cell.
|
|
157
|
+
|
|
158
|
+
## How max-height behaves
|
|
159
|
+
|
|
160
|
+
A transition or animation of `max-height` interpolates `max-height` only. The used height is the content height capped by that value. The border box grows or shrinks, and overflow clips the content. The element does not move sideways or upward. A second form in the same cell does not travel in from outside the clip.
|
|
161
|
+
|
|
162
|
+
That is why a `max-height` animation cannot produce the form swap. The forms need one shared cell and a transform. It does produce the unroll, because the unroll is the border box growing. `slide-out` is still a poor cap: `100%` often does not resolve, and `100dvh` is a viewport, not the drawer.
|
|
163
|
+
|
|
164
|
+
### `none` and `auto` do not animate
|
|
165
|
+
|
|
166
|
+
A transition needs two computed values it can blend. `max-height: none` is not a length. `height: auto` is not a length. There is no midpoint between `none` and `400px`, or between `auto` and `0`. The property snaps. This codebase does not use `interpolate-size` or `calc-size()`. Do not switch the form swap over to `height: auto` and expect it to ease.
|
|
167
|
+
|
|
168
|
+
Two lengths do interpolate. `0px` to `240px` animates. `0px` to `100%` animates only when the percentage resolves against a definite containing-block height. If it does not, the open snaps.
|
|
169
|
+
|
|
170
|
+
### A large max-height skews the ease
|
|
171
|
+
|
|
172
|
+
People sometimes animate `max-height` from `0` to a huge length (`9999px`, `100dvh`) to fake `height: auto`. The timing function is applied across the whole range, not across the content. A 400px form inside a 10000px range reaches its real height about 4% of the way through the duration. The rest of the time `max-height` is above the content and nothing visible happens.
|
|
173
|
+
|
|
174
|
+
On the way open, the panel appears to finish early, and the named ease is not the ease you see. On the way closed, most of the duration is spent shrinking empty space above the content, then the content collapses in a rush at the end. `ease-in-out` over that range does not look like `ease-in-out` over the form. That is another reason `slide-out` (`100%` to `100dvh`, 2s) cannot stand in for the 2s transform.
|
|
175
|
+
|
|
176
|
+
### What the drawer open and close uses
|
|
177
|
+
|
|
178
|
+
The drawer clip's bound `height` and `max-height`, and the sheet's bound `transform`, ease with `var(--pwa_slide, 2s) ease-in-out` only while that roll is running. At rest the transition is `none`. `drawerShell` does not ease `:host`. After the open (and after a form-swap glide) the binding becomes `height: auto` and `max-height: none`, which does not animate. The timings table in [Slides](sliders.md) lists the one duration.
|
|
179
|
+
|
|
180
|
+
## Pitfalls
|
|
181
|
+
|
|
182
|
+
- `position: relative` on `.closed` puts the form back in the row. The clip no longer shows one panel replacing the other.
|
|
183
|
+
- `animation: slide-out` on `.closed` does not slide the form. Starting an animation on that element can also drop the transform transition, so the swap snaps.
|
|
184
|
+
- Do not transition `height` or `max-height` to `auto` or `none`. It will snap.
|
|
185
|
+
- Do not fake the form swap with a large `max-height`. The visible motion will be shorter than the duration, and the ease will look wrong.
|
|
186
|
+
- The visibility delay on `.content` must be `var(--pwa_slide)`, not a different literal. Shorter, and the leaving form vanishes mid-slide. Longer, and it stays painted after it is off screen. The visibility duration stays `0s`. It snaps. It does not fade.
|
|
187
|
+
- `.opened` must set its own transition with a `0s` visibility delay. If it inherits the close delay, the arriving form is invisible for the whole slide.
|
|
188
|
+
- Do not give `.spec`, `.inner`, or `.wrapper` their own height or transform duration. The drawer's clip is `.drawer-clip`. The roller is `.userDrawer`. A second clock drifts. The header is outside `.wrapper`, so rolling only `.inner` leaves the header behind.
|
|
189
|
+
- Do not animate `max-height` to `none`, `auto`, or a viewport-sized cap. Measure px, ease between those two lengths, then set `none` only after the clip's own `transitionend`.
|
|
190
|
+
- Do not share the roll. A `:host` height transition, or a class name used by more than one component, eases something that should have stayed still. One component's `transitionend` must not call another component's release.
|
|
191
|
+
- The first render binds the resting state with `transition: none`. Turning the transition on in that same first paint, or writing the closed px after an open first frame, is the open-then-shut flicker.
|
|
192
|
+
- `sliding` has to stay up until the close `max-height` reaches 0. Clearing it when `drawer` flips hides the roll-up. The host backstop is `max-height: 0` with no transition, so it cannot play that flicker by itself.
|
|
193
|
+
- Focusing a control inside the unrolling box scrolls it. `.focus({ preventScroll: true })` keeps the header at the top edge. Reset `scrollTop` when the open starts.
|
|
194
|
+
- Reduced motion has to set `--pwa_slide: 0s`. Zeroing only `transition-duration` leaves a delay that still uses the variable.
|
|
195
|
+
- A more specific `.userDrawer .content.closed` rule is how `f607737` broke the drawer while the shared rule still looked right.
|
|
196
|
+
- `-100%` is the element's own height. `height: 0` on `.closed` makes that distance zero, so nothing moves.
|
|
197
|
+
- `.inner` clips the forms. `:host` clips the drawer. Removing either shows the parked piece.
|
|
198
|
+
- Do not bring back `--pwa_slide_time` or `calc()` on the transform. `6959a29` removed that. `--pwa_slide` is a single time, not a formula.
|
|
199
|
+
|
|
200
|
+
## Changing the duration
|
|
201
|
+
|
|
202
|
+
Change `--pwa_slide` on the component you are timing. The drawer's and the page login's variable is on `:host` in `animation.ts`. Settings sets its own on `:host` in `settings.ts`. That component's roll, its form-swap height glide, its form transform, and its form visibility delay read that variable. `sliding` ends on the clip's `transitionend`, so it follows whatever that time is. Leave the visibility duration at `0s`, and leave `.motion .opened` at `visibility 0s linear 0s`. Do not hardcode a second duration in `rollBetween`.
|
|
203
|
+
|
|
204
|
+
Update the `2s` figures in `docs/sliders.md` and in this file. Rebuild so `base/webcomponents/` matches `typescript/`, then `source/pwa-auth.js` and `website/javascript/pwa-auth.js`.
|
|
205
|
+
|
|
206
|
+
Then open the drawer and close it. The top edge should stay put, the bottom edge should take the new time, and the host should collapse only at the end. Click `login with existing email` and `create a new account`. The forms should slide, and if the open form is taller the bottom edge should ease to the new height instead of jumping.
|