@everymatrix/general-player-login-form 0.0.168 → 0.0.172

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@everymatrix/general-player-login-form",
3
- "version": "0.0.168",
3
+ "version": "0.0.172",
4
4
  "main": "dist/general-player-login-form.js",
5
5
  "svelte": "src/index.ts",
6
6
  "scripts": {
@@ -36,5 +36,5 @@
36
36
  "publishConfig": {
37
37
  "access": "public"
38
38
  },
39
- "gitHead": "b469834fd49f47995c17424b33a59fabad03a2b6"
39
+ "gitHead": "604627a4babac0e9e23f37751bfc4062a279bc34"
40
40
  }
@@ -22,7 +22,8 @@
22
22
  let isLoading:boolean = false;
23
23
  let passwordVisibilityToggle:HTMLElement;
24
24
  let isPasswordVisible:boolean = false;
25
-
25
+ let isFormDataInvalid:boolean = true;
26
+
26
27
  const captchaKey = '6Lc7w8YcAAAAAEMHc_VNN9bqfVnILoUOHSHyZ0yn';
27
28
 
28
29
  const regexValidators = {
@@ -64,7 +65,6 @@
64
65
  }
65
66
 
66
67
  const submitLoginForm = () => {
67
- isLoading = true;
68
68
  doRecaptcha().then((token) => {
69
69
  if (checkUserIdentifier(userValue) && checkUserPassword(userPassword)) {
70
70
  loginFormData = {
@@ -72,6 +72,7 @@
72
72
  password: userPassword,
73
73
  token: token
74
74
  };
75
+ isLoading = true;
75
76
 
76
77
  window.postMessage({ type: "SubmitLoginForm", loginData: loginFormData }, window.location.href);
77
78
  }
@@ -96,10 +97,12 @@
96
97
 
97
98
  const validateUserName = () => {
98
99
  invalidName = !checkUserIdentifier(userValue);
100
+ isFormDataInvalid = (!invalidName && !invalidPassword && userPassword) ? false : true;
99
101
  }
100
102
 
101
103
  const validatePassword = () => {
102
104
  invalidPassword = !checkUserPassword(userPassword);
105
+ isFormDataInvalid = (!invalidName && !invalidPassword && userValue) ? false : true;
103
106
  }
104
107
 
105
108
  const messageHandler = (e:any) => {
@@ -177,17 +180,9 @@
177
180
  {#if errorMessage}
178
181
  <p class="ErrorMessage">{errorMessage}</p>
179
182
  {/if}
180
- <button class="SingInButton" on:click={() => submitLoginForm()}>Sign In</button>
183
+ <button class="SignInButton" on:click={() => submitLoginForm()} disabled={isFormDataInvalid}>Sign In</button>
181
184
  <button class="ForgotPasswordButton" on:click={() => switchToForgotPassword()}>I forgot my password</button>
182
185
  </div>
183
- <!-- TODO: move styling to password reset success widget -->
184
- <!-- {:else}
185
- <div class="SuccessMessageContainer">
186
- <div class="CheckMarkIcon"></div>
187
- <h4 class="SuccessTitle">Success!</h4>
188
- <p class="SuccessText">The process has been completed successfully.</p>
189
- <p class="SuccessText">Please follow the instructions in the email we just sent you.</p>
190
- </div> -->
191
186
  </div>
192
187
  {#if !mobileView}
193
188
  <div class="FormRightSide" style="background-image: url('{imagedesktop}')"></div>
@@ -291,7 +286,7 @@
291
286
  right: ttp(0.5);
292
287
  bottom: 45px;
293
288
  }
294
- .SingInButton {
289
+ .SignInButton {
295
290
  color: #fff;
296
291
  background: #D0046C;
297
292
  border: 1px solid #D0046C;
@@ -302,6 +297,11 @@
302
297
  text-transform: uppercase;
303
298
  font-size: ttp(1.125);
304
299
  cursor: pointer;
300
+ &[disabled] {
301
+ background: #c1c1c1;
302
+ border: 1px solid #c1c1c1;
303
+ cursor: not-allowed;
304
+ }
305
305
  }
306
306
  .ForgotPasswordButton {
307
307
  border: 0;
@@ -316,16 +316,12 @@
316
316
  .PasswordContainer, .UserContainer {
317
317
  padding-bottom: 30px;
318
318
  }
319
- .UserContainer {
320
- .InvalidInput {
321
- bottom: -3px;
322
- }
323
- }
319
+
324
320
  .InvalidInput {
325
321
  color: #D0046C;
326
322
  font-size: ttp(0.625);
327
323
  position: absolute;
328
- bottom: -3px;
324
+ top: 55px;
329
325
  line-height: ttp(0.625);
330
326
  }
331
327
  .ErrorMessage {
@@ -333,41 +329,12 @@
333
329
  font-size: 12px;
334
330
  color: #D0046C;
335
331
  }
336
- // TODO: move styling to password reset success widget
337
- // .SuccessMessageContainer {
338
- // margin: 20px;
339
- // padding: 30px;
340
- // background: #fff;
341
- // text-align: center;
342
- // }
343
- // .CheckMarkIcon {
344
- // width: 20px;
345
- // height: 42px;
346
- // border-bottom: 6px solid #16CE16;
347
- // border-right: 6px solid #16CE16;
348
- // display: inline-block;
349
- // position: relative;
350
- // transform: rotate(45deg);
351
- // }
352
- // .SuccessTitle {
353
- // color: #16CE16;
354
- // font-size: 20px;
355
- // font-weight: 400;
356
- // text-transform: uppercase;
357
- // margin: 14px 0;
358
- // }
359
- // .SuccessText {
360
- // color: #58586B;
361
- // font-size: 12px;
362
- // font-weight: 300;
363
- // margin: 0;
364
- // }
365
332
  .FormMobileContainer {
366
333
  height:100%;
367
334
  .FormLeftSide {
368
335
  padding: ttp(2.5) ttp(1.25);
369
336
  }
370
- .SingInButton,
337
+ .SignInButton,
371
338
  .UserContainer input,
372
339
  .PasswordContainer input,
373
340
  .CaptchaContainer {