Pen Settings

HTML

CSS

CSS Base

Vendor Prefixing

Add External Stylesheets/Pens

Any URLs added here will be added as <link>s in order, and before the CSS in the editor. You can use the CSS from another Pen by using its URL and the proper URL extension.

+ add another resource

JavaScript

Babel includes JSX processing.

Add External Scripts/Pens

Any URL's added here will be added as <script>s in order, and run before the JavaScript in the editor. You can use the URL of any other Pen and it will include the JavaScript from that Pen.

+ add another resource

Packages

Add Packages

Search for and use JavaScript packages from npm here. By selecting a package, an import statement will be added to the top of the JavaScript editor for this package.

Behavior

Auto Save

If active, Pens will autosave every 30 seconds after being saved once.

Auto-Updating Preview

If enabled, the preview panel updates automatically as you code. If disabled, use the "Run" button to update.

Format on Save

If enabled, your code will be formatted when you actively save your Pen. Note: your code becomes un-folded during formatting.

Editor Settings

Code Indentation

Want to change your Syntax Highlighting theme, Fonts and more?

Visit your global Editor Settings.

HTML

              
                <!DOCTYPE html>
<html lang="en">
  <head>
    <meta charset="UTF-8" />
    <meta name="viewport" content="width=device-width, initial-scale=1.0" />
    <meta name="application-name" content="XSTROKE EE" />
    <meta name="author" name="Emmanuel Onah AfricLite" />
    <meta name="keywords" name="XSTROKE EE,Expert System,Stroke Application,AfricLite Systems,AfricLite,Estonia Stroke Preventor" />
    <title>Sign up| XSTROKE EE</title>
    <!-- Browser Fav icon -->
    <link rel="icon" href="https://i.ibb.co/bsFfPhM/logo.jpg" />
    <!-- Google Fonts -->
    <link href="https://fonts.googleapis.com/css2?family=Roboto&display=swap" rel="stylesheet" />
    <link href="https://fonts.googleapis.com/css2?family=Metal+Mania&display=swap" rel="stylesheet" />
    <!-- Font Awesome -->
    <script src="https://kit.fontawesome.com/054170e3d7.js" crossorigin="anonymous"></script>
    <!-- Styles -->
    <link rel="stylesheet" href="./src/styles/&__general.style.css" />
    <link rel="stylesheet" href="./src/styles/&__header.style.css" />
    <link rel="stylesheet" href="./src/styles/login.style.css" />
    <link rel="stylesheet" href="./src/styles/&__error-404.style.css" />
    <link rel="stylesheet" href="./src/styles/&__error&success.modal.style.css" />
    <link rel="stylesheet" href="./src/styles/signup.style.css" />
  </head>
  <body class="view--body">
    <div class="container signup--container form--container" role="main">
      <a href="./index" aria-describedat="This is an icon button that takes you back to the landing page"><i class="fa fa-home"></i></a>

      <div class="img--form--wrapper">
        <img src="https://i.ibb.co/GTcwdQQ/sign-up-bg.png" alt="" class="login--bg--img" />

        <div class="login--container--row--two form--wrapper">
          <h2 class="logo">🩺XSTROKE EE</h2>
          <h1>Signup</h1>
          <p class="new--to--xstroke">Already have account? <a href="./login">Log in</a></p>
          <form class="signup--form">
            <label for="user_name">Usernamae</label>
            <input type="text" name="user_name" id="userName" placeholder="Username must be atleast 3 char" required />

            <label for="email">Email</label>
            <input type="email" name="email" id="email" placeholder="You email address" required />

            <label for="password">Password</label>
            <input type="password" name="password" id="password" placeholder="Password must alphanumeric (@, _ and - are also allowed) and be 8 - 20 char" required />

            <label for="estonianId">Estonian ID</label>
            <input type="text" name="estonian_id" id="estonianId" placeholder="32922xxxx12" required />
            <input type="submit" value="Signup" id="signup" aria-label="Click to signup" />

            <p class="terms--and--privacy">By continuing you accept our <a href="./terms">Terms of Use</a> and <a href="./privacy-policy">Privacy Policy</a>.</p>
          </form>
        </div>
      </div>
    </div>

    <!-- Noscript tage -->
    <noscript class="noscript">
      <img src="https://i.ibb.co/GvFWHTZ/error-404.png" alt="" />
      <h1>Something's missing</h1>
      <p>
        For full functionality of this site its necessary you enable javascript.
        <a href="https://www.enablejavascript.io/?gclid=CjwKCAjw2Jb7BRBHEiwAXTR4jQ40-Y6EICxN9eW1ZQtde2VXpkAXUvydxTrTr6qRjw22VYudSjubJxoCt4IQAvD_BwE" taregt="_blank">Instructions on how to do that</a>
      </p>
    </noscript>
   
  </body>
