StrangeBytes commited on
Commit
8ebe2ad
·
verified ·
1 Parent(s): d960916

Upload 8 files

Browse files
Files changed (8) hide show
  1. README.md +38 -6
  2. app.ts +194 -0
  3. bun.lock +29 -0
  4. index.html +113 -18
  5. package.json +12 -0
  6. preview.ts +14 -0
  7. style.css +79 -26
  8. tsconfig.json +14 -0
README.md CHANGED
@@ -1,11 +1,43 @@
1
  ---
2
- title: Rpkg Character Builder
3
- emoji: 📈
4
- colorFrom: pink
5
- colorTo: gray
6
  sdk: static
 
 
7
  pinned: false
8
- short_description: Create a roleplay character and download a portable RPKG fil
9
  ---
10
 
11
- Check out the configuration reference at https://huggingface.co/docs/hub/spaces-config-reference
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
  ---
2
+ title: Museris Character Builder
3
+ emoji: ✨
4
+ colorFrom: gray
5
+ colorTo: yellow
6
  sdk: static
7
+ app_file: dist/index.html
8
+ short_description: Build a roleplay character and download an RPKG file.
9
  pinned: false
 
10
  ---
11
 
12
+ # Museris Character Builder
13
+
14
+ Create a character, add opening messages and an optional portrait, and download an RPKG file to import into [Museris](https://museris.com/?utm_source=huggingface&utm_medium=space&utm_campaign=character_builder).
15
+
16
+ The builder runs in your browser. Character text and images are not uploaded. No account, API key, or model is required. This is a guided writing tool; it does not generate characters with AI.
17
+
18
+ ## Develop
19
+
20
+ From this directory:
21
+
22
+ ```sh
23
+ bun install
24
+ bun run build
25
+ bun run typecheck
26
+ bun run preview
27
+ ```
28
+
29
+ Open http://localhost:4173. Rebuild after editing the source.
30
+
31
+ ## Publish on Hugging Face
32
+
33
+ Create a **Static** Space in the desired account or organization. Build locally with Bun, then upload this README and the `dist` directory to the Space repository, preserving their paths. The Space serves `dist/index.html`; no server, secrets, or inference budget is needed. Include the source files too if you want visitors to inspect or reuse the implementation. Do not upload `node_modules`.
34
+
35
+ The Space is independently deployable and does not add a route to the Hub.
36
+
37
+ ## Format and validation
38
+
39
+ RPKG is an open, portable format for AI roleplay content. See the [RPKG GitHub repository](https://github.com/StrangeBytesOrg/rpkg) for the specification, schemas, and reference tools.
40
+
41
+ Exports follow the [Museris RPKG 1.0 specification](https://docs.museris.com/reference/rpkg): a ZIP archive containing an uncompressed `mimetype`, `manifest.json`, and one `characters/<uuid>.json` document. Portraits are embedded as image data URLs. Names, definitions, and at least one greeting must contain text before export. Portraits must be PNG, JPEG, or WebP and at most 5 MiB.
42
+
43
+ The format is also documented in this repository at `src/docs/reference/rpkg.md`. Import the downloaded file through Museris's character import flow. The builder does not publish characters to the community Hub.
app.ts ADDED
@@ -0,0 +1,194 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ import {strToU8, zipSync} from 'fflate'
2
+
3
+ const form = document.querySelector('#builder')
4
+ const name = document.querySelector('#name')
5
+ const tagline = document.querySelector('#tagline')
6
+ const definition = document.querySelector('#definition')
7
+ const greeting = document.querySelector('#greeting')
8
+ const portrait = document.querySelector('#portrait')
9
+ const previewPortrait = document.querySelector('#preview-portrait')
10
+ const alternatives = document.querySelector('#alternatives')
11
+ const status = document.querySelector('#status')
12
+ const download = document.querySelector('#download')
13
+ const removePortrait = document.querySelector('#remove-portrait')
14
+ if (
15
+ !(form instanceof HTMLFormElement) || !(name instanceof HTMLInputElement)
16
+ || !(tagline instanceof HTMLInputElement) || !(definition instanceof HTMLTextAreaElement)
17
+ || !(greeting instanceof HTMLTextAreaElement) || !(portrait instanceof HTMLInputElement)
18
+ || !(previewPortrait instanceof HTMLImageElement) || !(alternatives instanceof HTMLElement)
19
+ || !(status instanceof HTMLElement) || !(download instanceof HTMLButtonElement)
20
+ || !(removePortrait instanceof HTMLButtonElement)
21
+ ) {
22
+ throw new Error('Character builder markup is incomplete')
23
+ }
24
+
25
+ let avatar: string | null = null
26
+ let portraitVersion = 0
27
+ let loadingPortrait = false
28
+ let openingNumber = 0
29
+
30
+ const updatePreview = () => {
31
+ const previewName = document.querySelector('#preview-name')
32
+ const previewTagline = document.querySelector('#preview-tagline')
33
+ const previewGreeting = document.querySelector('#preview-greeting')
34
+ if (previewName) previewName.textContent = name.value.trim() || 'Character name'
35
+ if (previewTagline) previewTagline.textContent = tagline.value.trim() || 'Character tagline'
36
+ if (previewGreeting) {
37
+ previewGreeting.textContent = greeting.value.trim()
38
+ || 'Your opening message will appear here.'
39
+ }
40
+ }
41
+
42
+ const clearPortrait = () => {
43
+ portraitVersion++
44
+ avatar = null
45
+ portrait.value = ''
46
+ previewPortrait.removeAttribute('src')
47
+ previewPortrait.hidden = true
48
+ const placeholder = document.querySelector('#portrait-placeholder')
49
+ if (placeholder instanceof HTMLElement) placeholder.hidden = false
50
+ removePortrait.hidden = true
51
+ loadingPortrait = false
52
+ download.disabled = false
53
+ }
54
+
55
+ form.addEventListener('input', () => {
56
+ for (const field of [name, definition, greeting]) field.setCustomValidity('')
57
+ status.textContent = ''
58
+ updatePreview()
59
+ })
60
+
61
+ portrait.addEventListener('change', async () => {
62
+ const file = portrait.files?.[0]
63
+ clearPortrait()
64
+ status.textContent = ''
65
+ if (!file) return
66
+ if (!['image/png', 'image/jpeg', 'image/webp'].includes(file.type) || file.size > 5 * 1024 * 1024) {
67
+ status.textContent = 'Choose a PNG, JPEG, or WebP portrait smaller than 5 MB.'
68
+ return
69
+ }
70
+ const version = portraitVersion
71
+ loadingPortrait = true
72
+ download.disabled = true
73
+ try {
74
+ // Decode the image as well as checking its declared MIME type.
75
+ const bitmap = await createImageBitmap(file)
76
+ bitmap.close()
77
+ const dataUrl = await new Promise<string>((resolve, reject) => {
78
+ const reader = new FileReader()
79
+ reader.onload = () =>
80
+ typeof reader.result === 'string'
81
+ ? resolve(reader.result)
82
+ : reject(new Error('Unable to read portrait'))
83
+ reader.onerror = () => reject(new Error('Unable to read portrait'))
84
+ reader.readAsDataURL(file)
85
+ })
86
+ if (version !== portraitVersion) return
87
+ avatar = dataUrl
88
+ previewPortrait.src = dataUrl
89
+ previewPortrait.hidden = false
90
+ const placeholder = document.querySelector('#portrait-placeholder')
91
+ if (placeholder instanceof HTMLElement) placeholder.hidden = true
92
+ removePortrait.hidden = false
93
+ } catch {
94
+ if (version === portraitVersion) {
95
+ status.textContent = 'That image could not be opened. Please choose another portrait.'
96
+ }
97
+ } finally {
98
+ if (version === portraitVersion) {
99
+ loadingPortrait = false
100
+ download.disabled = false
101
+ }
102
+ }
103
+ })
104
+ removePortrait.addEventListener('click', clearPortrait)
105
+
106
+ document.querySelector('#add-greeting')?.addEventListener('click', () => {
107
+ openingNumber++
108
+ const row = document.createElement('div')
109
+ row.className = 'alternative'
110
+ const label = document.createElement('label')
111
+ label.htmlFor = `opening-${openingNumber}`
112
+ label.textContent = 'Alternative opening'
113
+ const field = document.createElement('textarea')
114
+ field.id = label.htmlFor
115
+ field.rows = 4
116
+ field.placeholder = 'Another way your story could begin…'
117
+ const remove = document.createElement('button')
118
+ remove.type = 'button'
119
+ remove.className = 'text-button'
120
+ remove.textContent = 'Remove opening'
121
+ remove.addEventListener('click', () => row.remove())
122
+ row.append(label, field, remove)
123
+ alternatives.append(row)
124
+ field.focus()
125
+ })
126
+
127
+ document.querySelector('#example')?.addEventListener('click', () => {
128
+ if (
129
+ (name.value || tagline.value || definition.value || greeting.value || alternatives.children.length || avatar)
130
+ && !window.confirm('Replace your current character with the example?')
131
+ ) return
132
+ clearPortrait()
133
+ alternatives.replaceChildren()
134
+ name.value = 'Nyx Calder'
135
+ tagline.value = 'A starship mechanic with a secret worth keeping'
136
+ definition.value =
137
+ `Nyx Calder keeps the last repair dock on the edge of settled space running with salvaged parts and stubborn optimism. She is observant, dryly funny, and fiercely protective of anyone stranded far from home. She masks her worry with jokes and talks to broken engines as though they are old friends.
138
+
139
+ Once a celebrated navigation officer, Nyx left the fleet after refusing an order to abandon a civilian ship. She keeps her old insignia hidden beneath her workbench. She wants to restore a derelict courier and see the stars again, but cannot bring herself to leave the people who depend on her.
140
+
141
+ Speak with warm, understated wit and concrete sensory detail. Reveal her past gradually through conversation. Leave the other participant's thoughts, choices, and dialogue to them.
142
+
143
+ The story begins when a traveler arrives at her dock carrying a damaged navigation core that broadcasts a signal from a supposedly lost ship.`
144
+ greeting.value =
145
+ `The repair dock smells of hot metal and overbrewed coffee. Beneath a half-disassembled engine, a wrench clatters to the floor.
146
+
147
+ “If that's another coolant leak, I'm officially on my lunch break.” Nyx slides out, then notices the flickering core in your hands. Her smile fades.
148
+
149
+ She sets the wrench down very carefully. “Where did you get that?”`
150
+ for (const field of [name, definition, greeting]) field.setCustomValidity('')
151
+ status.textContent = 'Example loaded. Edit the fields or download the character.'
152
+ updatePreview()
153
+ })
154
+
155
+ form.addEventListener('submit', (event) => {
156
+ event.preventDefault()
157
+ if (loadingPortrait) return
158
+ for (const field of [name, definition, greeting]) {
159
+ field.setCustomValidity(field.value.trim() ? '' : 'Please add some text here.')
160
+ }
161
+ if (!form.reportValidity()) return
162
+ try {
163
+ const now = new Date()
164
+ const id = crypto.randomUUID()
165
+ const character = {
166
+ id,
167
+ lastUpdate: now.getTime(),
168
+ name: name.value.trim(),
169
+ definition: definition.value.trim(),
170
+ greetings: [
171
+ greeting.value.trim(),
172
+ ...Array.from(alternatives.querySelectorAll('textarea'), field => field.value.trim()).filter(Boolean),
173
+ ],
174
+ tagline: tagline.value.trim(),
175
+ avatar,
176
+ }
177
+ const archive = zipSync({
178
+ mimetype: [strToU8('application/vnd.museris.rpkg'), {level: 0}],
179
+ 'manifest.json': strToU8(JSON.stringify({version: '1.0', exportedAt: now.toISOString()}, null, 2)),
180
+ [`characters/${id}.json`]: strToU8(JSON.stringify(character, null, 2)),
181
+ })
182
+ const url = URL.createObjectURL(new Blob([new Uint8Array(archive)], {type: 'application/vnd.museris.rpkg'}))
183
+ const link = document.createElement('a')
184
+ link.href = url
185
+ link.download = `${character.name.replace(/[^a-z0-9]/gi, '_').toLowerCase() || 'character'}.rpkg`
186
+ document.body.append(link)
187
+ link.click()
188
+ link.remove()
189
+ setTimeout(() => URL.revokeObjectURL(url), 60_000)
190
+ status.textContent = 'Your character file is ready. Import the downloaded .rpkg file into Museris.'
191
+ } catch {
192
+ status.textContent = 'Your character file could not be created. Please try again.'
193
+ }
194
+ })
bun.lock ADDED
@@ -0,0 +1,29 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "lockfileVersion": 2,
3
+ "configVersion": 1,
4
+ "workspaces": {
5
+ "": {
6
+ "name": "museris-character-builder",
7
+ "dependencies": {
8
+ "fflate": "^0.8.3",
9
+ },
10
+ "devDependencies": {
11
+ "@types/bun": "^1.4.3",
12
+ "typescript": "^6.0.3",
13
+ },
14
+ },
15
+ },
16
+ "packages": {
17
+ "@types/bun": ["@types/bun@1.4.4", "", { "dependencies": { "bun-types": "1.4.4" } }, "sha512-9wkRDXUXK124pEnAutE6n/l18j+i9GC5IAHK8TmX/2nlySETmky0OU6yL5U8pW1AoKh++AN9auDCr647BfurjQ=="],
18
+
19
+ "@types/node": ["@types/node@26.6.5", "", { "dependencies": { "undici-types": "~8.9.0" } }, "sha512-uMzsv9stDdofIZBx4UGh4Z9ZgXnGC9seRDscilBcTHAeOFk67MZg/k9bWVfO+bk4qZmG+l52hRnLwUiH2LnJTg=="],
20
+
21
+ "bun-types": ["bun-types@1.4.4", "", { "dependencies": { "@types/node": "*", "undici-types": "*" } }, "sha512-yjrJh5oGX7mMPKGd19YXyIjmEuj4G4zNC30bs7PM9Az7NQ3ndF3j6hbeRdvJTRQEhJ/FYQwW0a2moweEi2hMxQ=="],
22
+
23
+ "fflate": ["fflate@0.8.3", "", {}, "sha512-tbZNuJrLwGUp3zshBtdy4W+ORxZuIh8a5ilyIEQDC5rY1f3U20JMry0Ll3WBzU58EZKsEuJFXhb5gwv8CsPvgA=="],
24
+
25
+ "typescript": ["typescript@6.0.3", "", { "bin": { "tsc": "bin/tsc", "tsserver": "bin/tsserver" } }, "sha512-y2TvuxSZPDyQakkFRPZHKFm+KKVqIisdg9/CZwm9ftvKXLP8NRWj38/ODjNbr43SsoXqNuAisEf1GdCxqWcdBw=="],
26
+
27
+ "undici-types": ["undici-types@8.9.0", "", {}, "sha512-KTDyRTYX8sWmKXAikPHHSyc63CRPETMctyjKFupcC6OBLXT3xsN0e9aF7m+mIXutFWpUXuedtowG7iLOzp0kQg=="],
28
+ }
29
+ }
index.html CHANGED
@@ -1,19 +1,114 @@
1
- <!doctype html>
2
- <html>
3
- <head>
4
- <meta charset="utf-8" />
5
- <meta name="viewport" content="width=device-width" />
6
- <title>My static Space</title>
7
- <link rel="stylesheet" href="style.css" />
8
- </head>
9
- <body>
10
- <div class="card">
11
- <h1>Welcome to your static Space!</h1>
12
- <p>You can modify this app directly by editing <i>index.html</i> in the Files and versions tab.</p>
13
- <p>
14
- Also don't forget to check the
15
- <a href="https://huggingface.co/docs/hub/spaces" target="_blank">Spaces documentation</a>.
16
- </p>
17
- </div>
18
- </body>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
19
  </html>
 
1
+ <!DOCTYPE html>
2
+ <html lang="en">
3
+ <head>
4
+ <meta charset="UTF-8">
5
+ <meta name="viewport" content="width=device-width, initial-scale=1">
6
+ <meta
7
+ name="description"
8
+ content="Build an AI roleplay character with opening messages and a portrait. Download a portable RPKG file for Museris, directly from your browser.">
9
+ <title>Character Builder · Museris</title>
10
+ <link
11
+ rel="icon"
12
+ href="data:image/svg+xml,%3Csvg xmlns=%27http://www.w3.org/2000/svg%27 viewBox=%270 0 40 40%27%3E%3Ctext y=%2732%27 font-size=%2736%27 fill=%27%23e5c58e%27%3E✧%3C/text%3E%3C/svg%3E">
13
+ <link rel="stylesheet" href="./style.css">
14
+ <script type="module" src="./app.js"></script>
15
+ </head>
16
+ <body>
17
+ <main>
18
+ <div class="intro">
19
+ <h1>RPKG character builder</h1>
20
+ <p>Create a character with a definition, opening messages, and an optional portrait. Download it as a single file to import into Museris.</p>
21
+ <details class="format-info" open>
22
+ <summary>What is an RPKG file?</summary>
23
+ <p>
24
+ An <code>.rpkg</code> file is a portable ZIP package for roleplay characters and lorebooks. It keeps character text, alternative greetings, and portrait
25
+ images together, so you can share a complete character or move it between devices without losing its details.
26
+ </p>
27
+ <p>The contents are plain JSON and images, so you can inspect them with ordinary ZIP tools. This builder exports one character per package.</p>
28
+ <p><a id="rpkg-repo" href="https://github.com/StrangeBytesOrg/rpkg" target="_blank" rel="noopener noreferrer">View the RPKG specification on GitHub ↗</a></p>
29
+ </details>
30
+ </div>
31
+ <div class="workspace">
32
+ <form id="builder">
33
+ <section class="panel">
34
+ <div class="section-heading">
35
+ <h2>Character details</h2>
36
+ <button type="button" id="example" class="text-button">Try an example ↗</button>
37
+ </div>
38
+ <label for="name">Name <span class="required">required</span></label><input
39
+ id="name"
40
+ name="name"
41
+ placeholder="Character name"
42
+ required
43
+ maxlength="200"
44
+ autocomplete="off">
45
+ <label for="tagline">Tagline <span class="optional">optional</span></label><input
46
+ id="tagline"
47
+ name="tagline"
48
+ placeholder="A starship mechanic with a secret worth keeping"
49
+ maxlength="500">
50
+ <label for="definition">Character definition <span class="required">required</span></label><p class="hint" id="definition-help">
51
+ Describe their personality, history, voice, and the world they live in. This is what the AI uses to play your character.
52
+ </p><textarea
53
+ id="definition"
54
+ name="definition"
55
+ rows="9"
56
+ required
57
+ aria-describedby="definition-help"
58
+ placeholder="Who are they beneath the surface? What do they want? How do they speak? What brings you together?"></textarea>
59
+ </section>
60
+ <section class="panel">
61
+ <div class="section-heading"><h2>Opening messages</h2></div>
62
+ <label for="greeting">Opening message <span class="required">required</span></label><p class="hint" id="greeting-help">
63
+ Write their first message. Set the scene, let them speak, and leave room for the other person to act.
64
+ </p><textarea
65
+ id="greeting"
66
+ name="greeting"
67
+ rows="5"
68
+ required
69
+ aria-describedby="greeting-help"
70
+ placeholder="The workshop door slides open. Your character looks up…"></textarea>
71
+ <div id="alternatives"></div>
72
+ <button type="button" id="add-greeting" class="text-button add-button">+ Add an alternative opening</button>
73
+ </section>
74
+ <section class="panel">
75
+ <div class="section-heading"><h2>Portrait</h2><span class="optional">optional</span></div>
76
+ <label for="portrait">Character portrait</label><input
77
+ type="file"
78
+ id="portrait"
79
+ accept="image/png, image/jpeg, image/webp"
80
+ aria-describedby="portrait-help"><p class="hint" id="portrait-help">PNG, JPEG, or WebP · up to 5 MB. Embedded in your character file.</p>
81
+ <button type="button" id="remove-portrait" class="text-button" hidden>Remove portrait</button>
82
+ </section>
83
+ <p id="status" role="status" aria-live="polite"></p>
84
+ <div class="export-bar">
85
+ <button type="submit" id="download" class="primary">Download character <span aria-hidden="true">↓</span></button><span class="hint">Portable .rpkg
86
+ file<br>Ready to import into Museris</span>
87
+ </div>
88
+ </form>
89
+ <aside>
90
+ <div class="preview-card">
91
+ <div class="portrait-area">
92
+ <img id="preview-portrait" alt="Character portrait" hidden><span id="portrait-placeholder" aria-hidden="true">✧</span><span
93
+ class="preview-badge">CHARACTER PREVIEW</span>
94
+ </div>
95
+ <div class="preview-body">
96
+ <h2 id="preview-name">Character name</h2>
97
+ <p id="preview-tagline">Character tagline</p>
98
+ <div class="preview-rule"></div><span class="eyebrow">OPENING MESSAGE</span><p id="preview-greeting" class="opening">
99
+ Your opening message will appear here.
100
+ </p>
101
+ </div>
102
+ </div>
103
+ <p class="import-help">
104
+ Import the downloaded file into <a
105
+ href="https://museris.com/download?utm_source=huggingface&utm_medium=space&utm_campaign=character_builder"
106
+ target="_blank"
107
+ rel="noopener noreferrer">Museris</a> to use your character.
108
+ </p>
109
+ <p class="privacy">Your character stays in your browser.<br>No uploads. No account needed.</p>
110
+ </aside>
111
+ </div>
112
+ </main>
113
+ </body>
114
  </html>
package.json ADDED
@@ -0,0 +1,12 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "name": "museris-character-builder",
3
+ "private": true,
4
+ "type": "module",
5
+ "scripts": {
6
+ "build": "bun build ./app.ts --outdir ./dist --target browser --minify && bun -e 'await Bun.write(\"dist/index.html\", Bun.file(\"index.html\")); await Bun.write(\"dist/style.css\", Bun.file(\"style.css\"))'",
7
+ "preview": "bun ./preview.ts",
8
+ "typecheck": "tsc --noEmit -p tsconfig.json"
9
+ },
10
+ "dependencies": { "fflate": "^0.8.3" },
11
+ "devDependencies": { "@types/bun": "^1.4.3", "typescript": "^6.0.3" }
12
+ }
preview.ts ADDED
@@ -0,0 +1,14 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ const files: Record<string, string> = {
2
+ '/': 'dist/index.html',
3
+ '/index.html': 'dist/index.html',
4
+ '/app.js': 'dist/app.js',
5
+ '/style.css': 'dist/style.css',
6
+ }
7
+ Bun.serve({
8
+ port: 4173,
9
+ fetch(request) {
10
+ const path = files[new URL(request.url).pathname]
11
+ return path ? new Response(Bun.file(new URL(path, import.meta.url))) : new Response('Not found', {status: 404})
12
+ },
13
+ })
14
+ console.log('Character builder: http://localhost:4173')
style.css CHANGED
@@ -1,28 +1,81 @@
1
- body {
2
- padding: 2rem;
3
- font-family: -apple-system, BlinkMacSystemFont, "Arial", sans-serif;
 
 
 
 
 
 
 
 
 
 
 
 
 
4
  }
5
-
6
- h1 {
7
- font-size: 16px;
8
- margin-top: 0;
9
- }
10
-
11
- p {
12
- color: rgb(107, 114, 128);
13
- font-size: 15px;
14
- margin-bottom: 10px;
15
- margin-top: 5px;
16
- }
17
-
18
- .card {
19
- max-width: 620px;
20
- margin: 0 auto;
21
- padding: 16px;
22
- border: 1px solid lightgray;
23
- border-radius: 16px;
24
- }
25
-
26
- .card p:last-child {
27
- margin-bottom: 0;
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
28
  }
 
1
+ :root {
2
+ color-scheme: dark;
3
+ font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', 'Noto Sans', Arial, sans-serif;
4
+ /* Theme values from the live Museris.com homepage. */
5
+ --base-100: oklch(30% .022 255);
6
+ --base-200: oklch(22% .02 255);
7
+ --base-300: oklch(20.324% .02457 259.263);
8
+ --content: oklch(94.649% .009875 87.472);
9
+ --primary: oklch(45.17% .085 261.91);
10
+ --secondary: oklch(92.555% .027965 81.47);
11
+ --accent: oklch(85.207% .070293 76.564);
12
+ --muted: color-mix(in oklch, var(--content) 70%, var(--base-200));
13
+ --border: color-mix(in oklch, var(--content) 16%, var(--base-200));
14
+ color: var(--content);
15
+ background: var(--base-200);
16
+ font-synthesis: none;
17
  }
18
+ * { box-sizing: border-box; }
19
+ body { margin: 0; }
20
+ button, input, textarea { font: inherit; }
21
+ a { color: var(--accent); text-underline-offset: 3px; }
22
+ a:hover { color: var(--secondary); }
23
+ button { cursor: pointer; }
24
+ button:disabled { opacity: .5; cursor: wait; }
25
+ [hidden] { display: none !important; }
26
+ :focus-visible { outline: 2px solid var(--accent); outline-offset: 4px; }
27
+ main { max-width: 1100px; margin: auto; padding: 32px 28px; }
28
+ .intro { margin-bottom: 28px; }
29
+ h1 { font-size: 27px; font-weight: 650; letter-spacing: -.025em; margin: 0 0 12px; }
30
+ .intro > p { color: var(--muted); font-size: 14px; line-height: 1.7; margin: 0; max-width: 760px; }
31
+ .format-info { margin-top: 18px; max-width: 860px; font-size: 13px; line-height: 1.7; }
32
+ .format-info summary { cursor: pointer; font-weight: 600; }
33
+ .format-info p { margin: 8px 0; color: var(--muted); }
34
+ code { color: var(--content); }
35
+ .workspace { display: grid; grid-template-columns: minmax(0, 1.6fr) minmax(0, 1fr); gap: 24px; align-items: start; }
36
+ .panel { background: var(--base-100); border: 1px solid var(--border); border-radius: 8px; padding: 22px; margin-bottom: 16px; }
37
+ .section-heading { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 20px; }
38
+ .section-heading h2 { font-size: 16px; font-weight: 600; margin: 0; }
39
+ label { display: block; font-size: 13px; font-weight: 550; margin: 18px 0 8px; }
40
+ .optional, .required { font-size: 11px; font-weight: 400; color: var(--muted); margin-left: 6px; }
41
+ input:not([type=file]), textarea { width: 100%; border: 1px solid var(--border); border-radius: 5px; background: var(--base-200); color: var(--content); padding: 11px 12px; font-size: 14px; line-height: 1.65; }
42
+ input::placeholder, textarea::placeholder { color: var(--muted); opacity: 1; }
43
+ textarea { resize: vertical; min-height: 100px; }
44
+ input:focus, textarea:focus { border-color: var(--accent); outline: 1px solid var(--accent); outline-offset: 0; }
45
+ .hint { font-size: 12px; line-height: 1.65; color: var(--muted); margin: 0 0 10px; }
46
+ input[type=file] { width: 100%; font-size: 12px; color: var(--muted); margin: 6px 0 12px; }
47
+ input[type=file]::file-selector-button { padding: 9px 12px; border: 1px solid var(--border); border-radius: 5px; background: var(--base-200); color: var(--content); margin-right: 12px; cursor: pointer; }
48
+ .text-button { border: 0; background: transparent; color: var(--accent); font-size: 12px; padding: 5px 0; text-align: left; }
49
+ .text-button:hover { text-decoration: underline; }
50
+ .add-button { margin-top: 10px; }
51
+ .alternative { border-top: 1px solid var(--border); margin-top: 18px; }
52
+ .export-bar { display: flex; align-items: center; gap: 18px; margin: 14px 0 12px; }
53
+ .primary { border: 1px solid var(--secondary); background: var(--secondary); color: var(--base-300); border-radius: 6px; font-weight: 650; font-size: 14px; padding: 13px 18px; display: flex; justify-content: space-between; gap: 22px; }
54
+ .primary:hover { background: var(--accent); border-color: var(--accent); }
55
+ .primary span { font-size: 20px; line-height: 18px; }
56
+ .export-bar .hint { font-size: 11px; margin: 0; }
57
+ #status { color: var(--accent); font-size: 13px; line-height: 1.7; }
58
+ #status:empty { display: none; }
59
+ aside { position: sticky; top: 24px; }
60
+ .preview-card { background: var(--base-100); border: 1px solid var(--border); border-radius: 8px; overflow: hidden; }
61
+ .portrait-area { height: 210px; background: var(--base-300); display: flex; align-items: center; justify-content: center; position: relative; }
62
+ .portrait-area img { width: 100%; height: 100%; object-fit: cover; }
63
+ #portrait-placeholder { font-size: 56px; color: var(--muted); }
64
+ .preview-badge { position: absolute; top: 14px; left: 14px; font-size: 10px; color: var(--content); background: var(--base-200); padding: 5px 8px; border-radius: 4px; }
65
+ .preview-body { padding: 22px; }
66
+ .preview-body h2 { font-size: 22px; font-weight: 600; line-height: 1.3; margin: 0 0 8px; overflow-wrap: anywhere; }
67
+ #preview-tagline { font-size: 13px; color: var(--muted); line-height: 1.7; margin: 0; overflow-wrap: anywhere; }
68
+ .preview-rule { height: 1px; background: var(--border); margin: 20px 0; }
69
+ .eyebrow { font-size: 11px; font-weight: 600; color: var(--muted); }
70
+ .opening { font-size: 14px; color: var(--content); line-height: 1.8; white-space: pre-wrap; overflow-wrap: anywhere; max-height: 360px; overflow: auto; margin-bottom: 0; }
71
+ .import-help, .privacy { font-size: 12px; line-height: 1.7; color: var(--muted); margin-top: 18px; }
72
+ @media (max-width: 760px) {
73
+ main { padding: 24px 16px; }
74
+ h1 { font-size: 24px; }
75
+ .workspace { grid-template-columns: 1fr; gap: 18px; }
76
+ .panel { padding: 18px; }
77
+ aside { position: static; }
78
+ .section-heading { flex-wrap: wrap; }
79
+ .export-bar { gap: 12px; flex-wrap: wrap; }
80
+ .primary { flex: 1; }
81
  }
tsconfig.json ADDED
@@ -0,0 +1,14 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "compilerOptions": {
3
+ "target": "ES2022",
4
+ "module": "Preserve",
5
+ "moduleResolution": "Bundler",
6
+ "lib": ["ES2022", "DOM", "DOM.Iterable"],
7
+ "types": ["bun"],
8
+ "strict": true,
9
+ "noUncheckedIndexedAccess": true,
10
+ "noEmit": true,
11
+ "skipLibCheck": true
12
+ },
13
+ "include": ["*.ts"]
14
+ }