донат шоп, управление магазином, яндекс метрика
This commit is contained in:
@@ -5,6 +5,7 @@ import { arrowSvg, iconPaths, moonMark } from './symbols';
|
||||
const props = defineProps({
|
||||
registerEndpoint: { type: String, required: true },
|
||||
csrfToken: { type: String, required: true },
|
||||
inviteRequired: { type: Boolean, default: true },
|
||||
auth: { type: Object, required: true },
|
||||
flash: { type: Object, required: true },
|
||||
});
|
||||
@@ -32,7 +33,7 @@ const clientErrors = computed(() => {
|
||||
const errors = {};
|
||||
if (form.username && !/^[a-zA-Z0-9]{3,32}$/.test(form.username)) errors.username = 'Только латиница и цифры, 3-32 символа.';
|
||||
if (form.email && !/^[^\s@]+@[^\s@]+\.[^\s@]+$/.test(form.email)) errors.email = 'Похоже на некорректный email.';
|
||||
if (form.invite_code && !/^[A-Za-z0-9-]{6,32}$/.test(form.invite_code)) errors.invite_code = 'Код из букв, цифр и тире, 6-32 символа.';
|
||||
if (props.inviteRequired && form.invite_code && !/^[A-Za-z0-9-]{6,32}$/.test(form.invite_code)) errors.invite_code = 'Код из букв, цифр и тире, 6-32 символа.';
|
||||
if (form.password && form.password.length < 8) errors.password = 'Минимум 8 символов.';
|
||||
else if (form.password && !/[A-Za-z]/.test(form.password)) errors.password = 'Должна быть хотя бы одна буква.';
|
||||
else if (form.password && !/\d/.test(form.password)) errors.password = 'Должна быть хотя бы одна цифра.';
|
||||
@@ -43,7 +44,7 @@ const clientErrors = computed(() => {
|
||||
const valid = computed(() => Boolean(
|
||||
form.username &&
|
||||
form.email &&
|
||||
form.invite_code &&
|
||||
(!props.inviteRequired || form.invite_code) &&
|
||||
form.password &&
|
||||
form.password_confirmation &&
|
||||
form.terms &&
|
||||
@@ -77,7 +78,7 @@ function submit(event) {
|
||||
}
|
||||
|
||||
event.preventDefault();
|
||||
['username', 'email', 'invite_code', 'password', 'password_confirmation', 'terms'].forEach((field) => {
|
||||
['username', 'email', ...(props.inviteRequired ? ['invite_code'] : []), 'password', 'password_confirmation', 'terms'].forEach((field) => {
|
||||
touched[field] = true;
|
||||
});
|
||||
}
|
||||
@@ -104,8 +105,8 @@ function submit(event) {
|
||||
<div style="height: 20px"></div>
|
||||
<h2 class="h-display" style="font-size: clamp(36px, 5vw, 56px)">Создай игровой аккаунт</h2>
|
||||
<div class="divider-ornament" style="justify-content: flex-start; margin: 22px 0"><span style="opacity: 0.6">✦</span></div>
|
||||
<p class="lead" style="font-style: italic">Укажи инвайт-код, логин, почту и пароль - аккаунт будет готов к входу в игру сразу после регистрации.</p>
|
||||
<div class="join-note">
|
||||
<p class="lead" style="font-style: italic">{{ inviteRequired ? 'Укажи инвайт-код, логин, почту и пароль' : 'Укажи логин, почту и пароль' }} — аккаунт будет готов к входу в игру сразу после регистрации.</p>
|
||||
<div v-if="inviteRequired" class="join-note">
|
||||
<span class="join-note-k">Закрытый бета-доступ</span>
|
||||
<span class="join-note-v">Пока идет закрытый этап: регистрация только по инвайт-кодам. Код можно получить у друзей-игроков или в нашем Discord.</span>
|
||||
</div>
|
||||
@@ -132,7 +133,7 @@ function submit(event) {
|
||||
<div v-if="errorFor('email')" class="join-error">{{ errorFor('email') }}</div>
|
||||
</div>
|
||||
|
||||
<div :class="['join-field', { 'has-error': errorFor('invite_code') }]">
|
||||
<div v-if="inviteRequired" :class="['join-field', { 'has-error': errorFor('invite_code') }]">
|
||||
<label class="join-label">Инвайт-код</label>
|
||||
<div class="join-input">
|
||||
<span class="join-input-icon"><svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="1.3" stroke-linecap="round" stroke-linejoin="round" v-html="iconPaths.mask"></svg></span>
|
||||
|
||||
@@ -19,6 +19,7 @@ const props = defineProps({
|
||||
tweaks: { type: Object, default: () => ({}) },
|
||||
registerEndpoint: { type: String, required: true },
|
||||
csrfToken: { type: String, required: true },
|
||||
inviteRequired: { type: Boolean, default: true },
|
||||
auth: { type: Object, default: () => ({}) },
|
||||
flash: { type: Object, default: () => ({}) },
|
||||
});
|
||||
@@ -58,7 +59,7 @@ onBeforeUnmount(() => revealObserver?.disconnect());
|
||||
<Realm :realm="realm" />
|
||||
<About />
|
||||
<Features />
|
||||
<Join :register-endpoint="registerEndpoint" :csrf-token="csrfToken" :auth="auth" :flash="flash" />
|
||||
<Join :register-endpoint="registerEndpoint" :csrf-token="csrfToken" :invite-required="inviteRequired" :auth="auth" :flash="flash" />
|
||||
<News :posts="posts" />
|
||||
<Footer :play-url="playUrl" />
|
||||
<Tweaks :tweaks="tweaks" />
|
||||
|
||||
Reference in New Issue
Block a user