version 1 with webshell and docs
This commit is contained in:
351
src/docs.css
Normal file
351
src/docs.css
Normal file
@@ -0,0 +1,351 @@
|
||||
:root {
|
||||
--base: #000000;
|
||||
--text: #cdd6f4;
|
||||
--subtext0: #a6adc8;
|
||||
--surface0: #1a1a1a;
|
||||
--surface1: #2a2a2a;
|
||||
--green: #a6e3a1;
|
||||
--blue: #89b4fa;
|
||||
}
|
||||
|
||||
* {
|
||||
margin: 0;
|
||||
padding: 0;
|
||||
box-sizing: border-box;
|
||||
}
|
||||
|
||||
body {
|
||||
font-family: "JetBrains Mono", monospace;
|
||||
background-color: var(--base);
|
||||
color: var(--text);
|
||||
min-height: 100vh;
|
||||
padding: 2rem 1.5rem;
|
||||
line-height: 1.7;
|
||||
}
|
||||
|
||||
.container {
|
||||
max-width: 900px;
|
||||
margin: 0 auto;
|
||||
opacity: 0;
|
||||
animation: fadeIn 0.8s ease forwards;
|
||||
}
|
||||
|
||||
@keyframes fadeIn {
|
||||
to {
|
||||
opacity: 1;
|
||||
}
|
||||
}
|
||||
|
||||
.header {
|
||||
margin-bottom: 3rem;
|
||||
}
|
||||
|
||||
.back-link {
|
||||
color: var(--subtext0);
|
||||
text-decoration: none;
|
||||
font-size: 0.9rem;
|
||||
margin-bottom: 2rem;
|
||||
display: inline-block;
|
||||
transition: color 0.3s ease;
|
||||
}
|
||||
|
||||
.back-link:hover {
|
||||
color: var(--green);
|
||||
}
|
||||
|
||||
h1 {
|
||||
color: var(--text);
|
||||
font-size: 2.5rem;
|
||||
margin: 1rem 0 0.5rem 0;
|
||||
font-weight: 600;
|
||||
}
|
||||
|
||||
.subtitle {
|
||||
color: var(--subtext0);
|
||||
font-size: 1rem;
|
||||
}
|
||||
|
||||
.command-reference {
|
||||
margin: 2rem 0 3rem 0;
|
||||
}
|
||||
|
||||
.command-box {
|
||||
background-color: rgba(26, 26, 26, 0.8);
|
||||
border: 2px solid var(--green);
|
||||
border-radius: 8px;
|
||||
padding: 1.5rem;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: space-between;
|
||||
gap: 1rem;
|
||||
box-shadow: 0 0 20px rgba(166, 227, 161, 0.1);
|
||||
transition: all 0.3s ease;
|
||||
}
|
||||
|
||||
.command-box:hover {
|
||||
box-shadow: 0 0 30px rgba(166, 227, 161, 0.15);
|
||||
}
|
||||
|
||||
.command-box code {
|
||||
color: var(--green);
|
||||
font-size: 1.1rem;
|
||||
flex: 1;
|
||||
}
|
||||
|
||||
.copy-btn {
|
||||
background: none;
|
||||
border: none;
|
||||
color: var(--subtext0);
|
||||
cursor: pointer;
|
||||
padding: 0.5rem;
|
||||
border-radius: 4px;
|
||||
transition: all 0.2s ease;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
position: relative;
|
||||
}
|
||||
|
||||
.copy-btn:hover {
|
||||
color: var(--green);
|
||||
background-color: var(--surface0);
|
||||
}
|
||||
|
||||
.copy-btn .check-icon {
|
||||
display: none;
|
||||
color: var(--green);
|
||||
}
|
||||
|
||||
.copy-btn.copied .copy-icon {
|
||||
display: none;
|
||||
}
|
||||
|
||||
.copy-btn.copied .check-icon {
|
||||
display: block;
|
||||
animation: checkPop 0.3s ease;
|
||||
}
|
||||
|
||||
@keyframes checkPop {
|
||||
0% {
|
||||
transform: scale(0);
|
||||
}
|
||||
50% {
|
||||
transform: scale(1.2);
|
||||
}
|
||||
100% {
|
||||
transform: scale(1);
|
||||
}
|
||||
}
|
||||
|
||||
.sections {
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
gap: 3rem;
|
||||
}
|
||||
|
||||
.section {
|
||||
opacity: 0;
|
||||
animation: slideUp 0.6s ease forwards;
|
||||
}
|
||||
|
||||
.section:nth-child(1) {
|
||||
animation-delay: 0.2s;
|
||||
}
|
||||
.section:nth-child(2) {
|
||||
animation-delay: 0.4s;
|
||||
}
|
||||
.section:nth-child(3) {
|
||||
animation-delay: 0.6s;
|
||||
}
|
||||
.section:nth-child(4) {
|
||||
animation-delay: 0.8s;
|
||||
}
|
||||
.section:nth-child(5) {
|
||||
animation-delay: 1s;
|
||||
}
|
||||
|
||||
@keyframes slideUp {
|
||||
from {
|
||||
opacity: 0;
|
||||
transform: translateY(20px);
|
||||
}
|
||||
to {
|
||||
opacity: 1;
|
||||
transform: translateY(0);
|
||||
}
|
||||
}
|
||||
|
||||
h2 {
|
||||
color: var(--green);
|
||||
font-size: 1.5rem;
|
||||
margin-bottom: 1.25rem;
|
||||
font-weight: 600;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
gap: 0.5rem;
|
||||
}
|
||||
|
||||
h2::before {
|
||||
content: ">";
|
||||
color: var(--green);
|
||||
}
|
||||
|
||||
p {
|
||||
color: var(--subtext0);
|
||||
margin-bottom: 1rem;
|
||||
font-size: 0.95rem;
|
||||
}
|
||||
|
||||
strong {
|
||||
color: var(--text);
|
||||
font-weight: 600;
|
||||
}
|
||||
|
||||
.breakdown-grid {
|
||||
display: grid;
|
||||
grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
|
||||
gap: 1.5rem;
|
||||
margin-top: 1.5rem;
|
||||
}
|
||||
|
||||
.breakdown-item {
|
||||
background-color: rgba(26, 26, 26, 0.5);
|
||||
border: 1px solid rgba(166, 227, 161, 0.2);
|
||||
border-radius: 8px;
|
||||
padding: 1.5rem;
|
||||
transition: all 0.3s ease;
|
||||
}
|
||||
|
||||
.breakdown-item:hover {
|
||||
border-color: rgba(166, 227, 161, 0.4);
|
||||
background-color: rgba(26, 26, 26, 0.7);
|
||||
}
|
||||
|
||||
.breakdown-item h3 {
|
||||
color: var(--blue);
|
||||
font-size: 1.1rem;
|
||||
margin-bottom: 0.75rem;
|
||||
font-weight: 600;
|
||||
}
|
||||
|
||||
.breakdown-item p {
|
||||
font-size: 0.9rem;
|
||||
line-height: 1.6;
|
||||
}
|
||||
|
||||
.steps {
|
||||
list-style: none;
|
||||
counter-reset: step;
|
||||
margin-top: 1rem;
|
||||
}
|
||||
|
||||
.steps li {
|
||||
counter-increment: step;
|
||||
margin-bottom: 1.25rem;
|
||||
display: flex;
|
||||
gap: 1rem;
|
||||
color: var(--subtext0);
|
||||
font-size: 0.95rem;
|
||||
}
|
||||
|
||||
.steps li::before {
|
||||
content: counter(step, decimal-leading-zero);
|
||||
color: var(--green);
|
||||
font-weight: 600;
|
||||
min-width: 2rem;
|
||||
}
|
||||
|
||||
kbd {
|
||||
background-color: var(--surface0);
|
||||
border: 1px solid var(--surface1);
|
||||
padding: 0.2rem 0.5rem;
|
||||
border-radius: 4px;
|
||||
color: var(--text);
|
||||
font-size: 0.9em;
|
||||
font-family: inherit;
|
||||
}
|
||||
|
||||
.resources-grid {
|
||||
display: grid;
|
||||
grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
|
||||
gap: 1rem;
|
||||
margin-top: 1.5rem;
|
||||
}
|
||||
|
||||
.resource-card {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: space-between;
|
||||
padding: 1.25rem;
|
||||
background-color: rgba(26, 26, 26, 0.5);
|
||||
border: 1px solid rgba(166, 227, 161, 0.2);
|
||||
border-radius: 8px;
|
||||
text-decoration: none;
|
||||
color: var(--text);
|
||||
transition: all 0.3s ease;
|
||||
position: relative;
|
||||
overflow: hidden;
|
||||
}
|
||||
|
||||
.resource-card:hover {
|
||||
background-color: rgba(26, 26, 26, 0.7);
|
||||
border-color: var(--green);
|
||||
transform: translateY(-2px);
|
||||
box-shadow: 0 4px 12px rgba(166, 227, 161, 0.1);
|
||||
}
|
||||
|
||||
.resource-content {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
gap: 0.75rem;
|
||||
}
|
||||
|
||||
.resource-content svg {
|
||||
color: var(--green);
|
||||
}
|
||||
|
||||
.resource-content span {
|
||||
font-size: 0.95rem;
|
||||
}
|
||||
|
||||
.external-icon,
|
||||
.arrow-icon {
|
||||
color: var(--subtext0);
|
||||
opacity: 0;
|
||||
transition: all 0.3s ease;
|
||||
}
|
||||
|
||||
.resource-card:hover .external-icon,
|
||||
.resource-card:hover .arrow-icon {
|
||||
opacity: 1;
|
||||
color: var(--green);
|
||||
}
|
||||
|
||||
.note {
|
||||
margin-top: 1rem;
|
||||
font-size: 0.8rem;
|
||||
text-align: center;
|
||||
color: rgba(166, 172, 200, 0.6);
|
||||
}
|
||||
|
||||
@media (max-width: 768px) {
|
||||
body {
|
||||
padding: 1.5rem 1rem;
|
||||
}
|
||||
|
||||
h1 {
|
||||
font-size: 2rem;
|
||||
}
|
||||
|
||||
h2 {
|
||||
font-size: 1.3rem;
|
||||
}
|
||||
|
||||
.command-box code {
|
||||
font-size: 0.9rem;
|
||||
}
|
||||
|
||||
.breakdown-grid,
|
||||
.resources-grid {
|
||||
grid-template-columns: 1fr;
|
||||
}
|
||||
}
|
||||
16
src/docs.ts
Normal file
16
src/docs.ts
Normal file
@@ -0,0 +1,16 @@
|
||||
import './docs.css';
|
||||
|
||||
const copyBtn = document.getElementById('copyBtn') as HTMLButtonElement;
|
||||
const command = 'ssh portfolio@keshavanand.net';
|
||||
|
||||
if (copyBtn) {
|
||||
copyBtn.addEventListener('click', async () => {
|
||||
try {
|
||||
await navigator.clipboard.writeText(command);
|
||||
copyBtn.classList.add('copied');
|
||||
setTimeout(() => copyBtn.classList.remove('copied'), 2000);
|
||||
} catch (err) {
|
||||
console.error('Failed to copy:', err);
|
||||
}
|
||||
});
|
||||
}
|
||||
89
src/main.ts
Normal file
89
src/main.ts
Normal file
@@ -0,0 +1,89 @@
|
||||
import './style.css';
|
||||
|
||||
// Matrix rain effect
|
||||
const canvas = document.getElementById('matrix') as HTMLCanvasElement;
|
||||
const ctx = canvas.getContext('2d')!;
|
||||
|
||||
canvas.width = window.innerWidth;
|
||||
canvas.height = window.innerHeight;
|
||||
|
||||
const chars = 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789@#$%^&*()_+-=[]{}|;:,.<>?/~`';
|
||||
const fontSize = 14;
|
||||
const columns = canvas.width / fontSize;
|
||||
const drops: number[] = Array(Math.floor(columns)).fill(1);
|
||||
|
||||
let mouseX = canvas.width / 2;
|
||||
let mouseY = canvas.height / 2;
|
||||
|
||||
function draw() {
|
||||
ctx.fillStyle = 'rgba(0, 0, 0, 0.05)';
|
||||
ctx.fillRect(0, 0, canvas.width, canvas.height);
|
||||
|
||||
ctx.font = `${fontSize}px monospace`;
|
||||
|
||||
for (let i = 0; i < drops.length; i++) {
|
||||
const x = i * fontSize;
|
||||
const y = drops[i] * fontSize;
|
||||
const dist = Math.sqrt((x - mouseX) ** 2 + (y - mouseY) ** 2);
|
||||
|
||||
const text = chars[Math.floor(Math.random() * chars.length)];
|
||||
|
||||
// Only show characters near cursor
|
||||
const alpha = Math.max(0, 1 - dist / 250);
|
||||
|
||||
if (alpha > 0.1) {
|
||||
const color = dist < 120 ? '#a6e3a1' : dist < 200 ? '#89b4fa' : '#6c7086';
|
||||
ctx.fillStyle = color + Math.floor(alpha * 255).toString(16).padStart(2, '0');
|
||||
ctx.fillText(text, x, y);
|
||||
}
|
||||
|
||||
if (drops[i] * fontSize > canvas.height && Math.random() > 0.975) drops[i] = 0;
|
||||
drops[i]++;
|
||||
}
|
||||
}
|
||||
|
||||
setInterval(draw, 33);
|
||||
|
||||
window.addEventListener('mousemove', (e) => {
|
||||
mouseX = e.clientX;
|
||||
mouseY = e.clientY;
|
||||
});
|
||||
|
||||
window.addEventListener('resize', () => {
|
||||
canvas.width = window.innerWidth;
|
||||
canvas.height = window.innerHeight;
|
||||
});
|
||||
|
||||
// Copy functionality
|
||||
const commandBox = document.getElementById('commandBox') as HTMLDivElement;
|
||||
const copyBtn = document.getElementById('copyBtn') as HTMLButtonElement;
|
||||
const tooltip = document.getElementById('tooltip') as HTMLDivElement;
|
||||
const COMMAND = 'ssh portfolio@keshavanand.net';
|
||||
|
||||
async function copyToClipboard() {
|
||||
try {
|
||||
await navigator.clipboard.writeText(COMMAND);
|
||||
copyBtn.classList.add('copied');
|
||||
tooltip.classList.add('show');
|
||||
setTimeout(() => {
|
||||
copyBtn.classList.remove('copied');
|
||||
tooltip.classList.remove('show');
|
||||
}, 2000);
|
||||
} catch (err) {
|
||||
console.error('Failed to copy:', err);
|
||||
}
|
||||
}
|
||||
|
||||
copyBtn.addEventListener('click', (e) => {
|
||||
e.stopPropagation();
|
||||
copyToClipboard();
|
||||
});
|
||||
|
||||
commandBox.addEventListener('click', (e) => {
|
||||
if (!(e.target as HTMLElement).closest('.copy-btn')) copyToClipboard();
|
||||
});
|
||||
|
||||
// Fade in docs link after 2 seconds
|
||||
setTimeout(() => {
|
||||
document.getElementById('docsLink')?.classList.add('show');
|
||||
}, 2000);
|
||||
264
src/style.css
Normal file
264
src/style.css
Normal file
@@ -0,0 +1,264 @@
|
||||
:root {
|
||||
/* Catppuccin Mocha - Darker Hacker Theme */
|
||||
--base: #000000;
|
||||
--mantle: #0a0a0a;
|
||||
--crust: #050505;
|
||||
--text: #cdd6f4;
|
||||
--subtext0: #a6adc8;
|
||||
--surface0: #1a1a1a;
|
||||
--surface1: #2a2a2a;
|
||||
--green: #a6e3a1;
|
||||
--blue: #89b4fa;
|
||||
--mauve: #cba6f7;
|
||||
}
|
||||
|
||||
* {
|
||||
margin: 0;
|
||||
padding: 0;
|
||||
box-sizing: border-box;
|
||||
}
|
||||
|
||||
body {
|
||||
font-family: "JetBrains Mono", monospace;
|
||||
background-color: var(--base);
|
||||
color: var(--text);
|
||||
min-height: 100vh;
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
justify-content: center;
|
||||
align-items: center;
|
||||
padding: 2rem;
|
||||
line-height: 1.6;
|
||||
overflow: hidden;
|
||||
position: relative;
|
||||
}
|
||||
|
||||
#matrix {
|
||||
position: fixed;
|
||||
top: 0;
|
||||
left: 0;
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
z-index: 0;
|
||||
}
|
||||
|
||||
.container {
|
||||
width: 100%;
|
||||
max-width: 800px;
|
||||
position: relative;
|
||||
z-index: 1;
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
align-items: center;
|
||||
gap: 2.5rem;
|
||||
opacity: 0;
|
||||
transform: translateY(30px);
|
||||
animation: fadeInUp 0.6s ease forwards;
|
||||
}
|
||||
|
||||
@keyframes fadeInUp {
|
||||
to {
|
||||
opacity: 1;
|
||||
transform: translateY(0);
|
||||
}
|
||||
}
|
||||
|
||||
.terminal-header {
|
||||
margin-bottom: 3rem;
|
||||
text-align: left;
|
||||
width: 100%;
|
||||
}
|
||||
|
||||
.terminal-line {
|
||||
color: var(--subtext0);
|
||||
font-size: 0.95rem;
|
||||
line-height: 1.8;
|
||||
margin-bottom: 0.5rem;
|
||||
}
|
||||
|
||||
.prompt {
|
||||
color: var(--green);
|
||||
}
|
||||
|
||||
.user {
|
||||
color: var(--blue);
|
||||
}
|
||||
|
||||
.path {
|
||||
color: var(--mauve);
|
||||
}
|
||||
|
||||
.command-container {
|
||||
position: relative;
|
||||
width: 100%;
|
||||
}
|
||||
|
||||
.command-box {
|
||||
background-color: rgba(0, 0, 0, 0.85);
|
||||
backdrop-filter: blur(12px);
|
||||
border: 2px solid #a6e3a1;
|
||||
border-radius: 8px;
|
||||
padding: 1.5rem 4rem 1.5rem 1.75rem;
|
||||
font-size: 1.1rem;
|
||||
color: var(--text);
|
||||
display: flex;
|
||||
align-items: center;
|
||||
gap: 0.75rem;
|
||||
transition: all 0.3s ease;
|
||||
cursor: pointer;
|
||||
user-select: none;
|
||||
box-shadow: 0 0 20px rgba(166, 227, 161, 0.15);
|
||||
}
|
||||
|
||||
.command-box:hover {
|
||||
background-color: rgba(0, 0, 0, 0.9);
|
||||
border-color: #a6e3a1;
|
||||
box-shadow: 0 0 30px rgba(166, 227, 161, 0.25);
|
||||
transform: translateY(-2px);
|
||||
}
|
||||
|
||||
.command-box:active {
|
||||
transform: translateY(-2px) scale(0.98);
|
||||
}
|
||||
|
||||
.dollar {
|
||||
color: var(--green);
|
||||
font-weight: 600;
|
||||
font-size: 1.3rem;
|
||||
text-shadow: 0 0 10px rgba(166, 227, 161, 0.5);
|
||||
}
|
||||
|
||||
.command {
|
||||
color: var(--text);
|
||||
flex: 1;
|
||||
}
|
||||
|
||||
.copy-btn {
|
||||
position: absolute;
|
||||
right: 1rem;
|
||||
top: 50%;
|
||||
transform: translateY(-50%);
|
||||
background: none;
|
||||
border: none;
|
||||
color: var(--subtext0);
|
||||
cursor: pointer;
|
||||
padding: 0.5rem;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
transition: all 0.2s ease;
|
||||
border-radius: 4px;
|
||||
}
|
||||
|
||||
.copy-btn:hover {
|
||||
color: var(--green);
|
||||
background-color: var(--surface1);
|
||||
}
|
||||
|
||||
.copy-btn:active {
|
||||
transform: translateY(-50%) scale(0.9);
|
||||
}
|
||||
|
||||
.copy-btn.copied {
|
||||
color: var(--green);
|
||||
}
|
||||
|
||||
.copy-btn svg {
|
||||
width: 20px;
|
||||
height: 20px;
|
||||
}
|
||||
|
||||
.tooltip {
|
||||
position: absolute;
|
||||
top: -2.5rem;
|
||||
right: 0;
|
||||
background-color: var(--surface1);
|
||||
color: var(--green);
|
||||
padding: 0.5rem 0.75rem;
|
||||
border-radius: 4px;
|
||||
font-size: 0.75rem;
|
||||
opacity: 0;
|
||||
pointer-events: none;
|
||||
transition: opacity 0.2s ease;
|
||||
white-space: nowrap;
|
||||
}
|
||||
|
||||
.tooltip.show {
|
||||
opacity: 1;
|
||||
}
|
||||
|
||||
@media (max-width: 640px) {
|
||||
body {
|
||||
padding: 1.5rem;
|
||||
}
|
||||
|
||||
.terminal-header {
|
||||
margin-bottom: 2rem;
|
||||
}
|
||||
|
||||
.command-box {
|
||||
font-size: 0.9rem;
|
||||
padding: 1.1rem 3rem 1.1rem 1.25rem;
|
||||
}
|
||||
|
||||
.terminal-line {
|
||||
font-size: 0.85rem;
|
||||
}
|
||||
|
||||
.copy-btn svg {
|
||||
width: 18px;
|
||||
height: 18px;
|
||||
}
|
||||
}
|
||||
|
||||
.docs-link {
|
||||
color: var(--subtext0);
|
||||
text-decoration: none;
|
||||
font-size: 0.9rem;
|
||||
opacity: 0;
|
||||
transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
|
||||
position: relative;
|
||||
padding: 0.5rem 1rem;
|
||||
border: 1px solid transparent;
|
||||
border-radius: 6px;
|
||||
transform: translateY(10px);
|
||||
}
|
||||
|
||||
.docs-link::before {
|
||||
content: "";
|
||||
position: absolute;
|
||||
bottom: 0;
|
||||
left: 50%;
|
||||
width: 0;
|
||||
height: 1px;
|
||||
background: linear-gradient(90deg, transparent, var(--green), transparent);
|
||||
transition: all 0.4s ease;
|
||||
transform: translateX(-50%);
|
||||
}
|
||||
|
||||
.docs-link:hover {
|
||||
color: var(--green);
|
||||
border-color: rgba(166, 227, 161, 0.2);
|
||||
background-color: rgba(166, 227, 161, 0.05);
|
||||
transform: translateY(-2px);
|
||||
}
|
||||
|
||||
.docs-link:hover::before {
|
||||
width: 100%;
|
||||
}
|
||||
|
||||
.docs-link.show {
|
||||
opacity: 1;
|
||||
transform: translateY(0);
|
||||
animation: pulse 2s ease-in-out 0.5s;
|
||||
}
|
||||
|
||||
@keyframes pulse {
|
||||
0%,
|
||||
100% {
|
||||
box-shadow: 0 0 0 0 rgba(166, 227, 161, 0.4);
|
||||
}
|
||||
50% {
|
||||
box-shadow: 0 0 0 8px rgba(166, 227, 161, 0);
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user