diff --git a/internal/templates/html/base.html b/internal/templates/html/base.html index 5dfa98f..b226761 100644 --- a/internal/templates/html/base.html +++ b/internal/templates/html/base.html @@ -4,100 +4,383 @@ {{.Title}} — MrixsCraft +
-
- -
{{template "content" .}}
- + + diff --git a/internal/templates/html/index.html b/internal/templates/html/index.html index 8c43d5c..5fdefe6 100644 --- a/internal/templates/html/index.html +++ b/internal/templates/html/index.html @@ -1,17 +1,73 @@ {{define "content"}} -
-

Добро пожаловать в MrixsCraft

-

Приватный Minecraft-сервер с модпаками. Зарегистрируйся, скачай лаунчер и играй.

-

- Начать играть -

+ +
+

⛏ MrixsCraft

+

Приватный Minecraft-сервер с модпаками. Зарегистрируйся, скачай лаунчер и играй с друзьями.

+
+ + +

🖥 Наши серверы

+
+
+ 1.21 +

HiTech

+

Технический модпак · Java 21

+

Индустриальная автоматизация, технологии и прогресс. Строй фабрики, автоматизируй производство, покоряй энергию.

+
Онлайн
+
+
+ 1.20 +

Vanilla

+

Ванильный сервер · Java 17

+

Классический Minecraft без модов. Строи, исследуй, выживай — всё как в старые добрые времена.

+
Онлайн
+
+
+ + +

🚀 Как начать

+
+
+
📝
+

1. Регистрация

+

Создай аккаунт на сайте. Придумай никнейм и пароль.

+
+
+
💾
+

2. Скачай лаунчер

+

Скачай лаунчер для своей ОС. Он сам скачает все нужные файлы.

+
+
+
🎮
+

3. Играй

+

Авторизуйся в лаунчере, выбери сервер и нажимай PLAY.

+
+
+ + +

✨ Возможности

-

Как начать

-
    -
  1. Зарегистрируйся на сайте
  2. -
  3. Скачай лаунчер для своей ОС
  4. -
  5. Авторизуйся, выбирай модпак и нажимай PLAY
  6. -
+
+
+

🔐 Своя авторизация

+

Полноценная Yggdrasil-совместимая система. Скины, плащи, профили — всё работает.

+
+
+

📦 Модпаки

+

Готовые наборы модов с автообновлением. Лаунчер сам скачает и проверит все файлы.

+
+
+

🌐 Веб-профиль

+

Управляй скином и плащом прямо на сайте. Загружай PNG и они сразу в игре.

+
+
+

🔄 Автообновление

+

Лаунчер обновляется сам. Серверные модпаки тоже подтягиваются автоматически.

+
+
{{end}} diff --git a/internal/templates/html/login.html b/internal/templates/html/login.html index fe58358..54e183e 100644 --- a/internal/templates/html/login.html +++ b/internal/templates/html/login.html @@ -1,42 +1,61 @@ {{define "content"}} -
-

Вход

-
- - +
+
+

👋 С возвращением

+

Войди в аккаунт, чтобы управлять профилем и скачать лаунчер.

+
- - +
+
+ + + - - - -

Нет аккаунта? Зарегистрироваться

+ + + + + +

Нет аккаунта? Зарегистрироваться

+
{{end}} diff --git a/internal/templates/html/profile.html b/internal/templates/html/profile.html new file mode 100644 index 0000000..6321fa2 --- /dev/null +++ b/internal/templates/html/profile.html @@ -0,0 +1,240 @@ +{{define "content"}} +
+

Загрузка...

+
+ + + + +{{end}} diff --git a/internal/templates/html/register.html b/internal/templates/html/register.html index ca5009d..49b97f8 100644 --- a/internal/templates/html/register.html +++ b/internal/templates/html/register.html @@ -1,43 +1,77 @@ {{define "content"}} -
-

Регистрация

-
- - +
+
+

🎮 Создать аккаунт

+

Присоединяйся к MrixsCraft и начни играть.

+
- - +
+
+ + + +

3–20 символов: латиница, цифры, _

- - + + - - - -

Уже есть аккаунт? Войти

+ + + + + +

Пароли не совпадают

+ + + +

Уже есть аккаунт? Войти

+
{{end}} diff --git a/internal/templates/templates.go b/internal/templates/templates.go index 59aee37..36f5711 100644 --- a/internal/templates/templates.go +++ b/internal/templates/templates.go @@ -14,7 +14,9 @@ import ( // pageData is passed to all templates. type pageData struct { - Title string + Title string + Username string + UUID string } // Handler serves template-rendered pages. @@ -37,6 +39,7 @@ func (h *Handler) RegisterRoutes(mux *http.ServeMux) { mux.HandleFunc("GET /", h.index) mux.HandleFunc("GET /login", h.loginPage) mux.HandleFunc("GET /register", h.registerPage) + mux.HandleFunc("GET /profile", h.profilePage) } // ── Page handlers ────────────────────────────────────────────── @@ -69,6 +72,14 @@ func (h *Handler) registerPage(w http.ResponseWriter, r *http.Request) { h.render(w, "register.html", pageData{Title: "Регистрация"}) } +func (h *Handler) profilePage(w http.ResponseWriter, r *http.Request) { + if !h.loaded { + fallback(w, "Profile") + return + } + h.render(w, "profile.html", pageData{Title: "Профиль"}) +} + // render executes the named template with data, writing to w. func (h *Handler) render(w http.ResponseWriter, name string, data pageData) { w.Header().Set("Content-Type", "text/html; charset=utf-8")