byte-launcher 1.1.0 → 1.2.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/index.html +12 -6
- package/package.json +1 -1
package/index.html
CHANGED
|
@@ -4,8 +4,8 @@
|
|
|
4
4
|
<meta charset="utf-8">
|
|
5
5
|
<meta name="viewport" content="width=device-width,initial-scale=1">
|
|
6
6
|
<meta name="robots" content="noindex">
|
|
7
|
-
<title
|
|
8
|
-
<link rel="icon" href="data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg'
|
|
7
|
+
<title>‎</title>
|
|
8
|
+
<link rel="icon" id="icon" href="data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg'/%3E">
|
|
9
9
|
<style>
|
|
10
10
|
html, body { margin: 0; height: 100%; background: #000; overflow: hidden; color: #dbe4ff; font: 16px/1.5 system-ui, sans-serif; }
|
|
11
11
|
/* 1. Nothing but black until the first click or key press. */
|
|
@@ -38,7 +38,7 @@
|
|
|
38
38
|
<h1>BYTE launcher</h1>
|
|
39
39
|
<p class="lead">Pick what to open.</p>
|
|
40
40
|
<div class="grid" id="apps"></div>
|
|
41
|
-
<p class="tip">To
|
|
41
|
+
<p class="tip">To open another app, use your browser's Back button, then click the black page.</p>
|
|
42
42
|
</div></div>
|
|
43
43
|
<div id="msg"><p>That did not load here.<br><a id="direct" rel="noopener">Open it directly</a></p></div>
|
|
44
44
|
<script>
|
|
@@ -75,8 +75,8 @@
|
|
|
75
75
|
timer = setTimeout(function () { if (!loaded && frame === f) $('msg').style.display = 'grid'; }, 15000);
|
|
76
76
|
try { history.pushState({ app: app.id }, ''); } catch (e) {}
|
|
77
77
|
}
|
|
78
|
-
// The browser's Back button leaves the app
|
|
79
|
-
addEventListener('popstate', function () { if (frame) closeApp(); });
|
|
78
|
+
// The browser's Back button leaves the app; the page goes black again until the next click.
|
|
79
|
+
addEventListener('popstate', function () { if (frame) { closeApp(); cover(); } });
|
|
80
80
|
|
|
81
81
|
APPS.forEach(function (app) {
|
|
82
82
|
var b = document.createElement('button');
|
|
@@ -88,12 +88,18 @@
|
|
|
88
88
|
$('apps').appendChild(b);
|
|
89
89
|
});
|
|
90
90
|
|
|
91
|
+
// While black, the tab has no name and no icon either.
|
|
92
|
+
var ICON = "data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 32 32'%3E%3Crect width='32' height='32' rx='8' fill='%231d6cff'/%3E%3Ctext x='16' y='23' font-size='20' font-weight='700' text-anchor='middle' fill='%23fff' font-family='Georgia,serif'%3EB%3C/text%3E%3C/svg%3E", BLANK = $('icon').href;
|
|
93
|
+
function cover() { $('cover').hidden = false; $('launcher').hidden = true; document.title = '\u200e'; $('icon').href = BLANK; }
|
|
91
94
|
function uncover() {
|
|
92
95
|
if ($('cover').hidden) return;
|
|
93
96
|
$('cover').hidden = true;
|
|
94
97
|
$('launcher').hidden = false;
|
|
95
|
-
|
|
98
|
+
document.title = 'BYTE'; $('icon').href = ICON;
|
|
99
|
+
// Came in on a link to one website (…?url=…): after the click, open BYTE straight on it.
|
|
100
|
+
if (want) { var u = want; want = ''; try { history.replaceState(null, '', location.pathname); } catch (e) {} openApp({ id: 'byte', name: 'BYTE', url: BYTE_SITE + '/browse?url=' + encodeURIComponent(u) }); }
|
|
96
101
|
}
|
|
102
|
+
var want = ''; try { want = new URLSearchParams(location.search).get('url') || ''; } catch (e) {}
|
|
97
103
|
$('cover').addEventListener('click', uncover);
|
|
98
104
|
addEventListener('keydown', uncover);
|
|
99
105
|
</script>
|