pwa-auth 0.0.16 → 1.1.3

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.
Files changed (52) hide show
  1. package/CHANGELOG.md +76 -4
  2. package/README.md +113 -84
  3. package/demo/index.html +118 -0
  4. package/demo/styles.css +52 -0
  5. package/images/empty.jpg +0 -0
  6. package/images/favicon.ico +0 -0
  7. package/images/manifest/logo-144.png +0 -0
  8. package/images/manifest/logo-192.png +0 -0
  9. package/images/manifest/logo-48.png +0 -0
  10. package/images/manifest/logo-512.png +0 -0
  11. package/images/manifest/logo-72.png +0 -0
  12. package/images/manifest/logo-96.png +0 -0
  13. package/images/manifest/maskable_icon_x128.png +0 -0
  14. package/images/manifest/maskable_icon_x192.png +0 -0
  15. package/images/manifest/maskable_icon_x384.png +0 -0
  16. package/images/manifest/maskable_icon_x48.png +0 -0
  17. package/images/manifest/maskable_icon_x512.png +0 -0
  18. package/images/manifest/maskable_icon_x72.png +0 -0
  19. package/images/manifest/maskable_icon_x96.png +0 -0
  20. package/images/npm.svg +85 -85
  21. package/license +21 -21
  22. package/manifest.json +47 -44
  23. package/npm/pwa-auth.js +3163 -0
  24. package/npm/pwa-auth.js.map +1 -0
  25. package/package.json +50 -39
  26. package/deploy/store.js +0 -18
  27. package/deploy/styles-drawer.js +0 -139
  28. package/deploy/styles-settings.js +0 -57
  29. package/deploy/styles.js +0 -88
  30. package/deploy/user-action.js +0 -69
  31. package/deploy/user-drawer.js +0 -168
  32. package/deploy/user-functions.js +0 -191
  33. package/deploy/user-icon.js +0 -106
  34. package/deploy/user-reducer.js +0 -41
  35. package/deploy/user-settings.js +0 -427
  36. package/index.html +0 -111
  37. package/launch/application-shell.js +0 -95
  38. package/launch/package-lock.json +0 -3198
  39. package/launch/package.json +0 -17
  40. package/polymer.json +0 -24
  41. package/pwa-auth.js +0 -16
  42. package/src/store.ts +0 -52
  43. package/src/styles-drawer.ts +0 -143
  44. package/src/styles-settings.ts +0 -61
  45. package/src/styles.ts +0 -95
  46. package/src/user-action.ts +0 -91
  47. package/src/user-drawer.ts +0 -168
  48. package/src/user-functions.ts +0 -190
  49. package/src/user-icon.ts +0 -104
  50. package/src/user-reducer.ts +0 -91
  51. package/src/user-settings.ts +0 -421
  52. package/tsconfig.json +0 -19
