-
Notifications
You must be signed in to change notification settings - Fork 43
Expand file tree
/
Copy pathcommand-step-loader.html
More file actions
140 lines (140 loc) · 3.81 KB
/
Copy pathcommand-step-loader.html
File metadata and controls
140 lines (140 loc) · 3.81 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
<!doctype html>
<html lang="en">
<head>
<meta charset="UTF-8" />
<meta name="viewport" content="width=device-width,initial-scale=1.0" />
<title>Command Step Loader</title>
<style>
:root {
--g: #33ff33;
--bg: #000;
--p: #0a0a0a;
}
* {
box-sizing: border-box;
font-family: Consolas, monospace;
}
body {
margin: 0;
background: var(--bg);
display: flex;
justify-content: center;
align-items: center;
height: 100vh;
color: var(--g);
}
.crt {
width: min(900px, 95vw);
background: var(--p);
border: 14px solid #222;
border-radius: 18px;
padding: 20px;
box-shadow:
0 0 20px rgba(51, 255, 51, 0.2),
inset 0 0 60px #000;
position: relative;
}
.crt:before {
content: "";
position: absolute;
inset: 0;
pointer-events: none;
background: repeating-linear-gradient(to bottom, rgba(255, 255, 255, 0.03), rgba(0, 0, 0, 0.06) 2px);
}
header {
display: flex;
justify-content: space-between;
border-bottom: 1px solid var(--g);
padding-bottom: 8px;
margin-bottom: 15px;
}
textarea {
width: 100%;
height: 120px;
background: #000;
color: var(--g);
border: 1px solid var(--g);
padding: 10px;
}
button {
background: var(--g);
color: #000;
border: 0;
padding: 8px 14px;
margin: 6px;
cursor: pointer;
font-weight: bold;
}
#cmd {
border: 1px solid var(--g);
padding: 18px;
min-height: 70px;
white-space: pre-wrap;
margin: 12px 0;
}
.small {
opacity: 0.8;
font-size: 0.9rem;
}
</style>
</head>
<body>
<div class="crt">
<header><span>COMMAND_STEP_LOADER v1.0</span><span id="status">READY</span></header>
<textarea id="input" placeholder="Paste commands here, one per line..."></textarea><br />
<button id="load">LOAD LINES</button>
<div class="small" id="progress">0 / 0</div>
<div id="cmd">No command loaded.</div>
<button id="prev">PREVIOUS</button>
<button id="copy">COPY</button>
<button id="next">NEXT</button>
<div class="small" id="msg">Paste commands and click LOAD LINES.</div>
</div>
<script>
let lines = [],
i = 0;
const $ = (id) => document.getElementById(id);
function render() {
if (!lines.length) {
$("cmd").textContent = "No command loaded.";
$("progress").textContent = "0 / 0";
return;
}
$("cmd").textContent = lines[i];
$("progress").textContent = i + 1 + " / " + lines.length;
$("status").textContent = "ACTIVE";
}
$("load").onclick = () => {
lines = $("input")
.value.split(/\r?\n/)
.map((x) => x.trim())
.filter(Boolean);
i = 0;
$("msg").textContent = lines.length ? "Commands loaded." : "No commands found.";
render();
};
$("next").onclick = () => {
if (i < lines.length - 1) {
i++;
render();
}
};
$("prev").onclick = () => {
if (i > 0) {
i--;
render();
}
};
$("copy").onclick = async () => {
if (!lines.length) return;
await navigator.clipboard.writeText(lines[i]);
$("msg").textContent = "Copied!";
setTimeout(() => ($("msg").textContent = "Ready"), 1000);
};
document.addEventListener("keydown", (e) => {
if (e.key === "ArrowRight") $("next").click();
if (e.key === "ArrowLeft") $("prev").click();
});
</script>
</body>
</html>