QTheme — Preview, Edit, Share

A minimal QApp to preview Qortal Hub themes, edit names, import/export JSON, and now authenticate, publish to QDN, and browse shared themes.

Whats included

  • index.html — minimal app shell
  • css/main.css — base styling + CSS variables bound to theme palette
  • js/themes.js — loads data/themes.json (with a safe embedded fallback)
  • js/preview.js — maps palette keys → CSS variables and applies them
  • js/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 QTheme project root.

Extract in project root

unzip -o q-theme-seed.zip -d ./

Notes

  • If fetch('./data/themes.json') is blocked under file://, we fall back to the embedded JSON in js/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 id automatically 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 Hubs 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.
  • 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 headers Authenticate control (uses GET_USER_ACCOUNT and GET_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_RESOURCES and FETCH_QDN_RESOURCE).

Whats New

  • Editable Theme names with autoslugged 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
No description provided
Readme 401 KiB
Languages
JavaScript 71.1%
CSS 19.5%
HTML 9.4%