Add form-fill UIWorker example
A ReplyToolMixin UIWorker that fills inputs (fills) and toggles checkboxes / presses submit (click) by voice — the state-changing half of the standard action set.
This commit is contained in:
88
examples/multi-worker/ui-worker/form-fill/client/index.html
Normal file
88
examples/multi-worker/ui-worker/form-fill/client/index.html
Normal file
@@ -0,0 +1,88 @@
|
||||
<!doctype html>
|
||||
<html lang="en">
|
||||
<head>
|
||||
<meta charset="UTF-8" />
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
|
||||
<title>Form fill — UIAgent demo</title>
|
||||
<link rel="stylesheet" href="./styles.css" />
|
||||
</head>
|
||||
<body>
|
||||
<header>
|
||||
<h1>Application form</h1>
|
||||
<button id="connect" type="button">Connect</button>
|
||||
</header>
|
||||
|
||||
<main>
|
||||
<form id="application-form" aria-label="Job application">
|
||||
<h2>Apply for: Software Engineer</h2>
|
||||
<p class="hint">
|
||||
Tell the assistant what to put in any field. Try: "my name
|
||||
is John Smith, my email is john at gmail dot com". When
|
||||
you're ready, say "submit".
|
||||
</p>
|
||||
|
||||
<fieldset>
|
||||
<legend>Your details</legend>
|
||||
|
||||
<div class="field">
|
||||
<label for="first-name">First name</label>
|
||||
<input id="first-name" name="first_name" type="text" autocomplete="given-name" />
|
||||
</div>
|
||||
|
||||
<div class="field">
|
||||
<label for="last-name">Last name</label>
|
||||
<input id="last-name" name="last_name" type="text" autocomplete="family-name" />
|
||||
</div>
|
||||
|
||||
<div class="field">
|
||||
<label for="email">Email address</label>
|
||||
<input id="email" name="email" type="email" autocomplete="email" />
|
||||
</div>
|
||||
|
||||
<div class="field">
|
||||
<label for="phone">Phone (optional)</label>
|
||||
<input id="phone" name="phone" type="tel" autocomplete="tel" />
|
||||
</div>
|
||||
</fieldset>
|
||||
|
||||
<fieldset>
|
||||
<legend>About you</legend>
|
||||
|
||||
<div class="field">
|
||||
<label for="experience">Years of relevant experience</label>
|
||||
<input id="experience" name="experience" type="text" inputmode="numeric" />
|
||||
</div>
|
||||
|
||||
<div class="field">
|
||||
<label for="cover">Why are you interested?</label>
|
||||
<textarea id="cover" name="cover" rows="5"></textarea>
|
||||
</div>
|
||||
</fieldset>
|
||||
|
||||
<fieldset>
|
||||
<legend>Confirm</legend>
|
||||
|
||||
<div class="field checkbox-field">
|
||||
<input id="terms" name="terms" type="checkbox" />
|
||||
<label for="terms">I agree to the terms of service.</label>
|
||||
</div>
|
||||
|
||||
<div class="field checkbox-field">
|
||||
<input id="newsletter" name="newsletter" type="checkbox" />
|
||||
<label for="newsletter">Send me product updates.</label>
|
||||
</div>
|
||||
</fieldset>
|
||||
|
||||
<div class="actions">
|
||||
<button id="submit" type="submit">Submit application</button>
|
||||
<span id="form-status" aria-live="polite"></span>
|
||||
</div>
|
||||
</form>
|
||||
</main>
|
||||
|
||||
<div id="status" aria-live="polite"></div>
|
||||
<audio id="bot-audio" autoplay data-a11y-exclude></audio>
|
||||
|
||||
<script type="module" src="./main.js"></script>
|
||||
</body>
|
||||
</html>
|
||||
Reference in New Issue
Block a user