@@ -1,427 +0,0 @@
1
- /**
2
- @license
3
- Copyright (c) 2018 The Polymer Project Authors. All rights reserved.
4
- This code may only be used under the BSD style license found at http://polymer.github.io/LICENSE.txt
5
- The complete set of authors may be found at http://polymer.github.io/AUTHORS.txt
6
- The complete set of contributors may be found at http://polymer.github.io/CONTRIBUTORS.txt
7
- Code distributed by Google as part of the polymer project is also
8
- subject to an additional IP rights grant found at http://polymer.github.io/PATENTS.txt
9
- */
10
- var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
11
- var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
12
- if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
13
- else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
14
- return c > 3 && r && Object.defineProperty(target, key, r), r;
15
- };
16
- // @ts-check
17
- import { html, LitElement, css, customElement, property } from 'lit-element';
18
- import { connect } from 'pwa-helpers/connect-mixin.js';
19
- import { store } from './store';
20
- import { navigate, setName } from './user-action.js';
21
- import { userStyles } from './styles';
22
- import { Settings } from './styles-settings';
23
- import { firebaseUser, deleteUser, runFirebase, userName, profileURL, userEmail } from './user-functions'; // runFirebase
24
- export class Student {
25
- constructor(firstName, middleInitial, lastName) {
26
- this.firstName = firstName;
27
- this.middleInitial = middleInitial;
28
- this.lastName = lastName;
29
- this.fullName = firstName + " " + middleInitial + " " + lastName;
30
- }
31
- }
32
- export const faceIcon = html `<svg viewBox="0 0 24 24" height="175px" width="175px"><path d="M9 11.75c-.69 0-1.25.56-1.25 1.25s.56 1.25 1.25 1.25 1.25-.56 1.25-1.25-.56-1.25-1.25-1.25zm6 0c-.69 0-1.25.56-1.25 1.25s.56 1.25 1.25 1.25 1.25-.56 1.25-1.25-.56-1.25-1.25-1.25zM12 2C6.48 2 2 6.48 2 12s4.48 10 10 10 10-4.48 10-10S17.52 2 12 2zm0 18c-4.41 0-8-3.59-8-8 0-.29.02-.58.05-.86 2.36-1.05 4.23-2.98 5.21-5.37C11.07 8.33 14.05 10 17.42 10c.78 0 1.53-.09 2.25-.26.21.71.33 1.47.33 2.26 0 4.41-3.59 8-8 8z"></path></svg>`;
33
- let UserSettings = class UserSettings extends connect(store)(LitElement) {
34
- constructor() {
35
- super();
36
- this.profileTopic = '';
37
- this._user = false;
38
- this._name = '';
39
- this._person = '';
40
- this._phone = '';
41
- this._userMail = '';
42
- this._photoURL = '';
43
- this._imagePath = '';
44
- this.onChange = (e) => this.dispatchEvent(new CustomEvent('name-changed', { detail: e.target.value }));
45
- }
46
- firstUpdated() {
47
- const a = this.shadowRoot.getElementById('settings');
48
- a.addEventListener('click', e => { e.preventDefault(); });
49
- const b = this.shadowRoot.getElementById('emailForm');
50
- b.addEventListener('click', e => { e.preventDefault(); });
51
- const c = this.shadowRoot.getElementById('passwordForm');
52
- c.addEventListener('click', e => { e.preventDefault(); });
53
- const d = this.shadowRoot.getElementById('deleteForm');
54
- d.addEventListener('click', e => { e.preventDefault(); });
55
- this.shadowRoot.getElementById('profile').addEventListener('click', () => { store.dispatch(navigate('profile')); });
56
- this.shadowRoot.getElementById('email').addEventListener('click', () => { store.dispatch(navigate('email')); });
57
- this.shadowRoot.getElementById('password').addEventListener('click', () => { store.dispatch(navigate('password')); });
58
- this.shadowRoot.getElementById('account').addEventListener('click', () => { store.dispatch(navigate('delete')); });
59
- this.shadowRoot.getElementById('save').addEventListener('click', () => { this.alertProfile(); });
60
- this.shadowRoot.getElementById('update').addEventListener('click', () => { this.alertEmail(); });
61
- this.shadowRoot.getElementById('pass').addEventListener('click', () => { this.alertPassword(); });
62
- this.shadowRoot.getElementById('deleteUser').addEventListener('click', () => { this.alertDelete(); });
63
- this.shadowRoot.getElementById("fileupload").addEventListener('change', () => { this._handleFiles(); }, false);
64
- runFirebase();
65
- // @ts-ignore
66
- firebase.auth().onAuthStateChanged((firebaseUser) => {
67
- if (firebaseUser) { /* INCLUDE */
68
- this._person = userName();
69
- this._userMail = userEmail();
70
- this._photoURL = profileURL();
71
- store.dispatch(setName(this._person));
72
- }
73
- else { /* EXCLUDE */ }
74
- store.dispatch(setName(this._person));
75
- });
76
- }
77
- stateChanged(state) {
78
- this.profileTopic = state.user.settings;
79
- this._user = state.user.currentUser;
80
- this._person = state.user.customer;
81
- this._name = state.user.name;
82
- this._phone = state.user.phone;
83
- this._userMail = state.user.email;
84
- this._photoURL = state.user.photoURL;
85
- }
86
- alertProfile() { if (this._user) {
87
- this.updateProfile();
88
- }
89
- else {
90
- alert('Please Login');
91
- } }
92
- updateProfile() {
93
- const person = firebaseUser();
94
- const contractor = this.shadowRoot.getElementById('contractor').value;
95
- const phone = this.shadowRoot.getElementById('phoneNumber').value;
96
- const list = this.shadowRoot.getElementById('list').checked;
97
- if (contractor === null) {
98
- contractor === this._person;
99
- }
100
- // const photo = this.shadowRoot.getElementById('');
101
- // const company = this.shadowRoot.getElementById('company').value;
102
- // const enroll = this.shadowRoot.getElementById('who').value;
103
- if (firebaseUser) {
104
- person.updateProfile({
105
- displayName: contractor,
106
- phoneNumber: phone
107
- // photoURL: ""
108
- })
109
- .then(() => {
110
- alert('updated name:' + contractor +
111
- 'updated phone:' + phone +
112
- 'Public Profile:' + list);
113
- })
114
- .catch((error) => { console.error('Error writing new message to Firebase Database', error); });
115
- /*
116
- firestore.collection("users").doc(user.id).set({
117
- company: user.id,
118
- enrollment: list
119
- // location: this.location,
120
- })
121
- .then( () => { console.log("Document successfully written!"); })
122
- .catch( (error) => { console.error('Error writing new message to Firebase Database', error); }); */
123
- }
124
- // location.reload();
125
- }
126
- /* Update email */
127
- alertEmail() { if (this._user) {
128
- this.updateEmail();
129
- }
130
- else {
131
- alert('Please Login');
132
- } }
133
- updateEmail() {
134
- const user = firebaseUser();
135
- const email = this.shadowRoot.getElementById('email').value;
136
- user.updateEmail(email)
137
- .then(() => { console.log("Email update successful!"); })
138
- .catch((error) => { console.error('Error writing new message to Firebase Database', error); });
139
- user.sendEmailVerification()
140
- .then(() => { console.log("Email Verification successful!"); })
141
- .catch((error) => { console.error('Error writing new message to Firebase Database', error); });
142
- }
143
- /* Update Password */
144
- alertPassword() { if (this._user) {
145
- this.updatePassword();
146
- }
147
- else {
148
- alert('Please Login');
149
- } }
150
- updatePassword() {
151
- const user = firebaseUser();
152
- const newPassword = this.shadowRoot.getElementById('newPass').value;
153
- user.updatePassword(newPassword)
154
- .then(() => { console.log("Password successful!"); })
155
- .catch((error) => { console.error('Error writing new message to Firebase Database', error); });
156
- }
157
- /* Delete Account */
158
- alertDelete() { if (this._user) {
159
- this.deleteUser();
160
- }
161
- else {
162
- alert('Please Login');
163
- } }
164
- deleteUser() {
165
- const d = confirm("Delete Account?");
166
- if (d == true) {
167
- deleteUser();
168
- console.log("user gone");
169
- }
170
- else {
171
- console.log("user here");
172
- }
173
- }
174
- _handleFiles() {
175
- const uploader = this.shadowRoot.getElementById('uploader');
176
- const file = this.shadowRoot.getElementById('fileupload').files[0];
177
- const now = storageRef.child('/images/' + file.name);
178
- const task = now.put(file);
179
- task.on('state_changed', function progress(snapshot) { const percentage = (snapshot.bytesTransferred / snapshot.totalBytes) * 100; uploader.value = percentage; }, function error(error) { error; }, function complete() { });
180
- this._imagePath = file.name;
181
- console.log(this._imagePath);
182
- }
183
- /*
184
- // Handle email address change revocations
185
- _handleRecoverEmail(auth, actionCode, lang) {
186
- // Localize the UI to the selected language as determined by the lang parameter.
187
- const restoredEmail = null;
188
- // Confirm the action code is valid.
189
- auth.checkActionCode(actionCode)
190
- // Get the restored email address.
191
- .then( (info) => { restoredEmail = info['data']['email'];
192
- // Revert to the old email.
193
- return auth.applyActionCode(actionCode);
194
- }).then( () => {
195
- // Account email reverted to restoredEmail
196
- // TODO: Display a confirmation message to the user.
197
- // You might also want to give the user the option to reset their password
198
- auth.sendPasswordResetEmail(restoredEmail).then( () => {
199
- // Password reset confirmation sent. Ask user to check their email.
200
- }).catch( (error) => {
201
- // Error encountered while sending password reset code.
202
- });
203
- }).catch( (error) => {
204
- // Invalid code.
205
- });
206
- }
207
-
208
- _handleResetPassword(auth, actionCode, continueUrl, lang) {
209
- // Localize the UI to the selected language as determined by the lang parameter.
210
- // const accountEmail;
211
- // Verify the password reset code is valid.
212
- auth.verifyPasswordResetCode(actionCode).then( (email) => {
213
- const accountEmail = email;
214
- // TODO: Show the reset screen with the user's email and ask the user for the new password.
215
- // Save the new password.
216
- auth.confirmPasswordReset(actionCode, newPassword).then( (resp) => {
217
- // Password reset has been confirmed and new password updated.
218
-
219
- // TODO: Display a link back to the app, or sign-in the user directly
220
- // if the page belongs to the same domain as the app:
221
- // auth.signInWithEmailAndPassword(accountEmail, newPassword);
222
-
223
- // TODO: If a continue URL is available,
224
- // display a button which on click redirects the user back to the app
225
- // via continueUrl with additional state determined from that URL's parameters.
226
- }).catch( (error) => {
227
- // Error occurred during confirmation. The code might have expired or the password is too weak.
228
- });
229
- }).catch( (error) => {
230
- // Invalid or expired action code. Ask user to try to reset the password again.
231
- });
232
- }
233
- */
234
- static get styles() {
235
- return [
236
- Settings,
237
- userStyles,
238
- css `
239
-
240
- button:focus { outline: none; }
241
-
242
- #uploader {
243
- position: absolute;
244
- right: 0;
245
- width: 28px;
246
- height: 28px;
247
- border: 2px solid #303030;
248
- border-radius: 50%;
249
- transform: rotateZ(90deg);
250
- overflow: hidden;
251
- box-shadow: 1px 1px 2px black, 0 0 25px grey, 0 0 5px #fff;
252
- }
253
-
254
- .profile {
255
- width: 200px;
256
- margin: auto;
257
- }
258
-
259
- .userImage {
260
- border-radius: 50%;
261
- overflow: hidden;
262
- margin: auto;
263
- border: 2px solid #303030;
264
- box-shadow: 1px 1px 2px black, 0 0 25px grey, 0 0 5px #fff;
265
- }
266
-
267
- .file-container {
268
-
269
- }
270
-
271
- .trigger {
272
- position: relative;
273
- width: 200px;
274
- display: block;
275
- text-shadow: 1px 1px 12px black, 0 0 35px grey, 0 0 15px #fff;
276
- font-size: 1em;
277
- transition: all .4s;
278
- cursor: pointer;
279
- text-align: center;
280
- }
281
-
282
- #fileupload {
283
-
284
-
285
- width: 200px;
286
- height: 100%;
287
- /* background: #39D2B4; */
288
- position: absolute;
289
- top: 0; left: 0;
290
- opacity: 0;
291
-
292
- cursor: pointer;
293
- }
294
-
295
- .max {
296
- max-width: 600px;
297
- margin: auto;
298
- }
299
-
300
- .welcome {
301
- text-align: center;
302
- text-shadow: 1px 1px 2px black, 0 0 15px grey, 0 0 5px #fff;
303
- }
304
-
305
- @media (max-width: 460px) {
306
- #profile, #email { text-align: left; }
307
- #account, #password { text-align: right; }
308
- }
309
- /*
310
- @media (min-width: 640px) {
311
- :host{ display: grid; grid-template-columns: 50% 50%; }
312
- }
313
- */
314
- `
315
- ];
316
- }
317
- render() {
318
- return html `
319
- <!-- Page Menu -->
320
- <div>
321
- <ul class="setMenu">
322
- <li><button id="profile" value="profile" class="topButton" ?on="${this.profileTopic === 'profile'}" ><p>Profile</p> </button></li>
323
- <li><button id="email" value="email" class="topButton" ?on="${this.profileTopic === 'email'}" ><p>Email</p> </button></li>
324
- <li><button id="password" value="password" class="topButton" ?on="${this.profileTopic === 'password'}" ><p>Password</p> </button></li>
325
- <li><button id="account" value="delete" class="topButton" ?on="${this.profileTopic === 'delete'}" ><p>Delete</p> </button></li>
326
- </ul>
327
- </div>
328
-
329
- <!-- Page Body -->
330
- <div class="spec" ?on="${this.profileTopic === 'profile'}">
331
- <div class="profile">
332
-
333
- <h2 class="welcome">${this._person}</h2>
334
-
335
- <label for="fileupload" class="trigger">
336
- <input type="file" name="fileupload" id="fileupload" accept="image/*">
337
- ${this._user
338
- ? html `
339
- <progress value="0" max="100" id="uploader"></progress>
340
- <input
341
- type="image"
342
- class="userImage"
343
- id="image"
344
- alt="user"
345
- height="171px"
346
- width="171px"
347
- src="${this._photoURL}">
348
- `
349
- : html `${faceIcon}`}
350
- upload a photo
351
- </label>
352
-
353
- </div>
354
- <form id="settings">
355
- <ul>
356
- <li><p><label><h3 class="pageTitle">Username</h3><input id="contractor" type="text" ></label></p></li>
357
- <li><p><label><h3 class="pageTitle">Telephone: ${this._phone}</h3><input id="phoneNumber" type="text" ></label></p></li>
358
- </ul>
359
- </form>
360
-
361
- <ul class="max">
362
- <li><p><label><input type="checkbox" id="list" placeholder="true">Public Profile</label></p></li>
363
- <li><button id="save" class="action-button" >save</button></li>
364
- </ul>
365
-
366
- </div>
367
-
368
- <form class="spec" ?on="${this.profileTopic === 'email'}" id="emailForm">
369
- <ul>
370
- <li><h3 class="pageTitle">Change Email ${this._userMail}</h3></li>
371
- <li><p><label>Email<input type="email" id="email"></label></p></li>
372
- <li><p><label>Verify Email<input type="email" id="emailVerify"></label></p></li>
373
- <li><p><button id="update" class="action-button" >update</button></p></li>
374
- <li><div class="verified"></div></li>
375
- </ul>
376
- </form>
377
-
378
- <form class="spec" ?on="${this.profileTopic === 'password'}" id="passwordForm">
379
- <ul>
380
- <li><h3 class="pageTitle">Update Password</h3></li>
381
- <li><p><label>New Password <input type="Password" id="newPass"></label></p></li>
382
- <li><p><label>Verify Password <input type="Password" id="passVerify"></label></p></li>
383
- <li><p><button id="pass" class="action-button">create</button></p></li>
384
- </ul>
385
- </form>
386
-
387
- <form class="spec" ?on="${this.profileTopic === 'delete'}" id="deleteForm">
388
- <ul>
389
- <li><h3 class="pageTitle">Delete Account</h3></li>
390
- <li><p>Permanently delete the user account and data related to:</p></li>
391
- <!-- <li><p>\${this.userMail}</p></li> -->
392
- <li><p><button id="deleteUser" class="action-button">Delete</button></p></li>
393
- </ul>
394
- </form>
395
- </form>
396
-
397
- `;
398
- }
399
- };
400
- __decorate([
401
- property({ type: String })
402
- ], UserSettings.prototype, "profileTopic", void 0);
403
- __decorate([
404
- property({ type: Boolean })
405
- ], UserSettings.prototype, "_user", void 0);
406
- __decorate([
407
- property({ type: String })
408
- ], UserSettings.prototype, "_name", void 0);
409
- __decorate([
410
- property({ type: String })
411
- ], UserSettings.prototype, "_person", void 0);
412
- __decorate([
413
- property({ type: Number })
414
- ], UserSettings.prototype, "_phone", void 0);
415
- __decorate([
416
- property({ type: String })
417
- ], UserSettings.prototype, "_userMail", void 0);
418
- __decorate([
419
- property({ type: String })
420
- ], UserSettings.prototype, "_photoURL", void 0);
421
- __decorate([
422
- property({ type: String })
423
- ], UserSettings.prototype, "_imagePath", void 0);
424
- UserSettings = __decorate([
425
- customElement('user-settings')
426
- ], UserSettings);
427
- export { UserSettings };
package/index.html DELETED
@@ -1,111 +0,0 @@
1
- <!--
2
- @license
3
- Copyright (c) 2018 The Polymer Project Authors. All rights reserved.
4
- This code may only be used under the BSD style license found at http://polymer.github.io/LICENSE.txt
5
- The complete set of authors may be found at http://polymer.github.io/AUTHORS.txt
6
- The complete set of contributors may be found at http://polymer.github.io/CONTRIBUTORS.txt
7
- Code distributed by Google as part of the polymer project is also
8
- subject to an additional IP rights grant found at http://polymer.github.io/PATENTS.txt
9
- -->
10
-
11
- <!DOCTYPE html>
12
- <html lang="en">
13
- <head>
14
- <meta charset="UTF-8">
15
- <!-- TITILE -->
16
- <title>pwa-auth</title>
17
- <!-- VIEWPORT -->
18
- <meta name="viewport" content="width=device-width, minimum-scale=1, initial-scale=1" />
19
- <!-- BASE -->
20
- <base href="/">
21
- <!-- PRECONNECT -->
22
- <link rel="preconnect" href="https://www.googletagmanager.com">
23
- <link rel="preconnect" href="https://www.gstatic.com">
24
- <link rel="preconnect" href="https://www.google-analytics.com">
25
- <!-- STYLES -->
26
- <style>
27
- body { margin: 0; background-color: #303030; }
28
- header { height: 64px; display: grid; grid-template-columns: 1fr 64px ; background-color: #303030; }
29
- main { margin: 0 16px 0 16px; background-color: #fff; border-radius: 8px; padding: 8px;}
30
- footer { background-color: #303030; height: 100%; color: #e8e8e8; }
31
- .links { margin: auto; text-decoration: none; font-size: 1em; color: red; font-weight: 800; }
32
- .link { margin: auto; text-decoration: none; font-size: 1em; color: #e8e8e8; font-weight: 800; }
33
- p { margin: 16px; background-color: #fff; color: black; border-radius: 8px; padding: 16px; font-size: 1em; }
34
- h1, h2 { text-align: center; }
35
- h3 { text-align: center; color: #e8e8e8; padding-left: 64px; text-transform: uppercase; font-size: 1em; }
36
- </style>
37
- <!-- https://github.com/reactjs/redux/issues/2907 -->
38
- <script>
39
- if ('serviceWorker' in navigator) { window.addEventListener('load', () => {
40
- navigator.serviceWorker.register('service-worker.js', {
41
- scope: '/',
42
- });
43
- });
44
- }
45
- window.process = { env: { NODE_ENV: 'production' } };
46
- </script>
47
- <!-- MANIFEST -->
48
- <link rel="manifest" href="manifest.json" />
49
- <!-- FAVICON -->
50
- <link rel="icon" href="images/favicon.ico">
51
- <!-- THEME COLOR -->
52
- <meta name="theme-color" content="#272931" />
53
- <!-- AUTHOR -->
54
- <meta name="author" content="Modern Projects" />
55
- <!-- CANONICAL -->
56
- <link rel="canonical" href="https://inmostfire.com" />
57
- <!-- DESCRIPTION -->
58
- <meta name="description" content="To provide a personalized experience, Apps need to know the identity of a user to securely store data in the cloud. pwa-auth is powered by The Firebase Authentication backend, consistently providing a centralized and predictable state behaviour with Redux, and declaratively rendering straight into the DOM with Google Polymer's fast and light Lit-Element. This Component includes 3 HTML Tags, and 1 Boilerplate Function to display the user icon, sign up, login, log out, change account details, and delete the user's account." />
59
- <!-- KEYWORDS -->
60
- <meta name="keywords" content="lit-html, redux, firebase, user, management, drawer, settings, icon" />
61
-
62
- </head>
63
-
64
- <body>
65
-
66
- <!-- LOAD ANY POLYFILLS YOUR BROWSER NEEDS -->
67
- <script src="node_modules/@webcomponents/webcomponentsjs/webcomponents-loader.js" async ></script>
68
-
69
- <!-- APPLICATION-SHELL -->
70
- <application-shell appTitle="pwa-auth"></application-shell>
71
-
72
- <!-- Global site tag (gtag.js) - Google Analytics -->
73
- <script async src="https://www.googletagmanager.com/gtag/js?id=UA-73943527-19"></script>
74
- <script>
75
- window.dataLayer = window.dataLayer || [];
76
- function gtag(){dataLayer.push(arguments);}
77
- gtag('js', new Date());
78
- gtag('config', 'UA-73943527-19');
79
- </script>
80
-
81
- <!-- FIREBASE -->
82
- <script src="https://www.gstatic.com/firebasejs/5.9.0/firebase-app.js" ></script>
83
- <script src="https://www.gstatic.com/firebasejs/5.9.0/firebase-auth.js" ></script>
84
- <script src="https://www.gstatic.com/firebasejs/5.9.0/firebase-firestore.js" ></script>
85
- <script src="https://www.gstatic.com/firebasejs/5.9.0/firebase-storage.js" ></script>
86
-
87
- <script>
88
- document.addEventListener("DOMContentLoaded", (event) => { });
89
- // Initialize Firebase
90
- const admin = {
91
- apiKey: "AIzaSyAJfm5MahdHr4HzwRLWN7IBhVYXMjP65lQ",
92
- authDomain: "inmostfire.firebaseapp.com",
93
- databaseURL: "https://inmostfire.firebaseio.com",
94
- projectId: "inmostfire",
95
- storageBucket: "inmostfire.appspot.com",
96
- messagingSenderId: "937289126032"
97
- };
98
-
99
- // REFERENCE TO SERVICES
100
- const application = firebase.initializeApp(admin);
101
- const firestore = application.firestore();
102
- const storage = firebase.storage();
103
- const storageRef = storage.ref();
104
-
105
- </script>
106
-
107
- <!-- APPLICATION-SHELL -->
108
- <script type="module" src="/launch/application-shell.js" async></script>
109
-
110
- </body>
111
- </html>
@@ -1,95 +0,0 @@
1
- /**
2
- @license
3
- Copyright (c) 2018 The Polymer Project Authors. All rights reserved.
4
- This code may only be used under the BSD style license found at http://polymer.github.io/LICENSE.txt
5
- The complete set of authors may be found at http://polymer.github.io/AUTHORS.txt
6
- The complete set of contributors may be found at http://polymer.github.io/CONTRIBUTORS.txt
7
- Code distributed by Google as part of the polymer project is also
8
- subject to an additional IP rights grant found at http://polymer.github.io/PATENTS.txt
9
- */
10
-
11
- //@ts-check
12
- import { LitElement, html, css } from 'lit-element';
13
- import { setPassiveTouchGestures } from '@polymer/polymer/lib/utils/settings';
14
- // POLYMER ELEMENTS
15
- import '@polymer/app-layout/app-header-layout/app-header-layout';
16
- import '@polymer/app-layout/app-header/app-header';
17
- // ELEMENTS
18
- import '../pwa-auth';
19
- class ApplicationShell extends LitElement {
20
-
21
- constructor() {
22
- super();
23
- // See https://www.polymer-project.org/2.0/docs/devguide/gesture-events#use-passive-gesture-listeners
24
- setPassiveTouchGestures(true);
25
- }
26
-
27
- static get styles() {
28
- return [
29
- css`
30
- :host {
31
- display: block;
32
- }
33
-
34
- /* DISPLAY READY STATE */
35
- main { display: block; margin: 10px; }
36
- .page {
37
- background-color: rgba(255,255,255, 0.9);
38
- border-radius: 8px;
39
- max-width: 600px;
40
- }
41
-
42
- /* Wide layout: when the viewport width is bigger than 480px, layout changes to a wide layout. */
43
- @media (min-width: 480px) {
44
- /** h2 { font-size: 36px; } */
45
- .main-title { font-size: 1em; }
46
- }
47
-
48
- `
49
- ];
50
- }
51
-
52
- render() {
53
- return html`
54
-
55
- <!-- APPLICATION HEADER LAYOUT -->
56
- <app-header-layout
57
- fullbleed>
58
-
59
- <!-- APPLICATION HEADER -->
60
- <app-header
61
- id="head"
62
- class="main-header"
63
- slot="header"
64
- fixed
65
- condenses>
66
-
67
- <!-- TITLE / PROJECT PAGE -->
68
- <a class="main-title">pwa-auth</a>
69
-
70
- <!-- LOG IN -->
71
- <user-icon></user-icon>
72
-
73
- </app-header>
74
-
75
- <!-- PAGES -->
76
- <main id="main">
77
- <user-drawer></user-drawer>
78
- </main>
79
-
80
- <!-- FOOTER -->
81
- <footer>
82
- <ul>
83
- <li><h3 class="business">©inmostFire</h3></li>
84
- <li><p class="slogan">"Innovation"</p></li>
85
- <li><p><a class="link" href="https://www.jackspublishing.com">about us</a></p></li>
86
- </ul>
87
- </footer>
88
-
89
- </app-header-layout>
90
-
91
- `;
92
- }
93
- }
94
-
95
- window.customElements.define('application-shell', ApplicationShell);