init: чистый старт Laravel + Vuexy

This commit is contained in:
2026-02-20 13:30:03 +03:00
commit af53445c26
474 changed files with 58860 additions and 0 deletions

View File

@@ -0,0 +1,54 @@
<script setup lang="ts">
import { useGenerateImageVariant } from '@core/composable/useGenerateImageVariant'
import misc404 from '@images/pages/404.png'
import miscMaskDark from '@images/pages/misc-mask-dark.png'
import miscMaskLight from '@images/pages/misc-mask-light.png'
const authThemeMask = useGenerateImageVariant(miscMaskLight, miscMaskDark)
definePage({
alias: '/pages/misc/not-found/:error(.*)',
meta: {
layout: 'blank',
public: true,
},
})
</script>
<template>
<div class="misc-wrapper">
<ErrorHeader
status-code="404"
title="Page Not Found ⚠️"
description="We couldn't find the page you are looking for."
/>
<VBtn
to="/"
class="mb-11"
>
Back to Home
</VBtn>
<!-- 👉 Image -->
<div class="misc-avatar w-100 text-center">
<VImg
:src="misc404"
alt="error 404"
:max-height="$vuetify.display.smAndDown ? 350 : 500"
class="mx-auto"
/>
</div>
<img
class="misc-footer-img d-none d-md-block"
:src="authThemeMask"
alt="misc-footer-img"
height="320"
>
</div>
</template>
<style lang="scss">
@use "@core-scss/template/pages/misc.scss";
</style>

428
resources/ts/pages/chat.vue Normal file
View File

