# Atlas — Premium theme framework for NamelessMC 2.2.x

A modern, clonable base for building commercial Minecraft server themes
(Inferno, Cyber, Aqua, Ender, Forest…). Dark-first, glassmorphism, fully
admin-configurable, zero core edits, independent from DefaultRevamp.

## What's new in V2.3

- **Hero reworked for conversion**: the big CTA button is removed. Logo Hero is
  dominant (70–80 % width) with the copyable **IP + live player count** right
  under the logo, plus optional **Discord / Vote / Store** quick links.
- **Native Vote page**: compact hero + modern vote cards, configurable rewards,
  multiple vote sites.
- **Native Rules page**: categories, icons, accordions, fully responsive.
- **Native Wiki page**: categories, live search, navigation cards, HTML/Markdown
  article content.
- **Settings → Native pages**: enable/disable Vote, Rules, Wiki, set their slug
  and custom icons, edit all content.

### Enabling the native pages (no module, no core edit)

The three pages render on NamelessMC **Custom Pages** matched by slug:

1. Admin panel → **Pages → Custom Pages → Create** a page with the URL `vote`
   (leave the content empty). Repeat for `rules` and `wiki`.
2. Theme **Settings → Native pages**: keep each page enabled and make sure the
   slug matches the custom page URL. Edit the content (vote sites, rule
   categories, wiki articles), set icons.
3. Add the pages to your navigation as usual (Admin → Navigation).

The theme detects the route and renders the rich layout in place of the empty
custom page content. Nothing in the core is touched.

## What's new in V2.2

- **Hero Logo First**: Logo Hero is the default — giant centred logo (size slider).
- **Ultra-transparent glass header**: default 80 % transparency,
  borderless at top, solidifies on scroll. Fully slider-controlled.
- **Richer live server status**: software, online player heads, MOTD, favicon, bar.
- **Ready-made visual presets**: click a palette swatch in Settings to load it.
- **Section size variations**: Small / Medium / Large + content width Narrow/Normal/Wide.
- **Live preview** in the admin panel (hero + palette + transparency, unsaved).
- **Import / Export** all settings as JSON (download + paste-to-import).
- **Clone generator**: `php tools/clone.php <Name> <preset> "Display Name"`
  (e.g. `php tools/clone.php Inferno inferno "Inferno"`) creates a fully
  independent themed copy. Pre-built Inferno / Aqua / Forest are shipped as ZIPs.

## What's new in V2

- **Hero**: configurable background image **or YouTube video background**, premium
  overlay strength (light→darker), height (medium/tall/full), badge, dual buttons,
  animated glow, entrance animations.
- **Live server status block**: real player count / MOTD / favicon via mcsrvstat.us
  (client-side, Java & Bedrock) — no core dependency.
- **Screenshots gallery block** with lightbox.
- **Modern Discord block** with live online member count (Discord widget API).
- **Forum & Members refonte**: NamelessMC's DOM is restyled with the Atlas design
  system (cards, glass, hover) via scoped CSS — group colours stay authoritative.
- **Premium animations**: scroll reveal, count-up stats, hero parallax — all
  toggleable in Settings and respecting `prefers-reduced-motion`.

All V2 options live in the theme **Settings** panel; nothing is hard-coded.

---

## 1. Architecture

```
Atlas/
├── template.php                  # NamelessMC entry point (the Template class)
├── template_settings/
│   ├── settings.php              # admin panel handler (save + build form data)
│   └── settings.tpl              # admin form UI (auto-rendered from the schema)
│
├── framework/                    # ★ everything original lives here
│   ├── core/
│   │   ├── ThemeConfig.php        # theme identity + paths  ← edit when cloning
│   │   ├── SettingsRegistry.php   # schema → values, presets, save + uploads
│   │   └── ThemeRenderer.php      # CSS variables + Smarty data + live stats
│   ├── settings/
│   │   └── schema.php             # ★ declarative list of EVERY admin setting
│   ├── presets/                   # colour/design token sets
│   │   ├── default.php  inferno.php  cyber.php
│   │   ├── aqua.php     ender.php    forest.php
│   ├── layouts/
│   │   └── home.tpl               # homepage builder (loops enabled blocks)
│   └── components/                # one .tpl per homepage block
│       ├── hero.tpl     features.tpl  statistics.tpl
│       ├── staff.tpl    discord.tpl   news.tpl
│       ├── vote.tpl     faq.tpl       partners.tpl  store.tpl
│
├── assets/
│   ├── css/framework.css          # all visuals, driven by CSS variables
│   └── js/framework.js            # IP copy + scroll reveal (vanilla, ~2 KB)
│
├── uploads/                       # admin-uploaded logo / favicon / hero bg
│
├── header.tpl  navbar.tpl  footer.tpl  index.tpl   # front-end shell (rewritten)
├── forum/  user/  members/  widgets/  email/        # inherited base templates
└── *.tpl                                            # login, register, 404, …
```