</html>

              
            
!

CSS

              
                @import url("https://fonts.googleapis.com/css2?family=Londrina+Sketch&display=swap");

/* variables */
:root {
  --primary: #fff;
  --secondary: #000;
  --tertiary: #011220;
  --doctorate: #1e90ff;
}


* {
  margin: 0;
  padding: 0;
  line-height: 1.6;
  font-family: "Roboto", sans-serif;
  box-sizing: border-box;
  scroll-behavior: smooth;
}

html {
  font-size: 16px;
}

body {
  scroll-behavior: smooth;
}

.view--body {
  padding: 50px 50px;
  background-image: url(https://i.ibb.co/HKD3GbM/auth-bg.png);
  background-repeat: repeat;
  background-position: center;
}

.container {
  width: 100%;
  margin: 0 auto;
  padding: 10px 20px 20px 20px;
}

h1 {
  font-size: 1.5rem;
}

p {
  font-size: 0.8rem;
}

h3 {
  font-size: 0.9rem;
}

button {
  cursor: pointer;
  width: 170px;
  height: 40px;
  font-size: 0.8rem;
  background: var(--tertiary);
  border: 0;
  color: var(--primary);
  margin-top: 20px;
}

img {
  display: block;
}

li {
  list-style: none;
}

a {
  text-decoration: none;
  cursor: pointer;
}

a:link {
}

a:hover {
}

a:active {
}

a:visited {
}

:disabled {
}

:required {
  outline: none;
  box-shadow: none;
}

:focus {
  outline: none;
}

::placeholder {
  color: #6b6b6b;
}

/* Form Styling */
form {
  display: flex;
  flex-direction: column;
}

form input:not([type="submit"]) {
  background: transparent;
  border: 0;
  border-bottom: solid 1px var(--tertiary);
}

label {
  font-size: 0.8rem;
  padding: 15px 0;
}

button,
input[type="submit"],
input[type="checkbox"] {
  cursor: pointer;
}

.logo {
  font-size: 0.9rem;
  font-family: "Metal Mania", cursive;
}

/* mini ipad screen*/
@media screen and (min-width: 620px) {
}

/* max ipad and mini laptop screen*/
@media screen and (min-width: 960px) {
  html {
    font-size: 18px;
  }
}

/* desktop screen*/
@media screen and (min-width: 960px) {
  html {
    font-size: 20px;
  }

  .heading--h1 {
    color: var(--tertiary);
    font-size: 2.5rem;
    font-family: "Londrina Sketch", cursive;
  }

  #email:focus,
  #password:focus,
  #estonianId:focus,
  #userName:focus,
  #resetEmail:focus,
  .auth--input:focus {
    border: solid 0.5px #333;
    padding: 20px 5px;
    border-left: solid 3px #02335c;
  }
}


/* Mobile */
.noscript {
  width: 100%;
  padding: 10px 30px;
  text-align: center;
  background-color: var(--primary);
  border-radius: 30px;
  box-shadow: 2px 2px 5px 4px #ececec;
  box-sizing: border-box;
}

.noscript img {
  width: 80% !important;
  margin: 0 auto;
}

.noscript h1 {
  font-size: 1.2rem;
}

.form--container {
  background-color: var(--primary);
  width: 100%;
  display: flex;
  flex-direction: column;
  border-radius: 20px;
}

.fa-home {
  color: var(--secondary);
  text-align: right;
}

.login--bg--img {
  max-width: 80%;
  margin: 0 auto;
}

.login--container--row--two h2 {
  font-size: 0.9rem;
  padding: 30px 0;
  color: var(--tertiary);
  font-family: "Metal Mania", cursive;
}

.login--container--row--two h1 {
  padding-bottom: 10px;
}

.new--to--xstroke {
  font-size: 0.8rem;
}

.login--container--row--two a {
  font-size: 0.8rem;
  color: var(--doctorate);
  text-decoration: underline;
}

input[type="submit"] {
  padding: 10px 10px;
  background-color: var(--tertiary);
  color: var(--primary);
  border: 0;
  font-size: 0.9rem;
  margin-top: 20px;
  border-radius: 5px;
}

.or--login--with {
  font-size: 0.9rem;
  padding: 10px 0;
}

.estonian__id {
  font-size: 0.8rem;
  width: 100px;
  background: linear-gradient(to right, var(--doctorate), var(--tertiary));
  border-radius: 50px;
}

.checkbox--wrapper {
  margin-top: 20px;
}

label[for="rememberDevice"] {
  padding: 0 10px;
}

.terms--and--privacy {
  font-size: 0.8rem;
  padding-top: 20px;
}

a[href="../../index.html"] {
  color: var(--secondary);
}

/* mini ipad screen*/
@media screen and (min-width: 768px) {
  .img--form--wrapper {
    padding: 0 60px;
  }
}

/* max ipad and mini laptop screen*/
@media screen and (min-width: 960px) {
  html {
    font-size: 16px;
  }

  .img--form--wrapper {
    padding: 0 100px;
  }
}

/* desktop screen*/
@media screen and (min-width: 1000px) {
  html {
    font-size: 16px;
  }

  .img--form--wrapper {
    width: 100%;
    margin: 0 auto;
    padding: 0 30px;
    display: flex;
  }

  .login--bg--img {
    width: 50%;
    padding: 0;
  }

  .login--container--row--two {
    width: 40%;
    margin: 0 auto;
  }
  .login--container--row--two form {
    width: 100%;
  }
}

              
            
!

JS

              
                ///import utility function for api request here
window.addEventListener("DOMContentLoaded", _ => {
  const form = document.querySelector(".signup--form");
  const RegExp = {
    user_name: /^[a-z]{2,}$/i,
    email: /^([a-z\d\.-]+)@([a-z\d-]+)\.([a-z]{2,8})(\.[a-z]{2,8})?$/,
    password: /^[\w@-]{8,20}$/i,
    estonian_id: /^[\d]{10}$/,
  };

  ///1...form verification
  form.addEventListener("keydown", e => {
    if (RegExp[e.target.name].test(e.target.value)) {
      e.target.style.borderBottomColor = "green";
    } else {
      e.target.style.borderBottomColor = "red";
    }
  });

  ///2...user signup function
  const signupUser = _ => {
    form.addEventListener("submit", e => {
      e.preventDefault();

      const signupData = {
        user_name: form.user_name.value,
        email: form.email.value,
        password: form.password.value,
        estonian_id: form.estonian_id.value,
      };

      ///its your choice to use RegExp to test the value again before send it to backend
      ///Below is simply how to test it again,note i did not borther to test this second validation but i belief it should work for you
      const { user_name, email, password, estonian_id } = signupData;
      if (RegExp.user_name.test(user_name) && RegExp.email.test(email) && RegExp.password.test(password) && RegExp.estonian_id.test(estonian_id)) {
        ///ajax call here to send data to backend or possibly api utility func/method
        /// send the signupData object to the backend
      } else {
        ///Best place to invoke error modal
      }
    });
  };
  signupUser();
});

              
            
!
999px

Console