Add a dummy user interface
This commit is contained in:
parent
c24b34806c
commit
fe48a8e07a
2 changed files with 50 additions and 0 deletions
10
pwa/app.js
10
pwa/app.js
|
@ -46,6 +46,16 @@ class Account {
|
|||
console.log('Sub-addr: ' + test_addr.genSubAddr('test'));
|
||||
});
|
||||
|
||||
document.querySelector('#btn-generate').addEventListener('click', (event) => {
|
||||
event.preventDefault();
|
||||
console.log('TODO: address generation');
|
||||
['a', 'b'].forEach((e) => {
|
||||
const test_addr = new Account(e, '+', 'example.org', '11voiefK5PgCX5F1TTcuoQ==');
|
||||
console.log(test_addr);
|
||||
console.log('Sub-addr: ' + test_addr.genSubAddr('test'));
|
||||
});
|
||||
});
|
||||
|
||||
window.addEventListener('load', () => {
|
||||
if ('serviceWorker' in navigator) {
|
||||
navigator.serviceWorker.register('/sw.js');
|
||||
|
|
|
@ -12,5 +12,45 @@
|
|||
<script src="app.js" defer></script>
|
||||
</head>
|
||||
<body>
|
||||
<section class="section">
|
||||
<div class="container">
|
||||
<div class="columns is-centered">
|
||||
<div class="column is-three-fifths">
|
||||
<h1 class="title is-1">New email address</h1>
|
||||
<form action="" method="get">
|
||||
<label class="label" for="account-name">Account</label>
|
||||
<div class="field has-addons">
|
||||
<div class="control is-expanded">
|
||||
<div class="select is-fullwidth">
|
||||
<select id="account-name">
|
||||
<option>a@example.org</option>
|
||||
<option>b@example.com</option>
|
||||
</select>
|
||||
</div>
|
||||
</div>
|
||||
<p class="control">
|
||||
<a class="button is-primary" id="btn-add-account">New</a>
|
||||
</p>
|
||||
</div>
|
||||
<div class="field">
|
||||
<label class="label" for="sub-addr-name">Name</label>
|
||||
<div class="control">
|
||||
<input class="input" type="text" id="sub-addr-name" placeholder="Text input">
|
||||
</div>
|
||||
</div>
|
||||
<div class="field">
|
||||
<label class="label" for="generated-addr">Address</label>
|
||||
<div class="control">
|
||||
<input class="input" type="text" id="generated-addr" disabled>
|
||||
</div>
|
||||
</div>
|
||||
<div class="control has-text-centered">
|
||||
<button class="button is-primary" id="btn-generate">Generate</button>
|
||||
</div>
|
||||
</form>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</section>
|
||||
</body>
|
||||
</html>
|
||||
|
|
Loading…
Reference in a new issue