diff --git a/package.json b/package.json index e5d115d..e085909 100644 --- a/package.json +++ b/package.json @@ -6,7 +6,7 @@ "scripts": { "dev": "vite dev --host", "build": "vite build", - "server": "vite build && node server/server.js" + "start": "vite build && node server/server.js" }, "devDependencies": { "@sveltejs/adapter-node": "^5.4.0", diff --git a/src/lib/components/TerminalTUI.svelte b/src/lib/components/TerminalTUI.svelte index b1a4d4d..6521924 100644 --- a/src/lib/components/TerminalTUI.svelte +++ b/src/lib/components/TerminalTUI.svelte @@ -18,6 +18,7 @@ onComplete?: () => void; interactive?: boolean; speed?: SpeedPreset | number; + autoscroll?: boolean; } let { @@ -26,7 +27,8 @@ class: className = '', onComplete, interactive = true, - speed = 'normal' + speed = 'normal', + autoscroll = true }: Props = $props(); // Calculate speed multiplier from preset or number @@ -54,14 +56,13 @@ let terminalElement: HTMLDivElement; let bodyElement = $state(); - // Autoscroll to bottom + // Autoscroll to bottom (respects autoscroll prop) function scrollToBottom() { - if (bodyElement) { - bodyElement.scrollTo({ - top: bodyElement.scrollHeight, - behavior: 'smooth' - }); - } + if (!autoscroll || !bodyElement) return; + bodyElement.scrollTo({ + top: bodyElement.scrollHeight, + behavior: 'smooth' + }); } // Get all interactive button indices diff --git a/src/lib/config.ts b/src/lib/config.ts index e435e7d..9e7ccbd 100644 --- a/src/lib/config.ts +++ b/src/lib/config.ts @@ -4,12 +4,13 @@ // ============================================================================ export const user = { - name: 'Sir Blob', + name: 'Gagan M', + displayname: 'Sir Blob', username: 'sirblob', hostname: 'engineering', title: 'Engineering Student', - email: 'you@example.com', - location: 'San Francisco, CA', + email: 'sirblob0@gmail.com', + location: 'Washington DC-Baltimore Area', bio: `Hi, I am Sir Blob — a engineer who loves making things.` + `I build fun coding projects, participate in game jams and hackathons, and enjoy games like Minecraft and Pokémon TCG Live.`, @@ -487,6 +488,19 @@ export const pageSpeedSettings: Record = { 'hackathons': 'normal' }; +// Per-page autoscroll settings (whether to auto-scroll as content types) +// Set to false to disable autoscroll on specific pages +export const pageAutoscrollSettings: Record = { + // Examples: + // 'home': true, // Enable autoscroll + // 'portfolio': false, // Disable autoscroll + 'home': true, + 'portfolio': false, + 'models': true, + 'hackathons': false, + 'components': true +}; + // Speed preset multipliers (lower = faster) export const speedPresets: Record = { 'instant': 0, // No delay, instant display diff --git a/src/lib/index.ts b/src/lib/index.ts index 08e60d6..b77c65e 100644 --- a/src/lib/index.ts +++ b/src/lib/index.ts @@ -1,5 +1,5 @@ // Central helper functions and re-exports -import { terminalSettings, pageSpeedSettings, speedPresets, user } from './config'; +import { terminalSettings, pageSpeedSettings, speedPresets, pageAutoscrollSettings, user } from './config'; export type SpeedPreset = 'instant' | 'fast' | 'normal' | 'slow' | 'typewriter'; @@ -45,6 +45,16 @@ export function getPageSpeedMultiplier(pageName: string): number { return speedPresets[setting] ?? 1; } +/** + * Get autoscroll setting for a page + * @param pageName - Name of the page (e.g., 'home', 'portfolio') + * @returns boolean - Whether autoscroll is enabled (default: true) + */ +export function getPageAutoscroll(pageName: string): boolean { + const setting = pageAutoscrollSettings[pageName]; + return setting ?? true; // Default to enabled +} + /** * Get the terminal prompt string */ @@ -64,4 +74,4 @@ export function getPrompt(path: string = '~'): string { } // Barrel exports (convenience re-exports) -export { user, terminalSettings, pageSpeedSettings, speedPresets, pageMeta, site } from './config'; +export { user, terminalSettings, pageSpeedSettings, speedPresets, pageAutoscrollSettings, pageMeta, site } from './config'; diff --git a/src/routes/+page.svelte b/src/routes/+page.svelte index 724f236..04dd033 100644 --- a/src/routes/+page.svelte +++ b/src/routes/+page.svelte @@ -2,17 +2,18 @@ import TerminalTUI from '$lib/components/TerminalTUI.svelte'; import type { TerminalLine } from '$lib/components/tui/types'; import { user, skills, site, navigation } from '$lib/config'; - import { getPageSpeedMultiplier } from '$lib'; + import { getPageSpeedMultiplier, getPageAutoscroll } from '$lib'; import { colorTheme } from '$lib/stores/theme'; const speed = getPageSpeedMultiplier('home'); + const autoscroll = getPageAutoscroll('home'); // Build the terminal lines for the home page const lines: TerminalLine[] = [ // neofetch style intro { type: 'command', content: 'bash ~/startup.sh', delay: 300 }, { type: 'blank', content: '' }, - { type: 'header', content: `Welcome to ${user.name}'s Portfolio` }, + { type: 'header', content: `Welcome to ${user.displayname}'s Portfolio` }, { type: 'blank', content: '' }, { type: 'output', content: `(&muted)${user.bio}(&)` }, { type: 'blank', content: '' }, @@ -42,7 +43,7 @@
- +