|
2 | 2 |
|
3 | 3 | import { useEffect, useRef, useState } from 'react' |
4 | 4 |
|
5 | | -const ASCII = [ |
6 | | - ' ______ _ ______ _ _ _ _ ', |
7 | | - ' / _____) | | (____ \\ (_) | | | (_) ', |
8 | | - '| / ___ _ | | ____ ____) )_ _ _| | _ | | ____ ____ _ ___ ', |
9 | | - '| | / _ \\ / || |/ _ ) __ (| | | | | |/ || |/ _ )/ ___) |/ _ \\ ', |
10 | | - '| \\____| |_| ( (_| ( (/ /| |__) ) |_| | | ( (_| ( (/ /| | _| | |_| |', |
11 | | - ' \\______)___/ \\____|\\____)______/ \\____|_|_|\\____|\\____)_| (_)_|\\___/ ', |
| 5 | +const ASCII_DATA = [ |
| 6 | + { green: ' ______ __ ', white: ' ______ _ _ _ _ ' }, |
| 7 | + { green: ' / _____) | | ', white: '(____ \\ (_) | | | (_) ' }, |
| 8 | + { green: ' | / ___ _ | | ____ ', white: '____) )_ _ _| | _ | | ____ ____ _ ___ ' }, |
| 9 | + { green: ' | | / _ \\ / || |/ _ )', white: ' __ (| | | | | |/ || |/ _ )/ ___) |/ _ \\ ' }, |
| 10 | + { green: ' | \\____| |_| ( (_| ( (/ /', white: '| |__) ) |_| | | ( (_| ( (/ /| | _| | |_| |' }, |
| 11 | + { green: ' \\______)___/ \\____|\\____)', white: '______/ \\____|_|_|\\____|\\____)_| (_)_|\\___/ ' }, |
12 | 12 | ] |
13 | 13 |
|
14 | 14 | const PROMPT = "404. The page you requested cannot be found right now. Try typing 'hack the world'." |
@@ -140,42 +140,57 @@ export function CliOverlay() { |
140 | 140 | <button |
141 | 141 | type="button" |
142 | 142 | onClick={() => setOpen(false)} |
143 | | - className="rounded border border-[#1ff042]/30 px-3 py-1 text-[#1ff042]/85" |
| 143 | + className="rounded border border-[#1ff042]/30 px-3 py-1 text-[#1ff042]/85 transition-colors hover:bg-[#1ff042]/10" |
144 | 144 | > |
145 | 145 | close |
146 | 146 | </button> |
147 | 147 | </div> |
148 | 148 |
|
149 | | - <pre className="overflow-x-auto text-[12px] leading-[1.1] text-white md:text-[15px]">{ASCII.join('\n')}</pre> |
| 149 | + <div className="overflow-x-auto font-mono text-[11px] leading-[1.1] md:text-[14px]"> |
| 150 | + {ASCII_DATA.map((row, i) => ( |
| 151 | + <div key={i} className="whitespace-pre"> |
| 152 | + <span className="text-[#1ff042]">{row.green}</span> |
| 153 | + <span className="text-white">{row.white}</span> |
| 154 | + </div> |
| 155 | + ))} |
| 156 | + <div className="mt-2 text-center text-[10px] tracking-[0.8em] text-white/60">INCORPORATED</div> |
| 157 | + </div> |
150 | 158 |
|
151 | | - <div className="mt-5 space-y-3 font-mono text-[14px] font-bold uppercase tracking-[0.14em] text-[#1ff042]"> |
| 159 | + <div className="mt-8 space-y-3 font-mono text-[14px] font-bold uppercase tracking-[0.14em] text-[#1ff042]"> |
152 | 160 | {lines.map((line, index) => ( |
153 | 161 | <p key={`${line}-${index}`} className="drop-shadow-[0_0_3px_rgba(31,240,66,0.7)]"> |
154 | 162 | > {line} |
155 | 163 | </p> |
156 | 164 | ))} |
157 | | - {matrixEnabled ? <p className="drop-shadow-[0_0_3px_rgba(31,240,66,0.7)]">{typingText}</p> : null} |
| 165 | + {matrixEnabled ? ( |
| 166 | + <p className="drop-shadow-[0_0_3px_rgba(31,240,66,0.7)] text-white"> |
| 167 | + {typingText} |
| 168 | + <span className="animate-pulse">_</span> |
| 169 | + </p> |
| 170 | + ) : null} |
158 | 171 | </div> |
159 | 172 |
|
160 | | - <form onSubmit={onSubmit} className="mt-4"> |
161 | | - <label className="sr-only" htmlFor="cli-overlay-input"> |
162 | | - Terminal input |
163 | | - </label> |
164 | | - <div className="flex items-center gap-3 font-mono text-[14px] font-bold uppercase tracking-[0.14em] text-[#1ff042]"> |
165 | | - <span>></span> |
166 | | - <input |
167 | | - id="cli-overlay-input" |
168 | | - ref={inputRef} |
169 | | - value={input} |
170 | | - onChange={(event) => setInput(event.target.value)} |
171 | | - className="min-w-0 flex-1 border-0 bg-transparent p-0 text-[#1ff042] outline-none placeholder:text-[#1ff042]/40" |
172 | | - placeholder="type a command" |
173 | | - autoComplete="off" |
174 | | - autoCorrect="off" |
175 | | - spellCheck={false} |
176 | | - /> |
177 | | - </div> |
178 | | - </form> |
| 173 | + {!matrixEnabled && ( |
| 174 | + <form onSubmit={onSubmit} className="mt-4"> |
| 175 | + <label className="sr-only" htmlFor="cli-overlay-input"> |
| 176 | + Terminal input |
| 177 | + </label> |
| 178 | + <div className="flex items-center gap-3 font-mono text-[14px] font-bold uppercase tracking-[0.14em] text-[#1ff042]"> |
| 179 | + <span>></span> |
| 180 | + <input |
| 181 | + id="cli-overlay-input" |
| 182 | + ref={inputRef} |
| 183 | + value={input} |
| 184 | + onChange={(event) => setInput(event.target.value)} |
| 185 | + className="min-w-0 flex-1 border-0 bg-transparent p-0 text-[#1ff042] outline-none placeholder:text-[#1ff042]/40" |
| 186 | + placeholder="type a command" |
| 187 | + autoComplete="off" |
| 188 | + autoCorrect="off" |
| 189 | + spellCheck={false} |
| 190 | + /> |
| 191 | + </div> |
| 192 | + </form> |
| 193 | + )} |
179 | 194 | </div> |
180 | 195 | </div> |
181 | 196 | </div> |
|
0 commit comments