1
0

Compare commits

..

2 Commits

Author SHA1 Message Date
cb075e56be Правка фронта
1. Улучшения мобильной версии
2. Улучшения комментариев фронта
3. Единый лоадер UI
2026-01-16 05:41:30 +07:00
36e844d4ea Дизайн Авторизации
Новая форма авторизации.
2026-01-15 16:26:45 +07:00
11 changed files with 867 additions and 244 deletions

View File

@@ -6,6 +6,6 @@ window.APP_CONFIG = {
IDLE_REFRESH_SECONDS: 1,
// Брейкпоинт для мобильной версии (px)
MOBILE_BREAKPOINT: 768
MOBILE_BREAKPOINT: 1400
}

View File

@@ -38,8 +38,12 @@
>
{{ cardDepartment.name_departments }}
</span>
<span v-if="card.files && card.files.length" class="files-badge" :title="card.files.length + ' файлов'">
<i data-lucide="image"></i>
<span v-if="card.comments_count" class="comments-indicator" :title="card.comments_count + ' комментариев'">
<i data-lucide="message-circle"></i>
<span class="indicator-count">{{ card.comments_count }}</span>
</span>
<span v-if="card.files && card.files.length" class="files-indicator" :title="card.files.length + ' файлов'">
<i data-lucide="image-plus"></i>
</span>
</div>
@@ -96,6 +100,10 @@
>
<i data-lucide="trash-2"></i>
</button>
<span v-if="card.comments_count" class="comments-indicator" :title="card.comments_count + ' комментариев'">
<i data-lucide="message-circle"></i>
<span class="indicator-count">{{ card.comments_count }}</span>
</span>
<span v-if="card.files && card.files.length" class="files-indicator">
<i data-lucide="image-plus"></i>
</span>
@@ -299,7 +307,8 @@ const closedDateText = computed(() => {
letter-spacing: 0.4px;
}
.files-badge {
.comments-indicator,
.files-indicator {
display: flex;
align-items: center;
gap: 4px;
@@ -307,11 +316,18 @@ const closedDateText = computed(() => {
color: var(--text-muted);
}
.files-badge i {
.comments-indicator i,
.comments-indicator svg,
.files-indicator i,
.files-indicator svg {
width: 14px;
height: 14px;
}
.indicator-count {
font-size: 11px;
}
/* Аватарка */
.card-assignee {
flex-shrink: 0;
@@ -373,19 +389,20 @@ const closedDateText = computed(() => {
display: flex;
align-items: center;
justify-content: center;
width: 32px;
height: 32px;
background: rgba(255, 255, 255, 0.08);
width: 24px;
height: 24px;
background: rgba(255, 255, 255, 0.1);
border: none;
border-radius: 8px;
color: var(--text-secondary);
border-radius: 6px;
color: var(--text-muted);
cursor: pointer;
transition: all 0.15s ease;
}
.btn-action i {
width: 16px;
height: 16px;
.btn-action i,
.btn-action svg {
width: 18px;
height: 18px;
}
.btn-restore:hover {
@@ -445,22 +462,32 @@ const closedDateText = computed(() => {
height: 24px;
}
.archive-card.mobile .btn-action i {
.archive-card.mobile .btn-action i,
.archive-card.mobile .btn-action svg {
width: 14px;
height: 14px;
}
.archive-card.mobile .comments-indicator,
.archive-card.mobile .files-indicator {
display: flex;
align-items: center;
gap: 3px;
color: var(--text-muted);
}
.archive-card.mobile .files-indicator i {
.archive-card.mobile .comments-indicator i,
.archive-card.mobile .comments-indicator svg,
.archive-card.mobile .files-indicator i,
.archive-card.mobile .files-indicator svg {
width: 14px;
height: 14px;
}
.archive-card.mobile .indicator-count {
font-size: 11px;
}
.archive-card.mobile .assignee {
width: 24px;
height: 24px;

View File

@@ -35,6 +35,10 @@
>
<i data-lucide="archive"></i>
</button>
<span v-if="card.comments_count" class="comments-indicator" :title="card.comments_count + ' комментариев'">
<i data-lucide="message-circle"></i>
<span class="indicator-count">{{ card.comments_count }}</span>
</span>
<span v-if="card.files && card.files.length" class="files-indicator" :title="card.files.length + ' изображений'">
<i data-lucide="image-plus"></i>
</span>
@@ -405,17 +409,27 @@ const handleArchive = () => {
gap: 8px;
}
.comments-indicator,
.files-indicator {
display: flex;
align-items: center;
gap: 3px;
color: var(--text-muted);
}
.files-indicator i {
.comments-indicator i,
.comments-indicator svg,
.files-indicator i,
.files-indicator svg {
width: 14px;
height: 14px;
}
.indicator-count {
font-size: 11px;
font-weight: 500;
}
.due-date {
font-size: 11px;
color: var(--text-muted);

View File

@@ -3,7 +3,8 @@
class="comment"
:class="{
'comment--own': isOwn,
'comment--reply': level > 0
'comment--reply': level > 0,
'is-mobile': isMobile
}"
:style="{ marginLeft: level * 24 + 'px' }"
>
@@ -14,8 +15,10 @@
<div class="comment-body">
<div class="comment-header">
<span class="comment-author">{{ comment.author_name }}</span>
<span class="comment-date">{{ formattedDate }}</span>
<div class="comment-meta" :class="{ 'is-mobile': isMobile }">
<span class="comment-author">{{ comment.author_name }}</span>
<span class="comment-date">{{ formattedDate }}</span>
</div>
<div class="comment-actions">
<IconButton
@@ -82,6 +85,9 @@
import { computed, onMounted, onUpdated } from 'vue'
import IconButton from '../ui/IconButton.vue'
import { serverSettings } from '../../api'
import { useMobile } from '../../composables/useMobile'
const { isMobile } = useMobile()
const props = defineProps({
comment: {
@@ -225,13 +231,17 @@ onUpdated(refreshIcons)
.comment-header {
display: flex;
align-items: center;
align-items: flex-start;
gap: 8px;
margin-bottom: 6px;
}
.comment-header .comment-date {
margin-right: auto;
.comment-meta {
display: flex;
align-items: center;
gap: 8px;
flex: 1;
min-width: 0;
}
.comment-author {
@@ -245,6 +255,13 @@ onUpdated(refreshIcons)
color: var(--text-muted);
}
/* Mobile: дата под ником (MOBILE_BREAKPOINT из config.js) */
.comment-meta.is-mobile {
flex-direction: column;
align-items: flex-start;
gap: 2px;
}
.comment-text {
font-size: 14px;
color: var(--text-secondary);
@@ -261,17 +278,6 @@ onUpdated(refreshIcons)
.comment-actions {
display: flex;
gap: 4px;
opacity: 0;
transition: opacity 0.15s;
}
.comment:hover .comment-actions {
opacity: 1;
}
/* Mobile: иконки видны всегда */
:global(body.is-mobile) .comment-actions {
opacity: 1;
}
.comment-btn-delete:hover {
@@ -364,4 +370,9 @@ onUpdated(refreshIcons)
width: 12px;
height: 12px;
}
/* Mobile: скрыть кнопку скачивания на миниатюре */
.comment.is-mobile .comment-file-download {
display: none;
}
</style>

View File

@@ -2,10 +2,7 @@
<div class="comments-tab">
<!-- Список комментариев -->
<div class="comments-list" ref="commentsListRef">
<div v-if="loading" class="comments-loading">
<span class="loader"></span>
Загрузка комментариев...
</div>
<Loader v-if="loading" text="Загрузка комментариев..." :inline="true" />
<div v-else-if="flatCommentsWithLevel.length === 0" class="comments-empty">
<i data-lucide="message-circle"></i>
@@ -207,6 +204,7 @@ import CommentForm from './CommentForm.vue'
import ConfirmDialog from '../ConfirmDialog.vue'
import SlidePanel from '../ui/SlidePanel.vue'
import RichTextEditor from '../ui/RichTextEditor.vue'
import Loader from '../ui/Loader.vue'
import { commentsApi, commentImageApi, getFullUrl } from '../../api'
import { useMobile } from '../../composables/useMobile'
@@ -316,14 +314,26 @@ const loadComments = async (silent = false) => {
if (hasChanges) {
comments.value = newData
emit('comments-loaded', newData.length)
await nextTick()
refreshIcons()
// Для первичной загрузки: убираем loading, ждём рендер, прокручиваем мгновенно
if (!silent) {
loading.value = false
await nextTick()
refreshIcons()
// Мгновенная прокрутка к последнему комментарию
if (commentsListRef.value) {
commentsListRef.value.scrollTop = commentsListRef.value.scrollHeight
}
} else {
await nextTick()
refreshIcons()
}
}
}
} catch (e) {
console.error('Ошибка загрузки комментариев:', e)
} finally {
if (!silent) {
if (!silent && loading.value) {
loading.value = false
}
}
@@ -618,9 +628,11 @@ const previewFile = (file, comment) => {
// Хелперы
const scrollToBottom = () => {
if (commentsListRef.value) {
commentsListRef.value.scrollTop = commentsListRef.value.scrollHeight
}
setTimeout(() => {
if (commentsListRef.value) {
commentsListRef.value.scrollTop = commentsListRef.value.scrollHeight
}
}, 100)
}
const refreshIcons = () => {
@@ -683,10 +695,11 @@ defineExpose({
<style scoped>
.comments-tab {
height: 100%;
display: flex;
flex-direction: column;
min-height: 0; /* Важно для flex overflow */
height: 100%;
min-height: 0;
overflow: hidden;
}
.comments-list {
@@ -695,21 +708,29 @@ defineExpose({
display: flex;
flex-direction: column;
gap: 12px;
padding: 2px; /* Для outline при редактировании */
padding-right: 6px;
margin-bottom: 16px;
min-height: 100px;
max-height: calc(100vh - 400px);
padding: 0 6px 16px 2px;
min-height: 0;
}
/* Mobile: убираем max-height, используем flex */
:global(body.is-mobile) .comments-list {
max-height: none;
min-height: 50px;
margin-bottom: 12px;
/* Стилизация скроллбара */
.comments-list::-webkit-scrollbar {
width: 6px;
}
.comments-list::-webkit-scrollbar-track {
background: rgba(255, 255, 255, 0.04);
border-radius: 3px;
}
.comments-list::-webkit-scrollbar-thumb {
background: rgba(0, 212, 170, 0.3);
border-radius: 3px;
}
.comments-list::-webkit-scrollbar-thumb:hover {
background: rgba(0, 212, 170, 0.5);
}
.comments-loading,
.comments-empty {
display: flex;
flex-direction: column;
@@ -727,21 +748,6 @@ defineExpose({
opacity: 0.5;
}
.loader {
width: 24px;
height: 24px;
border: 2px solid rgba(255, 255, 255, 0.1);
border-top-color: var(--accent);
border-radius: 50%;
animation: spin 0.8s linear infinite;
}
@keyframes spin {
to {
transform: rotate(360deg);
}
}
/* ========== Edit Panel Styles ========== */
.edit-panel-header {
display: flex;

View File

@@ -0,0 +1,60 @@
<template>
<div class="loader-container" :class="{ 'loader--inline': inline }">
<div class="loader-spinner"></div>
<span v-if="text" class="loader-text">{{ text }}</span>
</div>
</template>
<script setup>
defineProps({
text: {
type: String,
default: 'Загрузка...'
},
inline: {
type: Boolean,
default: false
}
})
</script>
<style scoped>
.loader-container {
display: flex;
flex-direction: column;
align-items: center;
justify-content: center;
gap: 16px;
padding: 80px;
color: var(--text-secondary);
}
.loader-container.loader--inline {
flex-direction: row;
padding: 40px;
gap: 12px;
}
.loader-spinner {
width: 40px;
height: 40px;
border: 3px solid rgba(255, 255, 255, 0.1);
border-top-color: var(--accent);
border-radius: 50%;
animation: spin 1s linear infinite;
}
.loader--inline .loader-spinner {
width: 24px;
height: 24px;
border-width: 2px;
}
.loader-text {
font-size: 14px;
}
@keyframes spin {
to { transform: rotate(360deg); }
}
</style>

View File

@@ -354,8 +354,9 @@ onUnmounted(() => {
.panel.mobile .panel-body {
padding: 16px;
padding-bottom: calc(16px + var(--safe-area-bottom, 0px));
min-height: 0; /* Важно для flex overflow */
gap: 16px;
min-height: 0;
gap: 0; /* Убираем gap — он создаёт пустое место */
overflow-y: auto;
}
.panel.mobile .panel-footer {

View File

@@ -88,10 +88,7 @@
</div>
<!-- Загрузка -->
<div v-if="loading" class="loading-state">
<i data-lucide="loader-2" class="spin"></i>
<span>Загрузка...</span>
</div>
<Loader v-if="loading" />
</div>
</main>
</div>
@@ -137,6 +134,7 @@ import TaskPanel from '../components/TaskPanel'
import ConfirmDialog from '../components/ConfirmDialog.vue'
import ProjectSelector from '../components/ProjectSelector.vue'
import MobileSelect from '../components/ui/MobileSelect.vue'
import Loader from '../components/ui/Loader.vue'
import { useProjectsStore } from '../stores/projects'
import { cardsApi } from '../api'
import { useMobile } from '../composables/useMobile'
@@ -469,30 +467,6 @@ onMounted(async () => {
font-size: 13px;
}
/* Загрузка */
.loading-state {
display: flex;
align-items: center;
justify-content: center;
gap: 12px;
padding: 60px 20px;
color: var(--text-muted);
}
.loading-state i {
width: 20px;
height: 20px;
}
.spin {
animation: spin 1s linear infinite;
}
@keyframes spin {
from { transform: rotate(0deg); }
to { transform: rotate(360deg); }
}
/* ========== MOBILE ========== */
.app.mobile {
flex-direction: column;

View File

@@ -1,184 +1,710 @@
<template>
<div class="login-page">
<div class="login-card">
<!-- Логотип -->
<div class="login-logo">
<i data-lucide="layout-grid"></i>
<span>TaskBoard</span>
</div>
<div class="login-page" :class="{ 'is-mobile': isMobile }">
<!-- Левитирующие иконки на фоне -->
<div class="floating-icons">
<div class="float-icon icon-1"><i data-lucide="check-square"></i></div>
<div class="float-icon icon-2"><i data-lucide="clipboard-list"></i></div>
<div class="float-icon icon-3"><i data-lucide="calendar"></i></div>
<div class="float-icon icon-4"><i data-lucide="users"></i></div>
<div class="float-icon icon-5"><i data-lucide="folder"></i></div>
<div class="float-icon icon-6"><i data-lucide="target"></i></div>
<div class="float-icon icon-7"><i data-lucide="star"></i></div>
<div class="float-icon icon-8"><i data-lucide="zap"></i></div>
<div class="float-icon icon-9"><i data-lucide="flag"></i></div>
<div class="float-icon icon-10"><i data-lucide="layers"></i></div>
<div class="float-icon icon-11"><i data-lucide="clock"></i></div>
<div class="float-icon icon-12"><i data-lucide="message-circle"></i></div>
</div>
<!-- Градиентные сферы на фоне -->
<div class="bg-glow glow-2"></div>
<div class="bg-glow glow-3"></div>
<!-- Контент авторизации -->
<div class="login-content" :class="{ 'is-loading': isAuthenticating, 'is-success': showSuccess }">
<form @submit.prevent="handleLogin" class="login-form">
<!-- Поле логина -->
<div class="field">
<input
type="text"
v-model="login"
placeholder="Логин"
autocomplete="username"
>
<!-- Состояние успеха -->
<Transition name="success-fade">
<div v-if="showSuccess" class="success-state">
<div class="success-icon">
<i data-lucide="check"></i>
</div>
<h1 class="success-title">Добро пожаловать!</h1>
<p class="success-text">Авторизация прошла успешно</p>
<div class="success-loader">
<span></span><span></span><span></span>
</div>
</div>
<!-- Поле пароля -->
<div class="field">
<input
type="password"
v-model="password"
placeholder="Пароль"
autocomplete="current-password"
>
</Transition>
<!-- Форма входа -->
<Transition name="form-fade">
<div v-if="!showSuccess" class="login-form-wrapper">
<!-- Логотип -->
<div class="login-header">
<div class="logo-icon">
<i data-lucide="layout-grid"></i>
</div>
<h1 class="login-title">TaskBoard</h1>
<p class="login-subtitle">Войдите в систему управления задачами</p>
</div>
<form @submit.prevent="handleLogin" class="login-form">
<!-- Поле логина -->
<div class="input-group" :class="{ 'has-value': login, 'has-focus': loginFocused }">
<div class="input-icon">
<i data-lucide="user"></i>
</div>
<input
type="text"
v-model="login"
@focus="loginFocused = true"
@blur="loginFocused = false"
placeholder="Введите логин"
autocomplete="username"
:disabled="isAuthenticating"
>
<div class="input-line"></div>
</div>
<!-- Поле пароля -->
<div class="input-group" :class="{ 'has-value': password, 'has-focus': passwordFocused }">
<div class="input-icon">
<i data-lucide="lock"></i>
</div>
<input
type="password"
v-model="password"
@focus="passwordFocused = true"
@blur="passwordFocused = false"
placeholder="Введите пароль"
autocomplete="current-password"
:disabled="isAuthenticating"
>
<div class="input-line"></div>
</div>
<!-- Ошибка -->
<Transition name="error-shake">
<div v-if="error" class="error-message">
<i data-lucide="alert-circle"></i>
<span>{{ error }}</span>
</div>
</Transition>
<!-- Кнопка входа -->
<button
type="submit"
class="login-btn"
:class="{ 'is-loading': isAuthenticating }"
:disabled="isAuthenticating || !login || !password"
>
<span class="btn-text">Войти</span>
<span class="btn-loader">
<span></span><span></span><span></span>
</span>
<i data-lucide="arrow-right" class="btn-arrow"></i>
</button>
</form>
</div>
<!-- Ошибка -->
<div v-if="error" class="error-message">
{{ error }}
</div>
<!-- Кнопка входа -->
<button type="submit" class="login-btn" :disabled="loading">
<span v-if="loading">Вход...</span>
<span v-else>Войти</span>
</button>
</form>
</Transition>
</div>
</div>
</template>
<script setup>
import { ref, onMounted } from 'vue'
import { ref, onMounted, nextTick, watch } from 'vue'
import { useRouter } from 'vue-router'
import { authApi } from '../api'
import { authApi, cardsApi } from '../api'
import { useProjectsStore } from '../stores/projects'
import { useMobile } from '../composables/useMobile'
const { isMobile } = useMobile()
const router = useRouter()
const store = useProjectsStore()
const login = ref('')
const password = ref('')
const error = ref('')
const loading = ref(false)
const isAuthenticating = ref(false)
const showSuccess = ref(false)
const loginFocused = ref(false)
const passwordFocused = ref(false)
// Предзагрузка данных пока показывается анимация успеха
const prefetchData = async () => {
try {
// Загружаем проекты, колонки, отделы, лейблы, юзеров
await store.init()
// Если есть текущий проект — загружаем карточки
if (store.currentProjectId) {
const result = await cardsApi.getAll(store.currentProjectId)
if (result.success) {
// Сохраняем в sessionStorage для MainApp
sessionStorage.setItem('prefetchedCards', JSON.stringify(result.data))
}
}
} catch (e) {
console.error('Prefetch error:', e)
}
}
const handleLogin = async () => {
error.value = ''
loading.value = true
isAuthenticating.value = true
try {
const data = await authApi.login(login.value, password.value)
if (data.success) {
// Показываем анимацию успеха
showSuccess.value = true
await nextTick()
refreshIcons()
// Параллельно: предзагрузка данных + ожидание анимации
const prefetchPromise = prefetchData()
const animationPromise = new Promise(resolve => setTimeout(resolve, 1800))
// Ждём обоих (минимум 1.8 сек анимации)
await Promise.all([prefetchPromise, animationPromise])
router.push('/')
} else {
isAuthenticating.value = false
error.value = data.errors?.username || data.errors?.password || 'Неверный логин или пароль'
await nextTick()
refreshIcons()
}
} catch (e) {
isAuthenticating.value = false
error.value = 'Ошибка подключения к серверу'
} finally {
loading.value = false
await nextTick()
refreshIcons()
}
}
onMounted(() => {
const refreshIcons = () => {
if (window.lucide) {
window.lucide.createIcons()
}
}
onMounted(refreshIcons)
// Обновляем иконки только когда меняется состояние успеха
watch(showSuccess, () => {
nextTick(refreshIcons)
})
</script>
<style scoped>
.login-page {
min-height: 100vh;
min-height: 100dvh;
display: flex;
align-items: center;
justify-content: center;
background: var(--bg-body);
background: linear-gradient(135deg, #0a0a0c 0%, #111113 50%, #0d1117 100%);
position: relative;
overflow: hidden;
padding: 20px;
}
.login-card {
width: 100%;
max-width: 400px;
background: var(--bg-sidebar);
border-radius: 16px;
padding: 40px;
border: 1px solid rgba(255, 255, 255, 0.06);
/* Градиентные сферы на фоне */
.bg-glow {
position: absolute;
border-radius: 50%;
filter: blur(120px);
opacity: 0.4;
pointer-events: none;
}
.login-logo {
.glow-2 {
width: 500px;
height: 500px;
background: radial-gradient(circle, rgba(96, 165, 250, 0.25) 0%, transparent 70%);
bottom: -150px;
left: -100px;
animation: glowFloat2 10s ease-in-out infinite;
}
.glow-3 {
width: 400px;
height: 400px;
background: radial-gradient(circle, rgba(244, 114, 182, 0.2) 0%, transparent 70%);
top: 50%;
left: 50%;
transform: translate(-50%, -50%);
animation: glowFloat3 12s ease-in-out infinite;
}
@keyframes glowFloat2 {
0%, 100% { transform: translate(0, 0) scale(1); }
50% { transform: translate(40px, -20px) scale(1.05); }
}
@keyframes glowFloat3 {
0%, 100% { transform: translate(-50%, -50%) scale(1); opacity: 0.3; }
50% { transform: translate(-50%, -50%) scale(1.2); opacity: 0.5; }
}
/* Левитирующие иконки */
.floating-icons {
position: absolute;
inset: 0;
pointer-events: none;
overflow: hidden;
}
.float-icon {
position: absolute;
color: rgba(255, 255, 255, 0.04);
transition: color 0.3s;
}
.float-icon i,
.float-icon svg {
width: 100%;
height: 100%;
}
.icon-1 { width: 48px; height: 48px; top: 8%; left: 12%; animation: float1 6s ease-in-out infinite; }
.icon-2 { width: 36px; height: 36px; top: 15%; right: 18%; animation: float2 7s ease-in-out infinite; }
.icon-3 { width: 42px; height: 42px; top: 25%; left: 8%; animation: float3 8s ease-in-out infinite; }
.icon-4 { width: 32px; height: 32px; top: 35%; right: 10%; animation: float1 5s ease-in-out infinite; }
.icon-5 { width: 40px; height: 40px; top: 55%; left: 15%; animation: float2 9s ease-in-out infinite; }
.icon-6 { width: 44px; height: 44px; top: 65%; right: 20%; animation: float3 6s ease-in-out infinite; }
.icon-7 { width: 28px; height: 28px; top: 75%; left: 10%; animation: float1 7s ease-in-out infinite; }
.icon-8 { width: 38px; height: 38px; top: 85%; right: 15%; animation: float2 8s ease-in-out infinite; }
.icon-9 { width: 34px; height: 34px; bottom: 20%; left: 25%; animation: float3 5s ease-in-out infinite; }
.icon-10 { width: 46px; height: 46px; top: 45%; left: 5%; animation: float1 10s ease-in-out infinite; }
.icon-11 { width: 30px; height: 30px; top: 20%; left: 25%; animation: float2 6s ease-in-out infinite; }
.icon-12 { width: 36px; height: 36px; bottom: 30%; right: 8%; animation: float3 7s ease-in-out infinite; }
@keyframes float1 {
0%, 100% { transform: translateY(0) rotate(0deg); }
25% { transform: translateY(-15px) rotate(5deg); }
75% { transform: translateY(10px) rotate(-3deg); }
}
@keyframes float2 {
0%, 100% { transform: translateY(0) rotate(0deg); }
33% { transform: translateY(-20px) rotate(-5deg); }
66% { transform: translateY(15px) rotate(3deg); }
}
@keyframes float3 {
0%, 100% { transform: translateY(0) translateX(0); }
50% { transform: translateY(-12px) translateX(8px); }
}
/* Контент */
.login-content {
position: relative;
z-index: 10;
width: 100%;
max-width: 420px;
display: flex;
align-items: center;
justify-content: center;
gap: 12px;
margin-bottom: 32px;
color: var(--text-primary);
}
.login-logo i {
width: 32px;
height: 32px;
color: var(--accent);
}
.login-logo span {
font-size: 24px;
font-weight: 600;
}
.login-form {
.login-form-wrapper {
display: flex;
flex-direction: column;
gap: 20px;
}
.field input {
gap: 40px;
width: 100%;
padding: 14px 16px;
background: rgba(255, 255, 255, 0.04);
border: 1px solid rgba(255, 255, 255, 0.08);
border-radius: 10px;
color: var(--text-primary);
font-family: inherit;
font-size: 14px;
transition: all 0.15s;
}
.field input::placeholder {
color: var(--text-muted);
}
.field input:focus {
outline: none;
border-color: var(--accent);
background: rgba(255, 255, 255, 0.06);
}
.error-message {
padding: 12px 16px;
background: rgba(239, 68, 68, 0.15);
border: 1px solid rgba(239, 68, 68, 0.3);
border-radius: 8px;
color: #ef4444;
font-size: 13px;
/* Заголовок */
.login-header {
text-align: center;
}
.login-btn {
width: 100%;
padding: 14px;
background: var(--accent);
.logo-icon {
width: 72px;
height: 72px;
margin: 0 auto 20px;
background: linear-gradient(135deg, var(--accent) 0%, #00e6b8 100%);
border-radius: 20px;
display: flex;
align-items: center;
justify-content: center;
box-shadow: 0 20px 60px rgba(0, 212, 170, 0.3);
animation: logoFloat 4s ease-in-out infinite;
}
.logo-icon i,
.logo-icon svg {
width: 36px;
height: 36px;
color: #000;
}
@keyframes logoFloat {
0%, 100% { transform: translateY(0); }
50% { transform: translateY(-8px); }
}
.login-title {
font-size: 32px;
font-weight: 700;
color: var(--text-primary);
margin-bottom: 8px;
letter-spacing: -0.5px;
}
.login-subtitle {
font-size: 15px;
color: var(--text-muted);
font-weight: 400;
}
/* Форма */
.login-form {
display: flex;
flex-direction: column;
gap: 24px;
}
/* Группа инпута */
.input-group {
position: relative;
display: flex;
align-items: center;
gap: 16px;
padding: 0 4px;
}
.input-icon {
width: 24px;
height: 24px;
color: var(--text-muted);
transition: color 0.3s, transform 0.3s;
flex-shrink: 0;
}
.input-icon i,
.input-icon svg {
width: 24px;
height: 24px;
}
.input-group.has-focus .input-icon,
.input-group.has-value .input-icon {
color: var(--accent);
transform: scale(1.1);
}
.input-group input {
flex: 1;
background: transparent;
border: none;
border-radius: 10px;
padding: 16px 0;
color: var(--text-primary);
font-family: inherit;
font-size: 16px;
font-weight: 400;
outline: none;
}
.input-group input::placeholder {
color: var(--text-muted);
transition: opacity 0.3s;
}
.input-group.has-focus input::placeholder {
opacity: 0.5;
}
.input-group input:disabled {
opacity: 0.5;
}
/* Линия под инпутом */
.input-line {
position: absolute;
bottom: 0;
left: 44px;
right: 0;
height: 2px;
background: rgba(255, 255, 255, 0.08);
border-radius: 1px;
overflow: hidden;
}
.input-line::after {
content: '';
position: absolute;
inset: 0;
background: linear-gradient(90deg, var(--accent), #00e6b8);
transform: scaleX(0);
transform-origin: left;
transition: transform 0.3s ease;
}
.input-group.has-focus .input-line::after,
.input-group.has-value .input-line::after {
transform: scaleX(1);
}
/* Ошибка */
.error-message {
display: flex;
align-items: center;
gap: 10px;
padding: 14px 18px;
background: rgba(248, 113, 113, 0.08);
border: 1px solid rgba(248, 113, 113, 0.2);
border-radius: 12px;
color: #f87171;
font-size: 14px;
}
.error-message i,
.error-message svg {
width: 18px;
height: 18px;
flex-shrink: 0;
}
/* Кнопка входа */
.login-btn {
position: relative;
width: 100%;
padding: 18px 24px;
background: linear-gradient(135deg, var(--accent) 0%, #00e6b8 100%);
border: none;
border-radius: 14px;
color: #000;
font-family: inherit;
font-size: 15px;
font-size: 16px;
font-weight: 600;
cursor: pointer;
transition: all 0.15s;
overflow: hidden;
transition: all 0.3s ease;
display: flex;
align-items: center;
justify-content: center;
gap: 10px;
margin-top: 8px;
box-shadow: 0 10px 40px rgba(0, 212, 170, 0.3);
}
.login-btn:hover:not(:disabled) {
background: #00e6b8;
transform: translateY(-2px);
box-shadow: 0 15px 50px rgba(0, 212, 170, 0.4);
}
.login-btn:active:not(:disabled) {
transform: translateY(0);
}
.login-btn:disabled {
opacity: 0.6;
opacity: 0.5;
cursor: not-allowed;
box-shadow: none;
}
.btn-text {
transition: opacity 0.3s, transform 0.3s;
}
.btn-arrow {
width: 20px;
height: 20px;
transition: opacity 0.3s, transform 0.3s;
}
.btn-loader {
position: absolute;
display: flex;
gap: 6px;
opacity: 0;
transform: scale(0.8);
transition: opacity 0.3s, transform 0.3s;
}
.btn-loader span {
width: 8px;
height: 8px;
background: #000;
border-radius: 50%;
animation: btnLoaderBounce 1.2s ease-in-out infinite;
}
.btn-loader span:nth-child(2) { animation-delay: 0.1s; }
.btn-loader span:nth-child(3) { animation-delay: 0.2s; }
@keyframes btnLoaderBounce {
0%, 80%, 100% { transform: scale(0.8); opacity: 0.5; }
40% { transform: scale(1.2); opacity: 1; }
}
.login-btn.is-loading .btn-text,
.login-btn.is-loading .btn-arrow {
opacity: 0;
transform: scale(0.8);
}
.login-btn.is-loading .btn-loader {
opacity: 1;
transform: scale(1);
}
/* Состояние успеха */
.success-state {
display: flex;
flex-direction: column;
align-items: center;
text-align: center;
animation: successAppear 0.6s ease;
}
@keyframes successAppear {
0% { opacity: 0; transform: scale(0.9); }
100% { opacity: 1; transform: scale(1); }
}
.success-icon {
width: 100px;
height: 100px;
background: linear-gradient(135deg, var(--accent) 0%, #00e6b8 100%);
border-radius: 50%;
display: flex;
align-items: center;
justify-content: center;
margin-bottom: 28px;
box-shadow: 0 25px 80px rgba(0, 212, 170, 0.4);
animation: successPulse 1.5s ease-in-out infinite;
}
.success-icon i,
.success-icon svg {
width: 48px;
height: 48px;
color: #000;
animation: successCheck 0.5s ease 0.2s both;
}
@keyframes successPulse {
0%, 100% { transform: scale(1); box-shadow: 0 25px 80px rgba(0, 212, 170, 0.4); }
50% { transform: scale(1.05); box-shadow: 0 30px 100px rgba(0, 212, 170, 0.5); }
}
@keyframes successCheck {
0% { transform: scale(0) rotate(-45deg); opacity: 0; }
50% { transform: scale(1.2) rotate(10deg); }
100% { transform: scale(1) rotate(0); opacity: 1; }
}
.success-title {
font-size: 28px;
font-weight: 700;
color: var(--text-primary);
margin-bottom: 8px;
}
.success-text {
font-size: 16px;
color: var(--text-secondary);
margin-bottom: 32px;
}
.success-loader {
display: flex;
gap: 8px;
}
.success-loader span {
width: 10px;
height: 10px;
background: var(--accent);
border-radius: 50%;
animation: successLoaderBounce 1.4s ease-in-out infinite;
}
.success-loader span:nth-child(2) { animation-delay: 0.16s; }
.success-loader span:nth-child(3) { animation-delay: 0.32s; }
@keyframes successLoaderBounce {
0%, 80%, 100% { transform: scale(0.6); opacity: 0.4; }
40% { transform: scale(1); opacity: 1; }
}
/* Transitions */
.form-fade-enter-active,
.form-fade-leave-active {
transition: opacity 0.4s ease, transform 0.4s ease;
}
.form-fade-enter-from {
opacity: 0;
transform: scale(0.95);
}
.form-fade-leave-to {
opacity: 0;
transform: scale(0.95);
position: absolute;
width: 100%;
}
.success-fade-enter-active {
transition: opacity 0.5s ease 0.2s, transform 0.5s ease 0.2s;
}
.success-fade-enter-from {
opacity: 0;
transform: scale(0.9);
}
.error-shake-enter-active {
animation: errorShake 0.5s ease;
}
.error-shake-leave-active {
transition: opacity 0.2s ease, transform 0.2s ease;
}
.error-shake-leave-to {
opacity: 0;
transform: translateY(-10px);
}
@keyframes errorShake {
0% { opacity: 0; transform: translateX(0) translateY(-10px); }
20% { opacity: 1; transform: translateX(-8px) translateY(0); }
40% { transform: translateX(8px); }
60% { transform: translateX(-4px); }
80% { transform: translateX(4px); }
100% { transform: translateX(0); }
}
/* Мобильная адаптация (MOBILE_BREAKPOINT из config.js) */
.login-page.is-mobile .login-title {
font-size: 26px;
}
.login-page.is-mobile .login-subtitle {
font-size: 14px;
}
.login-page.is-mobile .logo-icon {
width: 64px;
height: 64px;
}
.login-page.is-mobile .logo-icon i,
.login-page.is-mobile .logo-icon svg {
width: 32px;
height: 32px;
}
.login-page.is-mobile .float-icon {
opacity: 0.5;
}
</style>

View File

@@ -67,7 +67,9 @@
<!-- Доска с колонками и карточками -->
<main class="main">
<Loader v-if="loading" />
<Board
v-else
ref="boardRef"
:active-department="activeDepartment"
:departments="store.departments"
@@ -109,6 +111,7 @@ import Board from '../components/Board.vue'
import TaskPanel from '../components/TaskPanel'
import ProjectSelector from '../components/ProjectSelector.vue'
import MobileSelect from '../components/ui/MobileSelect.vue'
import Loader from '../components/ui/Loader.vue'
import { useProjectsStore } from '../stores/projects'
import { cardsApi } from '../api'
import { useMobile } from '../composables/useMobile'
@@ -126,18 +129,32 @@ const departmentOptions = computed(() => [
// ==================== КАРТОЧКИ ====================
const cards = ref([])
const loading = ref(true)
// Загрузка карточек текущего проекта
const fetchCards = async () => {
if (!store.currentProjectId) return
// Загрузка карточек текущего проекта (silent = тихое обновление без Loader)
const fetchCards = async (silent = false) => {
if (!store.currentProjectId) {
loading.value = false
return
}
const result = await cardsApi.getAll(store.currentProjectId)
if (result.success) cards.value = result.data
if (!silent) {
loading.value = true
}
try {
const result = await cardsApi.getAll(store.currentProjectId)
if (result.success) cards.value = result.data
} finally {
if (!silent) {
loading.value = false
}
}
}
// При смене проекта — перезагружаем карточки
const onProjectChange = async () => {
activeDepartment.value = null
loading.value = true
await fetchCards()
}
@@ -206,7 +223,7 @@ const startPolling = () => {
if (pollTimer) clearInterval(pollTimer)
pollTimer = setInterval(async () => {
console.log('[AutoRefresh] Обновление данных...')
await fetchCards()
await fetchCards(true) // silent = true, без Loader
}, REFRESH_INTERVAL)
}
@@ -219,8 +236,23 @@ const stopPolling = () => {
// ==================== ИНИЦИАЛИЗАЦИЯ ====================
onMounted(async () => {
// Store уже мог быть инициализирован при логине (prefetch)
await store.init()
await fetchCards()
// Проверяем предзагруженные карточки
const prefetchedCards = sessionStorage.getItem('prefetchedCards')
if (prefetchedCards) {
try {
cards.value = JSON.parse(prefetchedCards)
sessionStorage.removeItem('prefetchedCards')
loading.value = false
} catch (e) {
await fetchCards()
}
} else {
await fetchCards()
}
startPolling()
if (window.lucide) window.lucide.createIcons()

View File

@@ -6,10 +6,7 @@
<Header title="Команда" subtitle="Наша команда специалистов" />
<main class="main">
<div v-if="loading" class="loading">
<div class="spinner"></div>
<span>Загрузка...</span>
</div>
<Loader v-if="loading" />
<!-- Desktop: grid -->
<div v-else-if="!isMobile" class="team-grid">
@@ -92,6 +89,7 @@
import { ref, onMounted, onUpdated } from 'vue'
import Sidebar from '../components/Sidebar.vue'
import Header from '../components/Header.vue'
import Loader from '../components/ui/Loader.vue'
import { usersApi, getFullUrl } from '../api'
import { useMobile } from '../composables/useMobile'
@@ -187,28 +185,6 @@ onUpdated(refreshIcons)
background: rgba(255, 255, 255, 0.25);
}
.loading {
display: flex;
flex-direction: column;
align-items: center;
justify-content: center;
gap: 16px;
padding: 80px;
color: var(--text-secondary);
}
.spinner {
width: 40px;
height: 40px;
border: 3px solid rgba(255, 255, 255, 0.1);
border-top-color: var(--accent);
border-radius: 50%;
animation: spin 1s linear infinite;
}
@keyframes spin {
to { transform: rotate(360deg); }
}
.team-grid {
display: grid;
@@ -341,10 +317,6 @@ onUpdated(refreshIcons)
overflow: hidden;
}
.app.mobile .loading {
padding: 40px;
}
/* Mobile swipe cards */
.mobile-cards {
width: 100%;