50 lines
		
	
	
		
			1.7 KiB
		
	
	
	
		
			HTML
		
	
	
	
	
	
			
		
		
	
	
			50 lines
		
	
	
		
			1.7 KiB
		
	
	
	
		
			HTML
		
	
	
	
	
	
<!DOCTYPE html>
 | 
						|
<html lang="en" dir="ltr">
 | 
						|
<head>
 | 
						|
  <%- newrelic %>
 | 
						|
  <link rel="stylesheet" href="/css/logon.css">
 | 
						|
  <script src="/js/warn_message.js" charset="utf-8"></script>
 | 
						|
  <script type="text/javascript">
 | 
						|
    function register() {
 | 
						|
      const pw = document.getElementById("pass").value
 | 
						|
      localStorage.setItem("decryption_key",pw)
 | 
						|
      //yes I know this is not secure, but at this point I think it'd be better to trust the client for end-to-end encryption
 | 
						|
    }
 | 
						|
 | 
						|
    const input = document.getElementById('pass');
 | 
						|
    input.addEventListener('input', () => {
 | 
						|
        if (input.value.length < 10) {
 | 
						|
          input.style.borderColor = 'red';
 | 
						|
          return;
 | 
						|
        }
 | 
						|
        input.style.borderColor = 'green';
 | 
						|
    });
 | 
						|
  </script>
 | 
						|
  <script src="/js/addnavbar.js" charset="utf-8"></script>
 | 
						|
  <link rel="stylesheet" href="/css/global.css">
 | 
						|
</head>
 | 
						|
<body>
 | 
						|
    <header>
 | 
						|
        <h1>Register</h1>
 | 
						|
    </header>
 | 
						|
    <main>
 | 
						|
        <form id="register_form" class="form_class" action="register" method="post">
 | 
						|
            <div class="form_div">
 | 
						|
                <label>Username:</label>
 | 
						|
                <input id="user" class="field_class" name="user" type="text" placeholder="username" autofocus required>
 | 
						|
                <label>Password:</label>
 | 
						|
                <input id="pass" class="field_class" name="pass" type="password" placeholder="password" required>
 | 
						|
                <button class="submit_class" type="submit" form="register_form" onclick="return register()">register</button>
 | 
						|
            </div>
 | 
						|
            <div class="info_div">
 | 
						|
                <p>Do you already have an account? <a href="/login">Login now!</a></p>
 | 
						|
            </div>
 | 
						|
        </form>
 | 
						|
    </main>
 | 
						|
    <footer>
 | 
						|
 | 
						|
    </footer>
 | 
						|
</body>
 | 
						|
 | 
						|
</html>
 |