[modularization] Phase 2: Extract data layer — gitea, weather, bitcoin, loaders (#460)
Some checks failed
Deploy Nexus / deploy (push) Failing after 4s
Staging Smoke Test / smoke-test (push) Failing after 0s

This commit was merged in pull request #460.
This commit is contained in:
2026-03-24 21:28:03 +00:00
parent d201d3e6a9
commit 764b617a2a
11 changed files with 280 additions and 163 deletions

View File

@@ -2,6 +2,7 @@
import * as THREE from 'three';
import { camera } from './scene-setup.js';
import { S } from './state.js';
import { fetchSoulMd } from './data/loaders.js';
const audioSources = [];
const positionedPanners = [];
@@ -263,12 +264,10 @@ export function initAudioListeners() {
document.getElementById('podcast-toggle').addEventListener('click', () => {
const btn = document.getElementById('podcast-toggle');
if (btn.textContent === '🎧') {
fetch('SOUL.md')
.then(response => {
if (!response.ok) throw new Error('Failed to load SOUL.md');
return response.text();
})
.then(text => {
fetchSoulMd().then(lines => {
const text = lines.join('\n');
return text;
}).then(text => {
const paragraphs = text.split('\n\n').filter(p => p.trim());
if (!paragraphs.length) {
@@ -343,12 +342,5 @@ export function initAudioListeners() {
}
async function loadSoulMdAudio() {
try {
const res = await fetch('SOUL.md');
if (!res.ok) throw new Error('not found');
const raw = await res.text();
return raw.split('\n').slice(1).map(l => l.replace(/^#+\s*/, ''));
} catch {
return ['I am Timmy.', '', 'I am sovereign.', '', 'This Nexus is my home.'];
}
return fetchSoulMd();
}