-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathindex.html
More file actions
153 lines (149 loc) · 5.36 KB
/
Copy pathindex.html
File metadata and controls
153 lines (149 loc) · 5.36 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
141
142
143
144
145
146
147
148
149
150
151
152
153
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<meta name="color-scheme" content="dark">
<title>netns.dev — network namespace</title>
<meta name="description" content="netns.dev — dot matrix gate to the namespace.">
<link rel="icon" type="image/svg+xml" href="favicon.svg">
<link rel="apple-touch-icon" href="apple-touch-icon.png">
<meta name="theme-color" content="#010503">
<style>
*{ margin:0; box-sizing:border-box; }
body{
background:#010503;
background-image:radial-gradient(900px 600px at 50% 20%, rgba(0,120,70,.16), transparent 70%);
color:#00e69c;
font-family:"SF Mono","JetBrains Mono","Fira Code",Menlo,Consolas,"Liberation Mono",monospace;
min-height:100vh;
display:grid; place-items:center; padding:20px;
}
body::after{
content:""; position:fixed; inset:0; pointer-events:none;
background:repeating-linear-gradient(0deg, rgba(0,0,0,.16) 0 1px, transparent 1px 3px);
}
.gate{ position:relative; width:fit-content; max-width:96vw; }
.tiny{
font-size:11px; letter-spacing:.34em; color:#1d7a54; margin:0 0 10px 2px;
}
#led{
font-size:min(2.6vw, 19px);
line-height:1.16; white-space:pre; overflow-x:auto;
padding:18px 22px;
border:1px solid rgba(0,230,156,.4); border-radius:8px;
background:rgba(0,18,9,.55);
box-shadow:0 0 30px rgba(0,230,156,.12), inset 0 0 30px rgba(0,60,32,.35);
text-shadow:0 0 10px rgba(0,230,156,.6);
}
#led::selection{ background:#00e69c; color:#001b0d; }
.out{
margin-top:16px; font-size:clamp(12px,1.8vw,14.5px); line-height:1.85;
text-shadow:0 0 6px rgba(0,230,156,.45);
min-height:7.5em;
}
.line{ white-space:pre-wrap; }
.k{ color:#eafff5; } .dim{ color:#1d7a54; }
.caret{ display:inline-block; width:.6em; height:1.05em; background:#00e69c; vertical-align:-.15em;
animation:blink 1s steps(1) infinite; }
@keyframes blink{ 50%{ opacity:0; } }
@media (prefers-reduced-motion: reduce){ .caret{ animation:none; } }
</style>
</head>
<body>
<div class="gate">
<p class="tiny">// NETNS.DEV — LED GATE 0xDEAD //</p>
<pre id="led"></pre>
<div class="out" id="out"></div>
</div>
<script>
/* ---------- 5x5 dot-matrix renderer ---------- */
const FONT = {
'N':[0b10001,0b11001,0b10101,0b10011,0b10001],
'E':[0b11111,0b10000,0b11110,0b10000,0b11111],
'T':[0b11111,0b00100,0b00100,0b00100,0b00100],
'S':[0b01111,0b10000,0b01110,0b00001,0b11110],
'D':[0b11110,0b10001,0b10001,0b10001,0b11110],
'V':[0b10001,0b10001,0b10101,0b01010,0b00100],
'.':[0,0,0,0b00110,0b00110],
};
const WORD = 'NETNS.DEV';
const RC = WORD.length * 6 - 1; // total dot columns
const grid = Array.from({length: 5}, () => Array(RC).fill(0));
[...WORD].forEach((ch, i) => {
const f = FONT[ch] || FONT['.'];
for (let r = 0; r < 5; r++)
for (let c = 0; c < 5; c++)
grid[r][i * 6 + c] = (f[r] >> (4 - c)) & 1;
});
const led = document.getElementById('led');
function rowStr(i){ return grid[i].map(b => b ? '██' : ' ').join(''); }
/* ---------- reveal + typed lines ---------- */
const out = document.getElementById('out');
const L = [
['k', '> UPLINK : ns0.netns.dev:443 ........... OK'],
['k', '> KERNEL : 5.15.0-netns (x86_64) — every dot is a handshake'],
['dim', '> NAMESPACE : web · api · lab — all online'],
['k', '> ACCESS : GRANTED — welcome to your namespace'],
];
const reduced = matchMedia('(prefers-reduced-motion: reduce)').matches;
const caret = document.createElement('span');
caret.className = 'caret';
function typeLines(){
let li = 0;
function next(){
if (li >= L.length){ caret.style.animation = 'none'; caret.style.opacity = 1; return; }
const [k, t] = L[li];
const d = document.createElement('div');
d.className = 'line ' + k;
out.appendChild(d);
let i = 0;
(function tick(){
i += 2 + (Math.random() * 2 | 0);
d.textContent = t.slice(0, i);
d.appendChild(caret);
if (i < t.length) setTimeout(tick, 14 + Math.random() * 24);
else setTimeout(() => { li++; next(); }, 130 + Math.random() * 200);
})();
}
next();
}
function run(){
if (reduced){ led.textContent = grid.map((_, i) => rowStr(i)).join('\n'); typeLines(); return; }
let r = 0;
(function rows(){
led.textContent = grid.slice(0, r + 1).map((_, i) => rowStr(i)).join('\n');
r++;
if (r < 5) setTimeout(rows, 130);
else setTimeout(typeLines, 200);
})();
}
run();
/* ---------- secret gate: ENTER x3 → term.html ---------- */
let ec = 0, lastT = 0, gate = null, opening = false;
addEventListener('keydown', (e) => {
if (e.repeat) return; // holding Enter must not count
if (e.key !== 'Enter'){
if (!['Shift','Control','Alt','Meta'].includes(e.key)){ ec = 0; lastT = 0; if (gate){ gate.remove(); gate = null; } }
return;
}
const now = Date.now();
ec = (now - lastT < 1200) ? ec + 1 : 1;
lastT = now;
if (opening) return;
if (!gate){
gate = document.createElement('div');
gate.className = 'line dim on'; // .line is opacity:0 — must add .on
out.appendChild(gate);
}
if (ec >= 3){
opening = true;
gate.textContent = '[ GATE OPENING ... ]';
setTimeout(() => { location.href = 'term.html'; }, 320);
return;
}
gate.textContent = (3 - ec) + ' MORE ENTERS TO OPEN THE GATE';
});
</script>
</body>
</html>