### How it flows
1. NamelessMC loads `template.php` and instantiates the Template class.
2. The constructor builds `MTL_SettingsRegistry` (reads `schema.php`) and
   `MTL_ThemeRenderer`, then exposes a single **`MTL`** Smarty variable with all
   branding / hero / colours / server / social / homepage-block data.
3. `onPageLoad()` injects, in order: the `:root{--mtl-*}` CSS variables (live
   theming), `framework.css`, the inherited `custom.css`, and the JS.
4. Templates read `{$MTL.*}`; `index.tpl` → `framework/layouts/home.tpl` renders
   each enabled homepage block from `framework/components/`.

### Why it's reusable
- **One schema** (`framework/settings/schema.php`) defines every admin option and
  automatically produces the form, the persistence and the Smarty variables.
- **Presets** are pure design-token maps; switching palette = one setting.
- **Components** are isolated `.tpl` files toggled by the homepage builder.
- Cloning a new commercial theme only touches `ThemeConfig.php` + presets.

---

## 2. Create a new theme from this framework (e.g. "Inferno")

1. Copy the whole folder:
   `custom/templates/Atlas` → `custom/templates/Inferno`
2. Open `Inferno/framework/core/ThemeConfig.php` and change:
   ```php
   const THEME_NAME    = 'Inferno';       // MUST match the new folder name
   const DISPLAY_NAME  = 'Inferno';
   const DEFAULT_PRESET = 'inferno';      // pick the palette to ship by default
   const AUTHOR        = '<a href="...">You</a>';
   ```
   > `THEME_NAME` drives the settings module namespace, so each clone keeps its
   > own independent settings — no collisions.
3. (Optional) tweak `Inferno/framework/presets/inferno.php` for a bespoke look.
4. Admin panel → **Appearance → Templates → Install** to register it, then
   **Activate / Make default**.

That's it — fully independent, no shared files with the original.

---

## 3. Add a new admin-editable setting

Edit **`framework/settings/schema.php`** only. Add one entry to a section's
`fields` array:

```php
['key' => 'mtl_my_setting', 'type' => 'text', 'label' => 'My setting', 'default' => 'Hello'],
```

Supported `type`: `text`, `textarea`, `richtext`, `url`, `number`, `color`,
`toggle`, `select` (add `options`), `image` (file upload).

It is now automatically:
- rendered in the admin form,
- saved to / read from the database,
- available in templates as part of `MTL` once you expose it in
  `ThemeRenderer::smartyData()`:
  ```php
  'my_setting' => $this->clean($s->get('mtl_my_setting')),
  ```
  → use `{$MTL.my_setting}` in any `.tpl`.

To add a whole **homepage block**: add an entry under `builder.blocks` (with an
`enable_key` + fields) and create `framework/components/<id>.tpl`.

---

## 4. Change the global colours

Colours are CSS variables, applied site-wide.

- **Per-site, no code:** Admin → Templates → *Atlas* → **Settings →
  Colours**. Pick a base preset and/or override Primary / Secondary / Accent.
- **Ship new defaults:** edit a file in `framework/presets/`. Each token maps to a
  `--mtl-*` variable (see `ThemeRenderer::cssVariables()`), e.g. `primary` →
  `--mtl-primary`. Add new tokens by adding them to the preset **and** to the map
  in `cssVariables()`, then use `var(--mtl-yourtoken)` in `framework.css`.

Untouched colours always fall back to the active preset, so the theme stays
coherent out of the box.

---

## 5. Installation

1. Copy the `Atlas` folder into `custom/templates/`.
2. Ensure `custom/templates/Atlas/uploads/` is **writable** by PHP
   (for logo / favicon / hero uploads).
3. Admin panel → **Appearance → Templates** → **Install templates**.
4. **Activate** *Atlas* and optionally **Make default**.
5. Open **Settings** next to the template to configure branding, hero, colours,
   server info, social links and the homepage builder.

Requirements: NamelessMC **2.2.x**, PHP 8.0+. A `color-mix()`-capable browser is
recommended (graceful fallbacks are provided).

---

## Licence & credits

Framework code: © Phavenstudio, MIT.
Inherited base templates (forum/user/members/etc.) derive from the MIT-licensed
**DefaultRevamp** theme by Samerton / Xemah (NamelessMC). The original
DefaultRevamp folder is never modified.
