Q‑Theme — Preview, Edit, Share
A minimal Q‑App to preview Qortal Hub themes, edit names, import/export JSON, and now authenticate, publish to QDN, and browse shared themes.
What’s included
index.html— minimal app shellcss/main.css— base styling + CSS variables bound to theme palettejs/themes.js— loadsdata/themes.json(with a safe embedded fallback)js/preview.js— maps palette keys → CSS variables and applies themjs/app.js— UI wiring (theme select, name editing, dark toggle, create/copy, import/export, authenticate, publish, shared themes)data/themes.json— copied from your uploaded file for out-of-the-box preview
Run
Open index.html directly or serve with any static server. In Qortal, place the files under the Q‑Theme project root.
Extract in project root
unzip -o q-theme-seed.zip -d ./
Notes
- If
fetch('./data/themes.json')is blocked underfile://, we fall back to the embedded JSON injs/themes.js. - The New button clones the currently selected theme, names it “Copy of {Selected}” (with numeric suffix if needed), inserts it at the start of the list, selects it, and opens edit mode. Shared marker flags are not inherited.
- You can edit the theme name directly in the Theme field. The internal
idautomatically syncs to a unique slug of the current name, and Export/Publish use this slug. - Import lets you pick a
.json; it validates, adds to the list, and selects it. - Save exports a JSON compatible with the Hub’s extended palette keys. Export resolves any CSS variables and color-mix to concrete rgb/rgba values for portability.
- Publish uploads the current theme JSON to QDN (requires Qortal environment + approval). Identifier uses the theme id:
qtheme_theme_{id}. - Authenticate obtains your address and names from Qortal:
- No names: button shows truncated address (e.g.,
QZL...qM2) and is disabled. - One name: button shows that name and is disabled.
- Multiple names: button becomes a dropdown to select the active name.
- No names: button shows truncated address (e.g.,
- Shared themes shows a spinner while fetching and then prepends shared themes (newest first) from QDN to the top of the Theme list. Unchecking removes shared entries only.
QDN integration (run inside Qortal Hub)
- Authenticate via the header’s Authenticate control (uses
GET_USER_ACCOUNTandGET_ACCOUNT_NAMES). - Publish a theme via the Publish button (uses
PUBLISH_QDN_RESOURCE). - Toggle Shared themes to fetch and prepend published themes (uses
SEARCH_QDN_RESOURCESandFETCH_QDN_RESOURCE).
What’s New
- Editable Theme names with auto‑slugged ids (used for export and publish).
- Publish Theme to QDN under your selected Qortal name.
- Shared Themes toggle with loading spinner; fetches and prepends the most recent published themes from QDN.
Description
Languages
JavaScript
71.1%
CSS
19.5%
HTML
9.4%