- Introduced typography styles in _typography.scss for headings, paragraphs, blockquotes, and horizontal rules. - Added utility classes in _utils.scss for card styling and clearfix. - Updated layout.scss to include new typography and utility styles. - Defined common CSS variables in _common.scss for consistent theming. - Created dark and light theme variables in _dark.scss and _light.scss respectively. - Integrated Tailwind CSS with custom configurations in tailwind.config.js and postcss.config.js. - Implemented database migrations for contact and contact_persons tables. - Added data fixtures for generating sample contact data. - Developed Contact and ContactPerson entities with appropriate validation and serialization. - Enhanced ContactRepository with search and type filtering methods.
363 lines
6.8 KiB
Vue
363 lines
6.8 KiB
Vue
<template>
|
|
<Toast />
|
|
<AppLayout v-if="authStore.isAuthenticated" />
|
|
<RouterView v-else />
|
|
</template>
|
|
|
|
<script setup>
|
|
import { RouterView } from 'vue-router';
|
|
import { useAuthStore } from './stores/auth';
|
|
import AppLayout from './layout/AppLayout.vue';
|
|
|
|
const authStore = useAuthStore();
|
|
authStore.initializeFromElement(document.getElementById('app'));
|
|
</script>
|
|
|
|
<style scoped lang="scss">
|
|
#app-layout {
|
|
min-height: 100vh;
|
|
display: flex;
|
|
flex-direction: column;
|
|
}
|
|
|
|
.app-header {
|
|
background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
|
|
color: white;
|
|
box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
|
|
|
|
.header-content {
|
|
max-width: 1400px;
|
|
margin: 0 auto;
|
|
padding: 1rem;
|
|
display: flex;
|
|
align-items: center;
|
|
gap: 1rem;
|
|
flex-wrap: wrap;
|
|
position: relative;
|
|
|
|
@media (min-width: 768px) {
|
|
padding: 1rem 2rem;
|
|
gap: 2rem;
|
|
flex-wrap: nowrap;
|
|
}
|
|
}
|
|
|
|
.logo {
|
|
display: flex;
|
|
align-items: center;
|
|
gap: 0.5rem;
|
|
font-size: 1.25rem;
|
|
font-weight: 700;
|
|
z-index: 1001;
|
|
|
|
i {
|
|
font-size: 1.5rem;
|
|
}
|
|
|
|
@media (min-width: 768px) {
|
|
font-size: 1.5rem;
|
|
|
|
i {
|
|
font-size: 1.8rem;
|
|
}
|
|
}
|
|
}
|
|
|
|
.hamburger {
|
|
display: flex;
|
|
flex-direction: column;
|
|
justify-content: space-around;
|
|
width: 2rem;
|
|
height: 2rem;
|
|
background: transparent;
|
|
border: none;
|
|
cursor: pointer;
|
|
padding: 0;
|
|
z-index: 1001;
|
|
order: 2;
|
|
margin-left: auto;
|
|
|
|
@media (min-width: 768px) {
|
|
display: none;
|
|
}
|
|
|
|
span {
|
|
width: 2rem;
|
|
height: 0.2rem;
|
|
background: white;
|
|
border-radius: 10px;
|
|
transition: all 0.3s linear;
|
|
position: relative;
|
|
transform-origin: 1px;
|
|
|
|
&:first-child {
|
|
transform: rotate(0);
|
|
}
|
|
|
|
&:nth-child(2) {
|
|
opacity: 1;
|
|
transform: translateX(0);
|
|
}
|
|
|
|
&:nth-child(3) {
|
|
transform: rotate(0);
|
|
}
|
|
}
|
|
|
|
&.active {
|
|
span:first-child {
|
|
transform: rotate(45deg);
|
|
}
|
|
|
|
span:nth-child(2) {
|
|
opacity: 0;
|
|
transform: translateX(20px);
|
|
}
|
|
|
|
span:nth-child(3) {
|
|
transform: rotate(-45deg);
|
|
}
|
|
}
|
|
}
|
|
|
|
nav {
|
|
display: none;
|
|
position: fixed;
|
|
top: 0;
|
|
right: 0;
|
|
height: 100vh;
|
|
width: 70%;
|
|
max-width: 300px;
|
|
background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
|
|
flex-direction: column;
|
|
padding: 5rem 1.5rem 2rem;
|
|
gap: 0.5rem;
|
|
transform: translateX(100%);
|
|
transition: transform 0.3s ease-in-out;
|
|
box-shadow: -2px 0 10px rgba(0, 0, 0, 0.2);
|
|
z-index: 1000;
|
|
|
|
&.open {
|
|
display: flex;
|
|
transform: translateX(0);
|
|
}
|
|
|
|
@media (min-width: 768px) {
|
|
display: flex;
|
|
position: static;
|
|
height: auto;
|
|
width: auto;
|
|
max-width: none;
|
|
flex-direction: row;
|
|
padding: 0;
|
|
gap: 0.5rem;
|
|
flex: 1;
|
|
transform: none;
|
|
box-shadow: none;
|
|
background: transparent;
|
|
order: 1;
|
|
}
|
|
|
|
a {
|
|
color: white;
|
|
text-decoration: none;
|
|
padding: 0.75rem 1rem;
|
|
border-radius: 8px;
|
|
transition: all 0.2s;
|
|
display: flex;
|
|
align-items: center;
|
|
gap: 0.5rem;
|
|
font-size: 1rem;
|
|
white-space: nowrap;
|
|
|
|
@media (min-width: 768px) {
|
|
padding: 0.6rem 1.2rem;
|
|
font-size: 1rem;
|
|
}
|
|
|
|
i {
|
|
font-size: 1.1rem;
|
|
}
|
|
|
|
&:hover {
|
|
background: rgba(255, 255, 255, 0.15);
|
|
}
|
|
|
|
&.router-link-active {
|
|
background: rgba(255, 255, 255, 0.25);
|
|
font-weight: 600;
|
|
}
|
|
}
|
|
}
|
|
|
|
.nav-dropdown {
|
|
position: relative;
|
|
|
|
.nav-dropdown-toggle {
|
|
color: white;
|
|
text-decoration: none;
|
|
padding: 0.75rem 1rem;
|
|
border-radius: 8px;
|
|
transition: all 0.2s;
|
|
display: flex;
|
|
align-items: center;
|
|
gap: 0.5rem;
|
|
font-size: 1rem;
|
|
white-space: nowrap;
|
|
cursor: pointer;
|
|
|
|
@media (min-width: 768px) {
|
|
padding: 0.6rem 1.2rem;
|
|
font-size: 1rem;
|
|
}
|
|
|
|
i {
|
|
font-size: 1.1rem;
|
|
}
|
|
|
|
.dropdown-icon {
|
|
margin-left: auto;
|
|
font-size: 0.8rem;
|
|
transition: transform 0.3s ease;
|
|
|
|
&.rotated {
|
|
transform: rotate(180deg);
|
|
}
|
|
}
|
|
|
|
&:hover {
|
|
background: rgba(255, 255, 255, 0.15);
|
|
}
|
|
|
|
&.active {
|
|
background: rgba(255, 255, 255, 0.15);
|
|
}
|
|
}
|
|
|
|
.nav-dropdown-menu {
|
|
display: flex;
|
|
flex-direction: column;
|
|
gap: 0.25rem;
|
|
padding-left: 1rem;
|
|
margin-top: 0.25rem;
|
|
|
|
@media (min-width: 768px) {
|
|
position: absolute;
|
|
top: 100%;
|
|
left: 0;
|
|
background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
|
|
border-radius: 8px;
|
|
box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
|
|
padding: 0.5rem;
|
|
margin-top: 0.5rem;
|
|
min-width: 220px;
|
|
z-index: 1000;
|
|
}
|
|
|
|
a {
|
|
color: white;
|
|
text-decoration: none;
|
|
padding: 0.6rem 1rem;
|
|
border-radius: 6px;
|
|
transition: all 0.2s;
|
|
display: flex;
|
|
align-items: center;
|
|
gap: 0.5rem;
|
|
font-size: 0.95rem;
|
|
|
|
i {
|
|
font-size: 1rem;
|
|
}
|
|
|
|
&:hover {
|
|
background: rgba(255, 255, 255, 0.2);
|
|
}
|
|
|
|
&.router-link-active {
|
|
background: rgba(255, 255, 255, 0.3);
|
|
font-weight: 600;
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
.user-info {
|
|
display: flex;
|
|
align-items: center;
|
|
gap: 0.5rem;
|
|
margin-left: auto;
|
|
order: 3;
|
|
|
|
@media (min-width: 768px) {
|
|
gap: 1rem;
|
|
order: 2;
|
|
}
|
|
|
|
span {
|
|
font-weight: 500;
|
|
font-size: 0.9rem;
|
|
display: none;
|
|
|
|
@media (min-width: 768px) {
|
|
display: inline;
|
|
font-size: 1rem;
|
|
}
|
|
}
|
|
|
|
.logout-link {
|
|
color: white;
|
|
text-decoration: none;
|
|
padding: 0.5rem 0.8rem;
|
|
border-radius: 6px;
|
|
background: rgba(255, 255, 255, 0.1);
|
|
transition: all 0.2s;
|
|
display: flex;
|
|
align-items: center;
|
|
gap: 0.4rem;
|
|
font-size: 0.9rem;
|
|
|
|
@media (min-width: 768px) {
|
|
padding: 0.5rem 1rem;
|
|
gap: 0.5rem;
|
|
font-size: 1rem;
|
|
}
|
|
|
|
&:hover {
|
|
background: rgba(255, 255, 255, 0.2);
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
.app-main {
|
|
flex: 1;
|
|
padding: 1rem;
|
|
max-width: 1400px;
|
|
width: 100%;
|
|
margin: 0 auto;
|
|
box-sizing: border-box;
|
|
|
|
@media (min-width: 768px) {
|
|
padding: 2rem;
|
|
}
|
|
}
|
|
|
|
.app-footer {
|
|
background: #f8f9fa;
|
|
padding: 0.75rem 1rem;
|
|
text-align: center;
|
|
color: #6c757d;
|
|
border-top: 1px solid #dee2e6;
|
|
font-size: 0.875rem;
|
|
|
|
@media (min-width: 768px) {
|
|
padding: 1rem 2rem;
|
|
font-size: 1rem;
|
|
}
|
|
|
|
p {
|
|
margin: 0;
|
|
}
|
|
}
|
|
</style>
|