+page.svelte 1.1 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950
  1. <script>
  2. import {enhance} from "$app/forms";
  3. import {untrack} from "svelte";
  4. import {notify} from "$lib/notifier.svelte.js";
  5. let {form} = $props();
  6. let nameInput;
  7. $effect(()=>{
  8. nameInput?.focus();
  9. });
  10. $effect(()=>{
  11. if(form) untrack(()=>{notify("error", form)});
  12. });
  13. </script>
  14. <div class="container">
  15. <form class="standardForm" method="POST" use:enhance>
  16. <h1>Sign Up</h1>
  17. <label>Name
  18. <input name="name" type="text" bind:this={nameInput} required>
  19. </label>
  20. <label>Email
  21. <input name="email" type="email" required>
  22. </label>
  23. <label>Password
  24. <input name="password" type="password" required>
  25. </label>
  26. <label>Confirm Password
  27. <input name="confirmPassword" type="password" required>
  28. </label>
  29. <button class="button">Submit</button>
  30. </form>
  31. </div>
  32. <style>
  33. .container{
  34. display: flex;
  35. justify-content: center;
  36. align-items: center;
  37. width: 100%;
  38. height: calc(100% - 75px);
  39. }
  40. </style>