@@ -0,0 +1,428 @@
<script lang="ts" setup>
import { PerfectScrollbar } from 'vue3-perfect-scrollbar'
import { useDisplay, useTheme } from 'vuetify'
import { themes } from '@/plugins/vuetify/theme'
import ChatActiveChatUserProfileSidebarContent from '@/views/apps/chat/ChatActiveChatUserProfileSidebarContent.vue'
import ChatLeftSidebarContent from '@/views/apps/chat/ChatLeftSidebarContent.vue'
import ChatLog from '@/views/apps/chat/ChatLog.vue'
import ChatUserProfileSidebarContent from '@/views/apps/chat/ChatUserProfileSidebarContent.vue'
import { useChat } from '@/views/apps/chat/useChat'
import { useChatStore } from '@/views/apps/chat/useChatStore'
import type { ChatContact as TypeChatContact } from '@db/apps/chat/types'
definePage({
meta: {
layoutWrapperClasses: 'layout-content-height-fixed',
},
})
// composables
const vuetifyDisplays = useDisplay()
const store = useChatStore()
const { isLeftSidebarOpen } = useResponsiveLeftSidebar(vuetifyDisplays.smAndDown)
const { resolveAvatarBadgeVariant } = useChat()
// Perfect scrollbar
const chatLogPS = ref()
const scrollToBottomInChatLog = () => {
const scrollEl = chatLogPS.value.$el || chatLogPS.value
scrollEl.scrollTop = scrollEl.scrollHeight
}
// Search query
const q = ref('')
watch(
q,
val => store.fetchChatsAndContacts(val),
{ immediate: true },
)
// Open Sidebar in smAndDown when "start conversation" is clicked
const startConversation = () => {
if (vuetifyDisplays.mdAndUp.value)
return
isLeftSidebarOpen.value = true
}
// Chat message
const msg = ref('')
const sendMessage = async () => {
if (!msg.value)
return
await store.sendMsg(msg.value)
// Reset message input
msg.value = ''
// Scroll to bottom
nextTick(() => {
scrollToBottomInChatLog()
})
}
const openChatOfContact = async (userId: TypeChatContact['id']) => {
await store.getChat(userId)
// Reset message input
msg.value = ''
// Set unseenMsgs to 0
const contact = store.chatsContacts.find(c => c.id === userId)
if (contact)
contact.chat.unseenMsgs = 0
// if smAndDown => Close Chat & Contacts left sidebar
if (vuetifyDisplays.smAndDown.value)
isLeftSidebarOpen.value = false
// Scroll to bottom
nextTick(() => {
scrollToBottomInChatLog()
})
}
// User profile sidebar
const isUserProfileSidebarOpen = ref(false)
// Active chat user profile sidebar
const isActiveChatUserProfileSidebarOpen = ref(false)
// file input
const refInputEl = ref<HTMLElement>()
const { name } = useTheme()
const chatContentContainerBg = computed(() => {
let color = 'transparent'
if (themes)
color = themes?.[name.value].colors?.background as string
return color
})
</script>
<template>
<VLayout
class="chat-app-layout"
style="z-index: 0;"
>
<!-- 👉 user profile sidebar -->
<VNavigationDrawer
v-model="isUserProfileSidebarOpen"
data-allow-mismatch
temporary
touchless
absolute
class="user-profile-sidebar"
location="start"
width="370"
>
<ChatUserProfileSidebarContent @close="isUserProfileSidebarOpen = false" />
</VNavigationDrawer>
<!-- 👉 Active Chat sidebar -->
<VNavigationDrawer
v-model="isActiveChatUserProfileSidebarOpen"
data-allow-mismatch
width="374"
absolute
temporary
location="end"
touchless
class="active-chat-user-profile-sidebar"
>
<ChatActiveChatUserProfileSidebarContent @close="isActiveChatUserProfileSidebarOpen = false" />
</VNavigationDrawer>
<!-- 👉 Left sidebar -->
<VNavigationDrawer
v-model="isLeftSidebarOpen"
data-allow-mismatch
absolute
touchless
location="start"
width="370"
:temporary="$vuetify.display.smAndDown"
class="chat-list-sidebar"
:permanent="$vuetify.display.mdAndUp"
>
<ChatLeftSidebarContent
v-model:is-drawer-open="isLeftSidebarOpen"
v-model:search="q"
@open-chat-of-contact="openChatOfContact"
@show-user-profile="isUserProfileSidebarOpen = true"
@close="isLeftSidebarOpen = false"
/>
</VNavigationDrawer>
<!-- 👉 Chat content -->
<VMain class="chat-content-container">
<!-- 👉 Right content: Active Chat -->
<div
v-if="store.activeChat"
class="d-flex flex-column h-100"
>
<!-- 👉 Active chat header -->
<div class="active-chat-header d-flex align-center text-medium-emphasis bg-surface">
<!-- Sidebar toggler -->
<IconBtn
class="d-md-none me-3"
@click="isLeftSidebarOpen = true"
>
<VIcon icon="tabler-menu-2" />
</IconBtn>
<!-- avatar -->
<div
class="d-flex align-center cursor-pointer"
@click="isActiveChatUserProfileSidebarOpen = true"
>
<VBadge
dot
location="bottom right"
offset-x="3"
offset-y="0"
:color="resolveAvatarBadgeVariant(store.activeChat.contact.status)"
bordered
>
<VAvatar
size="40"
:variant="!store.activeChat.contact.avatar ? 'tonal' : undefined"
:color="!store.activeChat.contact.avatar ? resolveAvatarBadgeVariant(store.activeChat.contact.status) : undefined"
class="cursor-pointer"
>
<VImg
v-if="store.activeChat.contact.avatar"
:src="store.activeChat.contact.avatar"
:alt="store.activeChat.contact.fullName"
/>
<span v-else>{{ avatarText(store.activeChat.contact.fullName) }}</span>
</VAvatar>
</VBadge>
<div class="flex-grow-1 ms-4 overflow-hidden">
<div class="text-h6 mb-0 font-weight-regular">
{{ store.activeChat.contact.fullName }}
</div>
<p class="text-truncate mb-0 text-body-2">
{{ store.activeChat.contact.role }}
</p>
</div>
</div>
<VSpacer />
<!-- Header right content -->
<div class="d-sm-flex align-center d-none text-medium-emphasis">
<IconBtn>
<VIcon icon="tabler-phone" />
</IconBtn>
<IconBtn>
<VIcon icon="tabler-video" />
</IconBtn>
<IconBtn>
<VIcon icon="tabler-search" />
</IconBtn>
<IconBtn>
<VIcon icon="tabler-dots-vertical" />
</IconBtn>
</div>
</div>
<VDivider />
<!-- Chat log -->
<PerfectScrollbar
ref="chatLogPS"
tag="ul"
:options="{ wheelPropagation: false }"
class="flex-grow-1"
>
<ChatLog />
</PerfectScrollbar>
<!-- Message form -->
<VForm
class="chat-log-message-form mb-5 mx-5"
@submit.prevent="sendMessage"
>
<VTextField
:key="store.activeChat?.contact.id"
v-model="msg"
variant="solo"
density="default"
class="chat-message-input"
placeholder="Type your message..."
autofocus
>
<template #append-inner>
<div class="d-flex gap-1">
<IconBtn>
<VIcon
icon="tabler-microphone"
size="22"
/>
</IconBtn>
<IconBtn @click="refInputEl?.click()">
<VIcon
icon="tabler-paperclip"
size="22"
/>
</IconBtn>
<div class="d-none d-md-block">
<VBtn
append-icon="tabler-send"
@click="sendMessage"
>
Send
</VBtn>
</div>
<IconBtn
class="d-block d-md-none"
@click="sendMessage"
>
<VIcon icon="tabler-send" />
</IconBtn>
</div>
</template>
</VTextField>
<input
ref="refInputEl"
type="file"
name="file"
accept=".jpeg,.png,.jpg,GIF"
hidden
>
</VForm>
</div>
<!-- 👉 Start conversation -->
<div
v-else
class="d-flex h-100 align-center justify-center flex-column"
>
<VAvatar
size="98"
variant="tonal"
color="primary"
class="mb-4"
>
<VIcon
size="50"
class="rounded-0"
icon="tabler-message-2"
/>
</VAvatar>
<VBtn
v-if="$vuetify.display.smAndDown"
rounded="pill"
@click="startConversation"
>
Start Conversation
</VBtn>
<p
v-else
style="max-inline-size: 40ch; text-wrap: balance;"
class="text-center text-disabled"
>
Start connecting with the people by selecting one of the contact on left
</p>
</div>
</VMain>
</VLayout>
</template>
<style lang="scss">
@use "@styles/variables/vuetify";
@use "@core-scss/base/mixins";
@use "@layouts/styles/mixins" as layoutsMixins;
// Variables
$chat-app-header-height: 76px;
// Placeholders
%chat-header {
display: flex;
align-items: center;
min-block-size: $chat-app-header-height;
padding-inline: 1.5rem;
}
.chat-start-conversation-btn {
cursor: default;
}
.chat-app-layout {
border-radius: vuetify.$card-border-radius;
@include mixins.elevation(vuetify.$card-elevation);
$sel-chat-app-layout: &;
@at-root {
.skin--bordered {
@include mixins.bordered-skin($sel-chat-app-layout);
}
}
.active-chat-user-profile-sidebar,
.user-profile-sidebar {
.v-navigation-drawer__content {
display: flex;
flex-direction: column;
}
}
.chat-list-header,
.active-chat-header {
@extend %chat-header;
}
.chat-list-sidebar {
.v-navigation-drawer__content {
display: flex;
flex-direction: column;
}
}
}
.chat-content-container {
/* stylelint-disable-next-line value-keyword-case */
background-color: v-bind(chatContentContainerBg);
// Adjust the padding so text field height stays 48px
.chat-message-input {
.v-field__input {
font-size: 0.9375rem !important;
line-height: 1.375rem !important;
padding-block: 0.6rem 0.5rem;
}
.v-field__append-inner {
align-items: center;
padding-block-start: 0;
}
.v-field--appended {
padding-inline-end: 8px;
}
}
}
.chat-user-profile-badge {
.v-badge__badge {
/* stylelint-disable liberty/use-logical-spec */
min-width: 12px !important;
height: 0.75rem;
/* stylelint-enable liberty/use-logical-spec */
}
}
</style>

