hypow 0.0.0-stage → 0.1.0
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/dist/cli.html +103 -0
- package/dist/cli.js +1025 -0
- package/dist/hypow-miner.js +63 -0
- package/dist/search-worker.js +35 -0
- package/package.json +34 -4
- package/README.md +0 -3
package/dist/cli.html
ADDED
|
@@ -0,0 +1,103 @@
|
|
|
1
|
+
<!doctype html>
|
|
2
|
+
<html lang="en">
|
|
3
|
+
<head>
|
|
4
|
+
<meta charset="utf-8">
|
|
5
|
+
<meta name="viewport" content="width=device-width, initial-scale=1">
|
|
6
|
+
<title>hypow miner · authorize</title>
|
|
7
|
+
<link rel="preconnect" href="https://fonts.googleapis.com">
|
|
8
|
+
<link rel="preconnect" href="https://fonts.gstatic.com" crossorigin>
|
|
9
|
+
<link href="https://fonts.googleapis.com/css2?family=Martian+Mono:wght@300;400;600&display=swap" rel="stylesheet">
|
|
10
|
+
<!-- The CLI's authorize page: the site's miner pane, alone. Served by src/authorize.ts. -->
|
|
11
|
+
<style>
|
|
12
|
+
:root {
|
|
13
|
+
--paper: #0f1a1f; --ink: #f6fefd; --ink-2: #949e9c; --line: #3b4a50; --rule: #273035; --well: #0a1216; --signal: #50d2c1;
|
|
14
|
+
--mono: "Martian Mono", ui-monospace, Menlo, monospace;
|
|
15
|
+
}
|
|
16
|
+
* { box-sizing: border-box; }
|
|
17
|
+
html, body { margin: 0; height: 100%; background: var(--paper); color: var(--ink); -webkit-font-smoothing: antialiased; }
|
|
18
|
+
[hidden] { display: none !important; }
|
|
19
|
+
button:focus-visible, input:focus-visible { outline: 1px solid var(--signal); outline-offset: 2px; }
|
|
20
|
+
main { height: 100%; max-width: 52rem; margin: 0 auto; padding: 1.6rem 2rem; display: flex; flex-direction: column; font: 400 .72rem/1.7 var(--mono); }
|
|
21
|
+
.head { display: flex; justify-content: space-between; align-items: center; border-bottom: 1px solid var(--line); padding-bottom: .7rem; }
|
|
22
|
+
.head b { font-weight: 600; font-size: .8rem; }
|
|
23
|
+
.head b span { font-weight: 400; color: var(--ink-2); font-size: .66rem; margin-left: .6rem; }
|
|
24
|
+
|
|
25
|
+
/* the terminal: log, the CLI's status box, suggestions, then the prompt */
|
|
26
|
+
.term { flex: 1; min-height: 0; display: flex; flex-direction: column; margin-top: .9rem; background: var(--well); border: 1px solid var(--rule); border-radius: 4px; font: 400 .68rem/1.75 var(--mono); cursor: text; }
|
|
27
|
+
.term-out { flex: 1; min-height: 0; overflow-y: auto; padding: .7rem .9rem .3rem; scrollbar-width: thin; scrollbar-color: var(--rule) transparent; }
|
|
28
|
+
/* time | label | message, wrapped lines hanging under the message like the CLI's columns */
|
|
29
|
+
.term-out .row { display: grid; grid-template-columns: 8ch 11ch minmax(0, 1fr); column-gap: 1.2ch; overflow-wrap: anywhere; }
|
|
30
|
+
.term-out .time { color: var(--ink-2); }
|
|
31
|
+
.term-out .label, .term-out .dim { color: var(--ink-2); }
|
|
32
|
+
.term-out [data-tone="good"] .label { color: var(--signal); }
|
|
33
|
+
.term-out [data-tone="info"] .label { color: #97fce4; }
|
|
34
|
+
.term-out [data-tone="warn"] .label { color: #d9b86a; }
|
|
35
|
+
.term-out [data-tone="bad"] .label { color: #ed7088; }
|
|
36
|
+
.term-out [data-tone="cmd"] .label, .term-out [data-tone="cmd"] .message { color: var(--ink); }
|
|
37
|
+
.menu { margin: .15rem 0 .35rem; }
|
|
38
|
+
.menu .t { display: block; color: var(--ink); font-weight: 600; }
|
|
39
|
+
.menu button { display: block; width: 100%; background: none; border: 0; padding: 0 0 0 1.3rem; font: inherit; color: var(--ink-2); cursor: pointer; text-align: left; position: relative; white-space: pre-wrap; }
|
|
40
|
+
.menu button[aria-selected="true"] { color: var(--signal); }
|
|
41
|
+
.menu button[aria-selected="true"]::before { content: "❯"; position: absolute; left: .1rem; }
|
|
42
|
+
.menu button:focus-visible { outline: none; }
|
|
43
|
+
.menu .hint { display: block; color: var(--ink-2); opacity: .7; margin-top: .15rem; }
|
|
44
|
+
/* the closing note, once the CLI is authorized */
|
|
45
|
+
.term-out .note { margin: .8rem 0 .4rem; border: 1px solid var(--signal); border-radius: 3px; padding: .7rem .9rem; }
|
|
46
|
+
.term-out .note .t { display: block; color: var(--signal); font-weight: 600; font-size: .8rem; }
|
|
47
|
+
.term-out .note .t::before { content: "✓ "; }
|
|
48
|
+
.term-out .note p { margin: .3rem 0 0; color: var(--ink); }
|
|
49
|
+
.term-box { margin: .2rem .9rem .5rem; border: 1px solid var(--rule); border-radius: 3px; padding: .25rem .6rem; color: var(--ink); }
|
|
50
|
+
.term-box div { display: grid; grid-template-columns: 9ch minmax(0, 1fr); overflow-wrap: anywhere; }
|
|
51
|
+
.term-box .label { color: var(--ink-2); }
|
|
52
|
+
.term-suggest { border-top: 1px solid var(--rule); padding: .35rem .9rem; }
|
|
53
|
+
.term-line { display: flex; gap: .6rem; align-items: center; border-top: 1px solid var(--rule); padding: .5rem .9rem; }
|
|
54
|
+
.term-prompt { color: var(--signal); white-space: nowrap; }
|
|
55
|
+
.term-in { flex: 1; min-width: 0; background: none; border: 0; outline: none; color: var(--ink); font: inherit; caret-color: var(--signal); padding: 0; }
|
|
56
|
+
.term-in:focus-visible { outline: none; }
|
|
57
|
+
.term-in::placeholder { color: var(--ink-2); opacity: .6; }
|
|
58
|
+
.always { margin: .7rem 0 0; color: var(--ink-2); font-size: .66rem; line-height: 1.9; }
|
|
59
|
+
|
|
60
|
+
/* header wallet control: "connect wallet" or the owner, with a small dropdown */
|
|
61
|
+
.wallet { position: relative; }
|
|
62
|
+
.wallet .btn { font: 400 .62rem/1 var(--mono); color: var(--ink-2); background: none; border: 1px solid var(--rule); border-radius: 3px; padding: .35rem .5rem; cursor: pointer; }
|
|
63
|
+
.wallet .btn:hover, .wallet .btn:focus-visible { color: var(--signal); border-color: var(--signal); }
|
|
64
|
+
.wallet .drop { position: absolute; right: 0; top: calc(100% + .3rem); z-index: 2; min-width: 12rem; background: var(--paper); border: 1px solid var(--rule); border-radius: 3px; padding: .25rem 0; }
|
|
65
|
+
.wallet .drop button { display: block; width: 100%; text-align: left; background: none; border: 0; padding: .35rem .7rem; font: 400 .66rem/1.4 var(--mono); color: var(--ink); cursor: pointer; }
|
|
66
|
+
.wallet .drop button:hover, .wallet .drop button:focus-visible { color: var(--signal); }
|
|
67
|
+
/* connect popup: the wallets the browser has, one row each */
|
|
68
|
+
dialog.connect { width: calc(100% - 2rem); max-width: 22rem; padding: 1rem 1.1rem 1.1rem; border: 1px solid var(--line); border-radius: 4px; background: var(--paper); color: var(--ink); font: 400 .72rem/1.6 var(--mono); }
|
|
69
|
+
dialog.connect::backdrop { background: #04060caa; }
|
|
70
|
+
.connect-head { display: flex; justify-content: space-between; align-items: center; }
|
|
71
|
+
.connect-head .title { font-weight: 600; font-size: .8rem; }
|
|
72
|
+
.connect-head .x { background: none; border: 0; color: var(--ink-2); font: 400 1.1rem/1 var(--mono); cursor: pointer; padding: 0 .2rem; }
|
|
73
|
+
.connect-head .x:hover { color: var(--signal); }
|
|
74
|
+
dialog.connect .dim { display: block; color: var(--ink-2); font-size: .66rem; margin: .35rem 0 .9rem; }
|
|
75
|
+
.connect-list { display: flex; flex-direction: column; gap: .4rem; }
|
|
76
|
+
.connect-row { display: flex; align-items: center; gap: .7rem; width: 100%; background: var(--well); border: 1px solid var(--rule); border-radius: 3px; padding: .6rem .7rem; font: inherit; color: var(--ink); cursor: pointer; text-align: left; }
|
|
77
|
+
.connect-row:hover, .connect-row:focus-visible { border-color: var(--signal); color: var(--signal); outline: none; }
|
|
78
|
+
.connect-row img { width: 20px; height: 20px; border-radius: 4px; }
|
|
79
|
+
.connect-empty { margin: 0; color: var(--ink-2); font-size: .66rem; }
|
|
80
|
+
|
|
81
|
+
@media (max-width: 520px) {
|
|
82
|
+
main { padding: 1rem; }
|
|
83
|
+
.head b span { display: none; }
|
|
84
|
+
.term-out .row { grid-template-columns: 11ch minmax(0, 1fr); }
|
|
85
|
+
.term-out .time { display: none; }
|
|
86
|
+
}
|
|
87
|
+
</style>
|
|
88
|
+
</head>
|
|
89
|
+
<body>
|
|
90
|
+
<main>
|
|
91
|
+
<div class="head"><b>hypow · miner<span>localhost:4747 · on this machine</span></b><div class="wallet" id="wallet"></div></div>
|
|
92
|
+
<div class="term">
|
|
93
|
+
<div class="term-out" id="miner-log" role="log" aria-live="polite"></div>
|
|
94
|
+
<div class="term-box" id="miner-status">loading…</div>
|
|
95
|
+
<div class="term-suggest" id="miner-suggest" hidden></div>
|
|
96
|
+
<label class="term-line" id="miner-line"><span class="term-prompt" id="miner-prompt">connect ›</span><input class="term-in" id="miner-input" spellcheck="false" autocomplete="off" autocapitalize="off" aria-label="Miner input"></label>
|
|
97
|
+
</div>
|
|
98
|
+
<p class="always">Your wallet stays in this browser. Close this tab once you're done; the miner runs in your terminal.</p>
|
|
99
|
+
</main>
|
|
100
|
+
<script type="application/json" id="hypow-cli">/*CONFIG*/</script>
|
|
101
|
+
<script src="hypow-miner.js"></script>
|
|
102
|
+
</body>
|
|
103
|
+
</html>
|