Files
fabula-ultima-html/book.js
Drew Malzahn a44a54ff8a refactor: Convert book viewer to idiomatic React
Replace the SSR + injected vanilla-JS navigation script with a proper
client-side React app. BookIndex now uses useState/useEffect/useCallback
for all navigation state, scroll tracking, keyboard shortcuts, and history
management. webpack.config.js switches from renderToStaticMarkup to
embedding page data as window.__BOOK_DATA__ JSON; book.js becomes a
createRoot entry point. Also adds babel-loader for JSX bundling, fixes
#root display:contents so the flex height chain is preserved, and
restores missing CSS for header, .logo, .toolbar, and .tab buttons.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-06-10 02:12:29 +00:00

9 lines
296 B
JavaScript

import React from 'react';
import { createRoot } from 'react-dom/client';
import BookIndex from './src/BookIndex.jsx';
const { title, logoText, pages } = window.__BOOK_DATA__;
createRoot(document.getElementById('root')).render(
<BookIndex title={title} logoText={logoText} pages={pages} />
);