2018-08-16 16:07:12 +00:00
|
|
|
const html = require('choo/html');
|
|
|
|
|
|
|
|
export default function mainPage(state, emit) {
|
2018-09-06 22:56:04 +00:00
|
|
|
function clickPreferences(event) {
|
|
|
|
event.preventDefault();
|
|
|
|
emit('pushState', '/preferences');
|
|
|
|
}
|
2018-09-24 16:30:27 +00:00
|
|
|
|
2018-08-16 16:07:12 +00:00
|
|
|
function uploadFile(event) {
|
|
|
|
event.preventDefault();
|
|
|
|
const target = event.target;
|
|
|
|
const file = target.files[0];
|
|
|
|
if (file.size === 0) {
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
|
2018-09-24 16:30:27 +00:00
|
|
|
emit('pushState', '/options');
|
2018-08-16 16:07:12 +00:00
|
|
|
emit('addFiles', { files: [file] });
|
|
|
|
}
|
2018-09-24 16:30:27 +00:00
|
|
|
|
2018-08-16 16:07:12 +00:00
|
|
|
return html`<body>
|
|
|
|
<div id="white">
|
|
|
|
<div id="centering">
|
2018-09-24 16:30:27 +00:00
|
|
|
<img id="top-banner" src=${state.getAsset('top-banner.png')} />
|
|
|
|
<a id="hamburger" href="#" onclick=${clickPreferences}>
|
|
|
|
<img src=${state.getAsset('preferences.png')} />
|
2018-09-06 22:56:04 +00:00
|
|
|
</a>
|
2018-08-16 16:07:12 +00: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>`;
|
|
|
|
}
|