From 002534d1bb53d4dfff200e3d8d97858e3a0d5ec6 Mon Sep 17 00:00:00 2001
From: Carl Worth <cworth@cworth.org>
Date: Sat, 19 Sep 2020 14:41:45 -0700
Subject: [PATCH] Add some autofocus attributes to several forms

Just trying to make things a little more friendly, (so that, a page
with a single form that has a single text field loads with that field
having focus already).
---
 templates/choose-nickname.html | 2 +-
 templates/empires-game.html    | 2 +-
 templates/login.html           | 2 +-
 3 files changed, 3 insertions(+), 3 deletions(-)

diff --git a/templates/choose-nickname.html b/templates/choose-nickname.html
index 9817b1d..f35abb6 100644
--- a/templates/choose-nickname.html
+++ b/templates/choose-nickname.html
@@ -41,7 +41,7 @@
            {% else %}
            required
            {% endif %}
-           >
+           autofocus>
   </div>
 
   <div class="form-field large">
diff --git a/templates/empires-game.html b/templates/empires-game.html
index 3eb6338..b1d6b7a 100644
--- a/templates/empires-game.html
+++ b/templates/empires-game.html
@@ -50,7 +50,7 @@
   <form id="register-form" onsubmit="register(this); return false">
     <div class="form-field large">
       <label for="character">Character name</label>
-      <input type="text" id="character" autocomplete="off" required>
+      <input type="text" id="character" autocomplete="off" required autofocus>
     </div>
 
     <div class="form-field large">
diff --git a/templates/login.html b/templates/login.html
index 5767316..489870d 100644
--- a/templates/login.html
+++ b/templates/login.html
@@ -40,7 +40,7 @@ function lmno_login(form) {
 <form id="login-form" onsubmit="lmno_login(this); return false">
   <div class="form-field large">
     <label for="username">Username</label>
-    <input type="text" id="username" required>
+    <input type="text" id="username" required autofocus>
   </div>
 
   <div class="form-field large">
-- 
2.45.2