-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathindex.html
More file actions
272 lines (248 loc) · 11.9 KB
/
Copy pathindex.html
File metadata and controls
272 lines (248 loc) · 11.9 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
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>sureshram@github.io: ~</title>
<link rel="preconnect" href="https://fonts.googleapis.com">
<link rel="preconnect" href="https://fonts.gstatic.com" crossorigin>
<link href="https://fonts.googleapis.com/css2?family=JetBrains+Mono:wght@400;500;700&family=Inter:wght@400;500;600&display=swap" rel="stylesheet">
<script src="https://unpkg.com/lucide@latest"></script>
<script src="https://cdn.jsdelivr.net/npm/marked/marked.min.js"></script>
<style>
:root {
--bg-gradient: linear-gradient(135deg, #0f172a 0%, #1e293b 100%);
--terminal-bg: rgba(21, 26, 33, 0.85);
--sidebar-bg: rgba(30, 41, 59, 0.4);
--text-primary: #e2e8f0;
--text-secondary: #94a3b8;
--accent: #38bdf8;
--success: #4ade80;
--border: rgba(255, 255, 255, 0.1);
--prompt: #7dd3fc;
--sidebar-width: 220px;
--radius: 12px;
--shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.5);
}
* { margin: 0; padding: 0; box-sizing: border-box; }
body {
font-family: 'JetBrains Mono', monospace;
background: var(--bg-gradient);
color: var(--text-primary);
line-height: 1.6;
height: 100vh;
overflow: hidden;
}
.terminal {
width: 100%;
height: 100%;
background: var(--terminal-bg);
backdrop-filter: blur(20px);
-webkit-backdrop-filter: blur(20px);
display: flex;
flex-direction: column;
overflow: hidden;
animation: fadeIn 0.6s ease-out;
}
@keyframes fadeIn {
from { opacity: 0; transform: translateY(20px); }
to { opacity: 1; transform: translateY(0); }
}
.terminal-header {
background: rgba(15, 23, 42, 0.6);
padding: 14px 20px;
border-bottom: 1px solid var(--border);
display: flex;
align-items: center;
justify-content: space-between;
flex-shrink: 0;
}
.controls { display: flex; gap: 10px; }
.dot { width: 13px; height: 13px; border-radius: 50%; }
.dot.red { background: #ff5f56; }
.dot.yellow { background: #ffbd2e; }
.dot.green { background: #27c93f; }
.terminal-title { font-size: 13px; color: var(--text-secondary); }
.terminal-main { display: flex; flex-grow: 1; overflow: hidden; }
.sidebar {
width: var(--sidebar-width);
background: var(--sidebar-bg);
border-right: 1px solid var(--border);
padding: 30px 0;
display: flex;
flex-direction: column;
gap: 8px;
}
.nav-item {
padding: 12px 24px;
color: var(--text-secondary);
text-decoration: none;
cursor: pointer;
transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
display: flex;
align-items: center;
gap: 12px;
position: relative;
}
.nav-item:hover, .nav-item.active { color: var(--accent); }
.nav-item.active { background: rgba(56, 189, 248, 0.1); }
.nav-item.active::after {
content: '';
position: absolute;
left: 0;
top: 20%;
height: 60%;
width: 4px;
background: var(--accent);
border-radius: 0 4px 4px 0;
}
.content-area {
flex-grow: 1;
padding: 40px;
background: rgba(15, 23, 42, 0.2);
overflow-y: auto;
}
.prompt { color: var(--prompt); margin-right: 12px; font-weight: 700; }
.cmd-line { display: flex; align-items: center; margin-bottom: 30px; font-size: 16px; }
/* Markdown Styles */
.markdown-body h1 { font-size: 2.2rem; color: #fff; margin-bottom: 12px; }
.markdown-body h2 { font-size: 1.5rem; color: var(--accent); margin: 32px 0 16px 0; }
.markdown-body h3 { font-size: 1.1rem; color: var(--success); margin: 24px 0 12px 0; }
.markdown-body p, .markdown-body li { margin-bottom: 16px; color: var(--text-primary); font-family: 'Inter', sans-serif; font-size: 15px; }
.markdown-body a { color: var(--accent); text-decoration: none; border-bottom: 1px solid transparent; }
.markdown-body a:hover { border-bottom-color: var(--accent); }
.markdown-body ul { padding-left: 20px; margin-bottom: 24px; list-style: none; }
.markdown-body li::before { content: '→'; position: absolute; left: 15px; color: var(--accent); }
.markdown-body code { background: rgba(30, 41, 59, 0.8); padding: 4px 8px; border-radius: 6px; color: var(--success); }
.markdown-body pre { background: #1e293b; padding: 20px; border-radius: 10px; overflow-x: auto; border: 1px solid var(--border); margin: 20px 0; }
.card-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 20px; }
.glass-card {
background: rgba(255, 255, 255, 0.03);
border: 1px solid var(--border);
padding: 20px;
border-radius: var(--radius);
cursor: pointer;
transition: all 0.3s;
}
.glass-card:hover { border-color: var(--accent); background: rgba(255, 255, 255, 0.07); transform: translateY(-3px); }
.loading-spinner { display: flex; justify-content: center; align-items: center; height: 100px; color: var(--accent); }
@media (max-width: 900px) {
.sidebar { width: 70px; }
.nav-item span { display: none; }
}
</style>
</head>
<body>
<div class="terminal">
<div class="terminal-header">
<div class="controls">
<div class="dot red"></div>
<div class="dot yellow"></div>
<div class="dot green"></div>
</div>
<div class="terminal-title">sureshram@github.io — zsh</div>
<div></div>
</div>
<div class="terminal-main">
<nav class="sidebar">
<div class="nav-item active" onclick="loadPage('whoami')">
<i data-lucide="user-round" size="20"></i>
<span>whoami</span>
</div>
<div class="nav-item" onclick="loadPage('blogs')">
<i data-lucide="terminal" size="20"></i>
<span>blogs</span>
</div>
<div class="nav-item" onclick="loadPage('projects')">
<i data-lucide="layout-grid" size="20"></i>
<span>projects</span>
</div>
<div class="nav-item" onclick="loadPage('tools')">
<i data-lucide="binary" size="20"></i>
<span>tools</span>
</div>
</nav>
<main class="content-area" id="content"></main>
</div>
</div>
<script>
// Blog Manifest (since we can't auto-scan directories via client-side JS)
const BLOGS = [
{ id: 'pyfileio', name: 'The Art of Python I/O', desc: 'Mastering streams and high-level file operations in modern Python.' },
{ id: 'blog2', name: 'Blog2', desc: 'Blog 2 Mastering and high-level file operations in modern Python.' },
{ id: 'regression', name: 'Statistical Modeling: Regression', desc: 'A deep dive into predictive analysis.', external: true, url: 'https://hbr.org/2015/11/a-refresher-on-regression-analysis' }
];
const contentDiv = document.getElementById('content');
async function fetchMarkdown(file) {
contentDiv.innerHTML = '<div class="loading-spinner">_loading...</div>';
try {
const response = await fetch(file);
if (!response.ok) throw new Error(`Could not load ${file}`);
return await response.text();
} catch (err) {
return `### Error\n${err.message}\n\n*Note: Fetching files via file:// protocol is blocked by browsers. Please run via a local server.*`;
}
}
async function loadPage(pageId) {
document.querySelectorAll('.nav-item').forEach(el => {
el.classList.remove('active');
if (el.textContent.trim().includes(pageId)) el.classList.add('active');
});
if (pageId === 'whoami') {
const md = await fetchMarkdown('resume.md');
const html = marked.parse(md);
const socialLinks = `
<div style="display:flex; gap:16px; margin: -10px 0 24px 0;">
<a href="https://github.com/sureshram" target="_blank" style="display:flex; align-items:center; gap:6px; font-size:13px;"><i data-lucide="github" size="16"></i> GitHub</a>
<a href="https://linkedin.com/in/sramakrishnaiah" target="_blank" style="display:flex; align-items:center; gap:6px; font-size:13px;"><i data-lucide="linkedin" size="16"></i> LinkedIn</a>
</div>
`;
contentDiv.innerHTML = `
<div class="cmd-line"><span class="prompt">➜</span> <span style="color:var(--accent)">whoami</span></div>
<div class="markdown-body">${html.replace('</h1>', '</h1>' + socialLinks)}</div>
`;
} else if (pageId === 'blogs') {
const list = BLOGS.map(b => `
<div class="glass-card" onclick="${b.external ? `window.open('${b.url}', '_blank')` : `viewBlogPost('${b.id}')`}">
<h3>${b.name} ${b.external ? '<i data-lucide="external-link" size="14"></i>' : ''}</h3>
<p>${b.desc}</p>
</div>
`).join('');
contentDiv.innerHTML = `
<div class="cmd-line"><span class="prompt">➜</span> <span style="color:var(--accent)">ls ./blog</span></div>
<div class="card-grid">${list}</div>
`;
} else if (pageId === 'projects') {
const md = await fetchMarkdown('topprojects.md');
contentDiv.innerHTML = `
<div class="cmd-line"><span class="prompt">➜</span> <span style="color:var(--accent)">cat projects.md</span></div>
<div class="markdown-body">${marked.parse(md)}</div>
`;
} else if (pageId === 'tools') {
const md = await fetchMarkdown('tools.md');
contentDiv.innerHTML = `
<div class="cmd-line"><span class="prompt">➜</span> <span style="color:var(--accent)">grep "stack" ./env</span></div>
<div class="markdown-body">${marked.parse(md)}</div>
`;
}
lucide.createIcons();
contentDiv.scrollTop = 0;
}
async function viewBlogPost(blogId) {
const md = await fetchMarkdown(`blog/${blogId}.md`);
contentDiv.innerHTML = `
<div class="cmd-line"><span class="prompt">➜</span> <span style="color:var(--accent)">cat blog/${blogId}.md</span></div>
<div class="markdown-body">
<button onclick="loadPage('blogs')" style="background:var(--sidebar-bg); color:var(--text-primary); border:1px solid var(--border); padding:8px 16px; border-radius:8px; cursor:pointer; margin-bottom:32px; font-family:'JetBrains Mono'; font-size:12px;">
<i data-lucide="arrow-left" size="14"></i> BACK_TO_FEED
</button>
${marked.parse(md)}
</div>
`;
lucide.createIcons();
contentDiv.scrollTop = 0;
}
loadPage('whoami');
</script>
</body>
</html>