XRoomDashboardFront/xroom-dashboard/src/App.vue

211 lines
3.7 KiB
Vue
Raw Normal View History

2025-04-14 13:09:00 +00:00
<template>
<div id="app">
<!-- Dashboard Layout -->
<template v-if="isDashboardLayout">
<SidebarMenu :isOpen="isSidebarOpen" @close="isSidebarOpen = false" />
<div class="dashboard-page">
<div class="content">
<AppHeader @toggle-sidebar="toggleSidebar" :pageTitle="$route.meta.title" />
<router-view></router-view>
</div>
</div>
</template>
2025-04-14 13:09:00 +00:00
<!-- Sample Layout for SignUp, etc. -->
<template v-else>
<router-view></router-view>
</template>
2025-05-03 11:02:18 +00:00
2025-06-11 15:53:24 +00:00
<Footer />
</div>
2025-04-14 13:09:00 +00:00
</template>
2025-04-14 13:09:00 +00:00
<script>
import AppHeader from '@/components/Header.vue';
import SidebarMenu from '@/components/SidebarMenu.vue';
import Footer from '@/components/Footer.vue';
2025-05-03 11:02:18 +00:00
2025-04-14 13:09:00 +00:00
export default {
name: 'App',
2025-05-03 11:02:18 +00:00
components: {
Footer,
SidebarMenu,
AppHeader,
},
data() {
return {
isSidebarOpen: false
};
},
computed: {
isDashboardLayout() {
return this.$route.meta.requiresAuth === true;
}
},
methods: {
toggleSidebar() {
this.isSidebarOpen = !this.isSidebarOpen;
}
},
2025-06-11 15:53:24 +00:00
mounted() {
const content = document.querySelector('.content');
if (content) {
content.addEventListener('scroll', () => {
document.body.scrollTop = content.scrollTop;
document.documentElement.scrollTop = content.scrollTop;
});
}
}
};
2025-04-14 13:09:00 +00:00
</script>
2025-04-14 13:09:00 +00:00
<style scoped>
/* Reset default margins and set base font */
2025-04-14 13:09:00 +00:00
body {
margin: 0;
padding: 0;
font-family: 'Yekan', 'Arial', sans-serif;
background-color: #f4f7fa;
overflow-x: hidden;
overflow-y: auto;
height: 100%;
2025-04-14 13:09:00 +00:00
}
/* App title styling */
2025-04-14 13:09:00 +00:00
.app-title {
color: #fff;
font-size: 2rem;
font-weight: 700;
2025-04-14 13:09:00 +00:00
margin: 0;
}
/* Main app container */
2025-04-14 13:09:00 +00:00
#app {
display: flex;
flex-direction: column;
min-height: 100vh;
overflow-y: auto;
2025-04-14 13:09:00 +00:00
}
/* Router view content */
2025-04-14 13:09:00 +00:00
router-view {
flex-grow: 1;
padding: 1.25rem;
2025-04-14 13:09:00 +00:00
}
2025-04-14 13:09:00 +00:00
</style>
<style>
/* Font Face Declaration */
2025-04-14 13:09:00 +00:00
@font-face {
2025-05-03 11:02:18 +00:00
font-family: 'IRANSans';
src: url('@/assets/fonts/IRANSansXFaNum-Medium.ttf') format('truetype');
font-weight: 500;
2025-04-14 13:09:00 +00:00
font-style: normal;
font-display: swap;
2025-04-14 13:09:00 +00:00
}
/* Global Font Application */
2025-05-03 11:02:18 +00:00
* {
font-family: 'IRANSans', sans-serif !important;
2025-04-14 13:09:00 +00:00
}
/* Base Content Styles */
.content {
background-color: #f8f9fa;
border-radius: 20px;
display: flex;
flex-direction: column;
gap: 32px;
padding: 35px 80px;
2025-06-11 15:53:24 +00:00
height: 100vh;
overflow-y: scroll;
box-sizing: border-box;
}
2025-06-11 15:53:24 +00:00
.content::-webkit-scrollbar {
width: 0;
display: none;
}
/* Responsive Styles */
@media (max-width: 520px) {
.dashboard-page {
2025-06-03 23:27:19 +00:00
padding: 0;
direction: rtl;
}
.content {
padding: 5px 15px !important;
2025-06-02 20:09:51 +00:00
gap: 0;
2025-06-03 23:27:19 +00:00
border-radius: 0;
}
}
@media (min-width: 521px) and (max-width: 780px) {
.dashboard-page {
2025-06-03 23:27:19 +00:00
padding: 0;
direction: rtl;
}
.content {
2025-06-02 20:09:51 +00:00
padding: 0px 15px !important;
padding-bottom: 45px !important;
gap: 0;
2025-06-03 23:27:19 +00:00
border-radius: 0;
}
}
@media (min-width: 781px) and (max-width: 1024px) {
.dashboard-page {
margin-right: 20rem;
padding: 20px;
direction: rtl;
}
.content {
padding: 15px 45px 45px 0 !important;
2025-06-02 20:09:51 +00:00
gap: 0;
}
}
2025-06-02 20:09:51 +00:00
@media (min-width: 1024px) and (max-width: 1280px) {
.dashboard-page {
margin-right: 20rem;
padding: 20px;
direction: rtl;
}
.content {
2025-06-02 20:09:51 +00:00
padding: 35px 45px !important;
}
}
@media (min-width: 1280px) and (max-width : 1440px){
.dashboard-page {
2025-06-11 15:53:24 +00:00
margin-right: 20rem;
2025-06-02 20:09:51 +00:00
padding: 20px;
direction: rtl;
}
.content {
padding: 35px 45px !important;
}
}
2025-06-11 15:53:24 +00:00
@media (min-width: 1440px){
2025-06-02 20:09:51 +00:00
.dashboard-page {
2025-06-11 15:53:24 +00:00
margin-right: 20rem;
2025-06-02 20:09:51 +00:00
padding: 20px;
direction: rtl;
}
.content {
padding: 35px 80px !important;
}
}
2025-04-14 13:09:00 +00:00
</style>