drop.chapril.org-firefoxsend/android/pages/home.js

41 lines
1.1 KiB
JavaScript
Raw Normal View History

2018-08-16 18:07:12 +02:00
const html = require('choo/html');
export default function mainPage(state, emit) {
function clickPreferences(event) {
event.preventDefault();
emit('pushState', '/preferences');
}
2018-08-16 18:07:12 +02:00
function uploadFile(event) {
event.preventDefault();
const target = event.target;
const file = target.files[0];
if (file.size === 0) {
return;
}
emit('pushState', '/upload');
emit('addFiles', { files: [file] });
emit('upload', {});
}
return html`<body>
<div id="white">
<div id="centering">
<a href="#" onclick=${clickPreferences}>
preferenes
</a>
2018-08-16 18:07:12 +02:00
<img src=${state.getAsset('encrypted-envelope.png')} />
<h4>Private, Encrypted File Sharing</h4>
<div>
Send files through a safe, private, and encrypted link that automatically expires to ensure your stuff does not remain online forever.
</div>
<div id="spacer">
</div>
<label id="label" for="input">
<img src=${state.getAsset('cloud-upload.png')} />
</label>
<input id="input" name="input" type="file" onchange=${uploadFile} />
</div>
</div>
</body>`;
}