View File

@@ -0,0 +1,25 @@
<template>
<div>
<VCard
class="mb-6"
title="Kick start your project 🚀"
>
<VCardText>All the best for your new project.</VCardText>
<VCardText>
Please make sure to read our <a
href="https://demos.pixinvent.com/vuexy-vuejs-admin-template/documentation/"
target="_blank"
rel="noopener noreferrer"
class="text-decoration-none"
>
Template Documentation
</a> to understand where to go from here and how to use our template.
</VCardText>
</VCard>
<VCard title="Want to integrate JWT? 🔒">
<VCardText>We carefully crafted JWT flow so you can implement JWT with ease and with minimum efforts.</VCardText>
<VCardText>Please read our JWT Documentation to get more out of JWT authentication.</VCardText>
</VCard>
</div>
</template>

View File

@@ -0,0 +1,185 @@
<script setup lang="ts">
import AuthProvider from '@/views/pages/authentication/AuthProvider.vue'
import { useGenerateImageVariant } from '@core/composable/useGenerateImageVariant'
import authV2LoginIllustrationBorderedDark from '@images/pages/auth-v2-login-illustration-bordered-dark.png'
import authV2LoginIllustrationBorderedLight from '@images/pages/auth-v2-login-illustration-bordered-light.png'
import authV2LoginIllustrationDark from '@images/pages/auth-v2-login-illustration-dark.png'
import authV2LoginIllustrationLight from '@images/pages/auth-v2-login-illustration-light.png'
import authV2MaskDark from '@images/pages/misc-mask-dark.png'
import authV2MaskLight from '@images/pages/misc-mask-light.png'
import { VNodeRenderer } from '@layouts/components/VNodeRenderer'
import { themeConfig } from '@themeConfig'
definePage({
meta: {
layout: 'blank',
public: true,
},
})
const form = ref({
email: '',
password: '',
remember: false,
})
const isPasswordVisible = ref(false)
const authThemeImg = useGenerateImageVariant(
authV2LoginIllustrationLight,
authV2LoginIllustrationDark,
authV2LoginIllustrationBorderedLight,
authV2LoginIllustrationBorderedDark,
true)
const authThemeMask = useGenerateImageVariant(authV2MaskLight, authV2MaskDark)
</script>
<template>
<a href="javascript:void(0)">
<div class="auth-logo d-flex align-center gap-x-3">
<VNodeRenderer :nodes="themeConfig.app.logo" />
<h1 class="auth-title">
{{ themeConfig.app.title }}
</h1>
</div>
</a>
<VRow
no-gutters
class="auth-wrapper bg-surface"
>
<VCol
md="8"
class="d-none d-md-flex"
>
<div class="position-relative bg-background w-100 me-0">
<div
class="d-flex align-center justify-center w-100 h-100"
style="padding-inline: 6.25rem;"
>
<VImg
max-width="613"
:src="authThemeImg"
class="auth-illustration mt-16 mb-2"
/>
</div>
<img
class="auth-footer-mask flip-in-rtl"
:src="authThemeMask"
alt="auth-footer-mask"
height="280"
width="100"
>
</div>
</VCol>
<VCol
cols="12"
md="4"
class="auth-card-v2 d-flex align-center justify-center"
>
<VCard
flat
:max-width="500"
class="mt-12 mt-sm-0 pa-6"
>
<VCardText>
<h4 class="text-h4 mb-1">
Welcome to <span class="text-capitalize">{{ themeConfig.app.title }}</span>! 👋🏻
</h4>
<p class="mb-0">
Please sign-in to your account and start the adventure
</p>
</VCardText>
<VCardText>
<VForm @submit.prevent="() => {}">
<VRow>
<!-- email -->
<VCol cols="12">
<AppTextField
v-model="form.email"
autofocus
label="Email or Username"
type="email"
placeholder="johndoe@email.com"
/>
</VCol>
<!-- password -->
<VCol cols="12">
<AppTextField
v-model="form.password"
label="Password"
placeholder="············"
:type="isPasswordVisible ? 'text' : 'password'"
autocomplete="password"
:append-inner-icon="isPasswordVisible ? 'tabler-eye-off' : 'tabler-eye'"
@click:append-inner="isPasswordVisible = !isPasswordVisible"
/>
<div class="d-flex align-center flex-wrap justify-space-between my-6">
<VCheckbox
v-model="form.remember"
label="Remember me"
/>
<a
class="text-primary"
href="javascript:void(0)"
>
Forgot Password?
</a>
</div>
<VBtn
block
type="submit"
>
Login
</VBtn>
</VCol>
<!-- create account -->
<VCol
cols="12"
class="text-body-1 text-center"
>
<span class="d-inline-block">
New on our platform?
</span>
<a
class="text-primary ms-1 d-inline-block text-body-1"
href="javascript:void(0)"
>
Create an account
</a>
</VCol>
<VCol
cols="12"
class="d-flex align-center"
>
<VDivider />
<span class="mx-4">or</span>
<VDivider />
</VCol>
<!-- auth providers -->
<VCol
cols="12"
class="text-center"
>
<AuthProvider />
</VCol>
</VRow>
</VForm>
</VCardText>
</VCard>
</VCol>
</VRow>
</template>
<style lang="scss">
@use "@core-scss/template/pages/page-auth";
</style>

View File

@@ -0,0 +1,13 @@
<template>
<div>
<VCard title="Create Awesome 🙌">
<VCardText>This is your second page.</VCardText>
<VCardText>
Chocolate sesame snaps pie carrot cake pastry pie lollipop muffin.
Carrot cake dragée chupa chups jujubes. Macaroon liquorice cookie
wafer tart marzipan bonbon. Gingerbread jelly-o dragée
chocolate.
</VCardText>
</VCard>
</div>
</template>