| 
									
										
										
										
											2024-02-24 11:09:34 -05:00
										 |  |  | <!doctype html> | 
					
						
							| 
									
										
										
										
											2016-03-12 18:50:43 +00:00
										 |  |  | <html> | 
					
						
							|  |  |  | 	<head> | 
					
						
							| 
									
										
										
										
											2022-12-28 17:05:56 +00:00
										 |  |  | 		<title>Tilde Friends Sign-in</title> | 
					
						
							| 
									
										
										
										
											2024-02-24 11:09:34 -05:00
										 |  |  | 		<link type="text/css" rel="stylesheet" href="/static/style.css" /> | 
					
						
							| 
									
										
										
										
											2024-06-20 20:05:00 -04:00
										 |  |  | 		<link type="image/svg+xml" rel="icon" href="/static/tildefriends.svg" /> | 
					
						
							| 
									
										
										
										
											2024-02-24 11:09:34 -05:00
										 |  |  | 		<meta name="viewport" content="width=device-width, initial-scale=1" /> | 
					
						
							| 
									
										
										
										
											2016-03-12 18:50:43 +00:00
										 |  |  | 	</head> | 
					
						
							|  |  |  | 	<body> | 
					
						
							| 
									
										
										
										
											2022-12-28 17:05:56 +00:00
										 |  |  | 		<h1 style="text-align: center">Tilde Friends Sign-in</h1> | 
					
						
							| 
									
										
										
										
											2023-08-09 22:38:41 +00:00
										 |  |  | 		<tf-auth id="auth"></tf-auth> | 
					
						
							| 
									
										
										
										
											2024-02-24 11:09:34 -05:00
										 |  |  | 		<script> | 
					
						
							|  |  |  | 			window.litDisableBundleWarning = true; | 
					
						
							|  |  |  | 		</script> | 
					
						
							| 
									
										
										
										
											2023-08-09 22:38:41 +00:00
										 |  |  | 		<script type="module"> | 
					
						
							| 
									
										
										
										
											2024-02-09 01:21:57 +00:00
										 |  |  | 			import {LitElement, html} from '/lit/lit-all.min.js'; | 
					
						
							| 
									
										
										
										
											2023-08-09 22:38:41 +00:00
										 |  |  | 			let g_data = $AUTH_DATA; | 
					
						
							|  |  |  | 			let app = document.getElementById('auth'); | 
					
						
							|  |  |  | 			Object.assign(app, g_data); | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | 			class TfAuthElement extends LitElement { | 
					
						
							| 
									
										
										
										
											2024-04-13 10:28:35 -04:00
										 |  |  | 				static get properties() { | 
					
						
							| 
									
										
										
										
											2023-08-09 22:38:41 +00:00
										 |  |  | 					return { | 
					
						
							| 
									
										
										
										
											2024-04-13 10:28:35 -04:00
										 |  |  | 						code_of_conduct: {type: String}, | 
					
						
							|  |  |  | 						error: {type: String}, | 
					
						
							|  |  |  | 						have_administrator: {type: Boolean}, | 
					
						
							| 
									
										
										
										
											2023-08-09 22:38:41 +00:00
										 |  |  | 						name: {type: String}, | 
					
						
							|  |  |  | 						tab: {type: String}, | 
					
						
							|  |  |  | 					}; | 
					
						
							|  |  |  | 				} | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | 				constructor() { | 
					
						
							|  |  |  | 					super(); | 
					
						
							|  |  |  | 					this.tab = 'login'; | 
					
						
							|  |  |  | 				} | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | 				render() { | 
					
						
							|  |  |  | 					let self = this; | 
					
						
							|  |  |  | 					return html` | 
					
						
							|  |  |  | 						<style> | 
					
						
							|  |  |  | 							[name="tab"] { | 
					
						
							|  |  |  | 								display: none; | 
					
						
							|  |  |  | 							} | 
					
						
							|  |  |  | 							[name="tab"]+label { | 
					
						
							| 
									
										
										
										
											2023-08-12 11:54:27 +00:00
										 |  |  | 								background-color: #586e75; | 
					
						
							| 
									
										
										
										
											2023-08-09 22:38:41 +00:00
										 |  |  | 								padding: 1em; | 
					
						
							|  |  |  | 								display: inline-block; | 
					
						
							|  |  |  | 								flex: 1 0; | 
					
						
							|  |  |  | 								text-align: center; | 
					
						
							|  |  |  | 								cursor: pointer; | 
					
						
							|  |  |  | 							} | 
					
						
							|  |  |  | 							[name="tab"]+label:hover { | 
					
						
							|  |  |  | 								background-color: #dc322f; | 
					
						
							|  |  |  | 							} | 
					
						
							|  |  |  | 							[name="tab"]:checked+label { | 
					
						
							|  |  |  | 								background-color: #93a1a1; | 
					
						
							| 
									
										
										
										
											2023-08-12 11:54:27 +00:00
										 |  |  | 								border: 2px solid #eee8d5; | 
					
						
							| 
									
										
										
										
											2023-08-09 22:38:41 +00:00
										 |  |  | 							} | 
					
						
							|  |  |  | 							.error { | 
					
						
							|  |  |  | 								color: #f00; | 
					
						
							|  |  |  | 								border: 1px solid #f00; | 
					
						
							|  |  |  | 								margin: 4px; | 
					
						
							|  |  |  | 								padding: 8px; | 
					
						
							|  |  |  | 							} | 
					
						
							| 
									
										
										
										
											2023-08-12 11:54:27 +00:00
										 |  |  | 							form label { | 
					
						
							|  |  |  | 								padding-top: 1em; | 
					
						
							|  |  |  | 								font-weight: bold; | 
					
						
							|  |  |  | 							} | 
					
						
							|  |  |  | 							form input { | 
					
						
							|  |  |  | 								font-size: x-large; | 
					
						
							|  |  |  | 								padding: 4px; | 
					
						
							|  |  |  | 							} | 
					
						
							|  |  |  | 							input[type="submit"] { | 
					
						
							|  |  |  | 								margin-top: 1em; | 
					
						
							|  |  |  | 								margin-bottom: 1em; | 
					
						
							|  |  |  | 								padding: 1em; | 
					
						
							|  |  |  | 							} | 
					
						
							| 
									
										
										
										
											2023-08-09 22:38:41 +00:00
										 |  |  | 						</style> | 
					
						
							| 
									
										
										
										
											2023-08-12 11:54:27 +00:00
										 |  |  | 						<div style="display: flex; flex-direction: column; max-width: 1280px; margin: auto"> | 
					
						
							| 
									
										
										
										
											2023-08-09 22:38:41 +00:00
										 |  |  | 							<h1 ?hidden=${this.name}>Welcome.</h1> | 
					
						
							|  |  |  | 							<h1 ?hidden=${this.name === undefined}>Welcome, ${this.name}.</h1> | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | 							<div style="display: flex; flex-direction: row; width: 100%"> | 
					
						
							| 
									
										
										
										
											2024-04-13 20:07:39 -04:00
										 |  |  | 								<input type="radio" name="tab" id="login" value="Login" ?checked=${this.tab == 'login'} @change=${() => (self.tab = 'login')}></input> | 
					
						
							| 
									
										
										
										
											2023-08-09 22:38:41 +00:00
										 |  |  | 								<label for="login" id="login_label">Login</label> | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2024-04-13 20:07:39 -04:00
										 |  |  | 								<input type="radio" name="tab" id="register" value="Register" ?checked=${this.tab == 'register'} @change=${() => (self.tab = 'register')}></input> | 
					
						
							| 
									
										
										
										
											2023-08-09 22:38:41 +00:00
										 |  |  | 								<label for="register" id="register_label">Register</label> | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2024-04-13 20:07:39 -04:00
										 |  |  | 								<input type="radio" name="tab" id="guest" value="Guest" ?checked=${this.tab == 'guest'} @change=${() => (self.tab = 'guest')}></input> | 
					
						
							| 
									
										
										
										
											2023-08-09 22:38:41 +00:00
										 |  |  | 								<label for="guest" id="guest_label">Guest</label> | 
					
						
							| 
									
										
										
										
											2023-09-22 22:59:26 +00:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2024-04-13 20:07:39 -04:00
										 |  |  | 								<input type="radio" name="tab" id="change" value="Change Password" ?checked=${this.tab == 'change'} @change=${() => (self.tab = 'change')}></input> | 
					
						
							| 
									
										
										
										
											2023-09-22 22:59:26 +00:00
										 |  |  | 								<label for="change" id="change_label">Change Password</label> | 
					
						
							| 
									
										
										
										
											2023-08-09 22:38:41 +00:00
										 |  |  | 							</div> | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2023-09-22 22:59:26 +00:00
										 |  |  | 							<div ?hidden=${this.tab != 'login' && this.tab != 'register' && this.tab != 'change'}> | 
					
						
							| 
									
										
										
										
											2023-08-09 22:38:41 +00:00
										 |  |  | 								<div id="error" ?hidden=${this.error === undefined} class="error"> | 
					
						
							|  |  |  | 									${this.error} | 
					
						
							|  |  |  | 								</div> | 
					
						
							| 
									
										
										
										
											2023-08-12 11:54:27 +00:00
										 |  |  | 								<form method="POST" style="display: flex; flex-direction: column"> | 
					
						
							|  |  |  | 									<label for="name">Name:</label> | 
					
						
							|  |  |  | 									<input type="text" id="name" name="name"></input> | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2023-09-22 22:59:26 +00:00
										 |  |  | 									<label for="password">${this.tab == 'change' ? 'Old ' : ''}Password:</label> | 
					
						
							| 
									
										
										
										
											2023-08-12 11:54:27 +00:00
										 |  |  | 									<input type="password" id="password" name="password"></input> | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2023-09-22 22:59:26 +00:00
										 |  |  | 									<label ?hidden=${this.tab != 'change'} for="new_password">New Password:</label> | 
					
						
							| 
									
										
										
										
											2023-09-23 21:29:01 +00:00
										 |  |  | 									<input ?hidden=${this.tab != 'change'} type="password" id="new_password" name="new_password"></input> | 
					
						
							| 
									
										
										
										
											2023-09-22 22:59:26 +00:00
										 |  |  | 
 | 
					
						
							|  |  |  | 									<label ?hidden=${this.tab != 'register' && this.tab != 'change'} for="confirm">Confirm ${this.tab == 'change' ? 'New ' : ''}Password:</label> | 
					
						
							|  |  |  | 									<input ?hidden=${this.tab != 'register' && this.tab != 'change'} type="password" id="confirm" name="confirm"></input> | 
					
						
							| 
									
										
										
										
											2023-08-12 11:54:27 +00:00
										 |  |  | 
 | 
					
						
							|  |  |  | 									<input id="loginButton" type="submit" name="submit" value="Login"></input> | 
					
						
							| 
									
										
										
										
											2023-08-09 22:38:41 +00:00
										 |  |  | 									<input type="hidden" name="register" value="${this.tab == 'register' ? 1 : 0}"></input> | 
					
						
							| 
									
										
										
										
											2023-09-22 22:59:26 +00:00
										 |  |  | 									<input type="hidden" name="change" value="${this.tab == 'change' ? 1 : 0}"></input> | 
					
						
							| 
									
										
										
										
											2023-08-09 22:38:41 +00:00
										 |  |  | 								</form> | 
					
						
							|  |  |  | 							</div> | 
					
						
							|  |  |  | 							<div ?hidden=${this.tab != 'guest'}> | 
					
						
							| 
									
										
										
										
											2023-08-12 11:54:27 +00:00
										 |  |  | 								<form method="POST" style="display: flex; flex-direction: column"> | 
					
						
							| 
									
										
										
										
											2023-08-09 22:38:41 +00:00
										 |  |  | 									<input type="submit" id="guestButton" name="guestButton" value="Proceed as Guest"></input> | 
					
						
							|  |  |  | 								</form> | 
					
						
							|  |  |  | 							</div> | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | 							<div ?hidden=${this.have_administrator} class="notice"> | 
					
						
							|  |  |  | 								There is currently no administrator.  You will be made administrator. | 
					
						
							|  |  |  | 							</div> | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | 							<h2>Code of Conduct</h2> | 
					
						
							| 
									
										
										
										
											2023-08-12 11:54:27 +00:00
										 |  |  | 							<textarea readonly rows="20" cols="80" style="resize: none">${this.code_of_conduct}</textarea> | 
					
						
							| 
									
										
										
										
											2023-08-09 22:38:41 +00:00
										 |  |  | 						</div> | 
					
						
							|  |  |  | 					`; | 
					
						
							|  |  |  | 				} | 
					
						
							|  |  |  | 			} | 
					
						
							|  |  |  | 			customElements.define('tf-auth', TfAuthElement); | 
					
						
							|  |  |  | 		</script> | 
					
						
							| 
									
										
										
										
											2016-03-12 18:50:43 +00:00
										 |  |  | 	</body> | 
					
						
							|  |  |  | </html> |