Website config Update

This commit is contained in:
2025-11-28 06:17:25 +00:00
parent 88b068a2b5
commit 8cdb39afbe
11 changed files with 949 additions and 813 deletions
+19 -9
View File
@@ -2,7 +2,7 @@
import TerminalTUI from '$lib/components/TerminalTUI.svelte';
import type { TerminalLine } from '$lib/components/tui/types';
import ModelViewer from '$lib/components/ModelViewer.svelte';
import { user } from '$lib/config';
import { user, models as configModels } from '$lib/config';
import { getPageSpeedMultiplier, getPageAutoscroll } from '$lib';
import { themeColors } from '$lib/stores/theme';
import Icon from '@iconify/svelte';
@@ -10,13 +10,23 @@
const speed = getPageSpeedMultiplier('models');
const autoscroll = getPageAutoscroll('models');
// Available GLB files in static/models/
const glbModels = [
{ name: 'Bake Potato', path: '/models/BakePotato.glb' },
{ name: 'Soda Can', path: '/models/Soda.glb' }
];
// Build GLB model list from config (`models`) while preserving metadata.
// Keep `name`, `path`, `thumbnail`, and `description` for richer UI use.
const glbModels = (configModels && configModels.length > 0)
? configModels
.map(m => ({
name: m.name,
path: m.modelUrl ?? m.downloadUrl ?? m.thumbnail ?? '',
thumbnail: m.thumbnail ?? '',
description: m.description ?? ''
}))
.filter(m => m.path)
: [
{ name: 'Bake Potato', path: '/models/BakePotato.glb', thumbnail: '/models/BakePotato-thumb.png', description: 'A fun baked-potato 3D model.' },
{ name: 'Soda Can', path: '/models/Soda.glb', thumbnail: '/models/Soda-thumb.png', description: 'A realistic soda can model.' }
];
let selectedModel = $state(glbModels[0]);
let selectedModel = $state(glbModels[0] ?? { name: '', path: '', thumbnail: '', description: '' });
let showViewer = $state(false);
function selectModel(model: typeof glbModels[0]) {
@@ -26,7 +36,7 @@
// Build the terminal lines for the models page
const lines: TerminalLine[] = [
{ type: 'command', content: 'ls ~/3d-models/' },
{ type: 'command', content: 'ls ~/models/' },
{ type: 'blank', content: '' },
{ type: 'header', content: '(&primary,bold)3D Models(&)' },
@@ -63,7 +73,7 @@
>
<!-- Terminal Section -->
<div class="terminal-section">
<TerminalTUI {lines} title="~/3d-models" interactive={true} {speed} {autoscroll} />
<TerminalTUI {lines} title="~/models" interactive={true} {speed} {autoscroll} />
</div>
<!-- 3D Viewer Section -->